diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-17 13:04:01 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-17 13:04:01 +0000 |
commit | 29d5a7ab75e224797d014c8954d086cd898a2304 (patch) | |
tree | 8741b1aaedc5b875f816eebd90e2430bba459777 /spec/factories | |
parent | f662bc5a866dc24580caa48952f25061bae60d1a (diff) | |
parent | d5fa77d53d73b9d47647443460d2ea95babb52e4 (diff) | |
download | gitlab-ce-29d5a7ab75e224797d014c8954d086cd898a2304.tar.gz |
Merge branch '26500-informative-slack-notifications' into 'master'
Adding links to user & build stage in a Build message
Closes #26500
See merge request !8641
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/builds.rb | 12 | ||||
-rw-r--r-- | spec/factories/commits.rb | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 0397d5d4001..e4cac0e1058 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -128,5 +128,17 @@ FactoryGirl.define do build.save! end end + + trait :with_commit do + after(:build) do |build| + allow(build).to receive(:commit).and_return build(:commit, :without_author) + end + end + + trait :with_commit_and_author do + after(:build) do |build| + allow(build).to receive(:commit).and_return build(:commit) + end + end end end diff --git a/spec/factories/commits.rb b/spec/factories/commits.rb index ac6eb0a7897..89e260cf65b 100644 --- a/spec/factories/commits.rb +++ b/spec/factories/commits.rb @@ -8,5 +8,15 @@ FactoryGirl.define do initialize_with do new(git_commit, project) end + + after(:build) do |commit| + allow(commit).to receive(:author).and_return build(:author) + end + + trait :without_author do + after(:build) do |commit| + allow(commit).to receive(:author).and_return nil + end + end end end |