diff options
| author | mo khan <mo@mokhan.ca> | 2021-07-10 21:06:41 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-07-10 21:06:41 -0600 |
| commit | 11696abe0e793752b258ad086cfd8fc35aab87f8 (patch) | |
| tree | 394c4f7ab99441a1db3dabaf7405a49b637b7981 | |
| parent | edd17c3764ff7607346dd2a4045e9ed59b15e028 (diff) | |
test: accept web hook for new installation
| -rw-r--r-- | config/application.rb | 2 | ||||
| -rw-r--r-- | test/controllers/githubs_controller_test.rb | 38 |
2 files changed, 39 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb index e94642d..575f8bf 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,6 +16,6 @@ module Sparkles class Application < Rails::Application config.load_defaults 6.1 config.generators.system_tests = nil - config.logger = Logger.new(STDOUT) + #config.logger = Logger.new(STDOUT) end end diff --git a/test/controllers/githubs_controller_test.rb b/test/controllers/githubs_controller_test.rb new file mode 100644 index 0000000..716b0ea --- /dev/null +++ b/test/controllers/githubs_controller_test.rb @@ -0,0 +1,38 @@ +require "test_helper" + +class GithubsControllerTest < ActionDispatch::IntegrationTest + test "accepts a new app installation webhook" do + post '/github', params: { + "zen": "Design for failure.", + "hook_id": 306990071, + "hook": { + "type": "App", + "id": 306990071, + "name": "web", + "active": true, + "events": [ + "commit_comment", + "create", + "delete", + "meta", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "workflow_dispatch", + "workflow_run" + ], + "config": { + "content_type": "json", + "insecure_ssl": "0", + "url": "https://f92dbf01bd27.ngrok.io/gh/hook/" + }, + "updated_at": "2021-07-11T02:15:28Z", + "created_at": "2021-07-11T02:15:28Z", + "app_id": 125988, + "deliveries_url": "https://api.github.com/app/hook/deliveries" + } + } + + assert_response :no_content + end +end |
