diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-07-20 16:45:19 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-07-20 17:59:34 -0600 |
commit | 97c4a1dceab97cd1388f5bdb1d3f4fd3d228f94b (patch) | |
tree | 51cfb45ab2e985f81730075a6c0d4dd62ed2459f /spec/factories/issues.rb | |
parent | 9de377267dc7ea9b72e02e6dc5a083cdc3ee980b (diff) | |
download | gitlab-ce-97c4a1dceab97cd1388f5bdb1d3f4fd3d228f94b.tar.gz |
Refactor Issues::BulkUpdateService specrs-bulk-issues-update-spec
- Create fewer Issue objects; 2 is as good as 5 for these cases. This
gives us a nice little speed improvement.
- Don't `describe` Symbols.
- Simplify object creation.
- Lessen "mystery guest" antipattern
Diffstat (limited to 'spec/factories/issues.rb')
-rw-r--r-- | spec/factories/issues.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb index e72aa9479b7..2c0a2dd94ca 100644 --- a/spec/factories/issues.rb +++ b/spec/factories/issues.rb @@ -18,5 +18,15 @@ FactoryGirl.define do factory :closed_issue, traits: [:closed] factory :reopened_issue, traits: [:reopened] + + factory :labeled_issue do + transient do + labels [] + end + + after(:create) do |issue, evaluator| + issue.update_attributes(labels: evaluator.labels) + end + end end end |