diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2017-12-18 13:14:51 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-01-17 11:55:00 +0300 |
commit | 337ced28bcdff25a2d2d4c726d37c782c4cc2d24 (patch) | |
tree | 21dc95292df2efc63d1a8b4ff2aa53578a966390 /spec/controllers/projects | |
parent | eb5e0e921c017322ad8f9122d897b0cf39c0b294 (diff) |
reference triggers.values for permitted parameters
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/hooks_controller_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/controllers/projects/hooks_controller_spec.rb b/spec/controllers/projects/hooks_controller_spec.rb index aba70c6d4c1..2d473d5bf52 100644 --- a/spec/controllers/projects/hooks_controller_spec.rb +++ b/spec/controllers/projects/hooks_controller_spec.rb @@ -18,4 +18,30 @@ describe Projects::HooksController do ) end end + + describe '#create' do + it 'sets all parameters' do + hook_params = { + enable_ssl_verification: true, + token: "TEST TOKEN", + url: "http://example.com", + + push_events: true, + tag_push_events: true, + merge_requests_events: true, + issues_events: true, + confidential_issues_events: true, + note_events: true, + job_events: true, + pipeline_events: true, + wiki_page_events: true + } + + post :create, namespace_id: project.namespace, project_id: project, hook: hook_params + + expect(response).to have_http_status(302) + expect(ProjectHook.all.size).to eq(1) + expect(ProjectHook.first).to have_attributes(hook_params) + end + end end |