Commit 9fdcbcb0 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Have trait all_events_enabled so that's easier to reuse, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13823349
parent d5264e88
...@@ -5,5 +5,17 @@ FactoryGirl.define do ...@@ -5,5 +5,17 @@ FactoryGirl.define do
trait :token do trait :token do
token { SecureRandom.hex(10) } token { SecureRandom.hex(10) }
end end
trait :all_events_enabled do
%w[push_events
merge_requests_events
tag_push_events
issues_events
note_events
build_events
pipeline_events].each do |event|
send(event, true)
end
end
end end
end end
...@@ -7,10 +7,9 @@ describe API::API, 'ProjectHooks', api: true do ...@@ -7,10 +7,9 @@ describe API::API, 'ProjectHooks', api: true do
let!(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
let!(:hook) do let!(:hook) do
create(:project_hook, create(:project_hook,
project: project, url: "http://example.com", :all_events_enabled,
push_events: true, merge_requests_events: true, project: project,
tag_push_events: true, issues_events: true, note_events: true, url: 'http://example.com',
build_events: true, pipeline_events: true,
enable_ssl_verification: true) enable_ssl_verification: true)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment