diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-07-21 01:45:19 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-07-21 02:59:34 +0300 |
commit | 97c4a1dceab97cd1388f5bdb1d3f4fd3d228f94b (patch) | |
tree | 51cfb45ab2e985f81730075a6c0d4dd62ed2459f /spec/factories/issues.rb | |
parent | 9de377267dc7ea9b72e02e6dc5a083cdc3ee980b (diff) |
Refactor Issues::BulkUpdateService 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 |