diff options
author | Jarka Košanová <jarka@gitlab.com> | 2019-07-04 20:09:58 +0300 |
---|---|---|
committer | Jarka Košanová <jarka@gitlab.com> | 2019-07-11 12:59:53 +0300 |
commit | e276f44b40e6b06c829bec33d843bafbc91d5281 (patch) | |
tree | 2990b0fb4badc19dbdb3b7773c203589b7c4053d /spec/factories/services.rb | |
parent | 630a8e80501aff46526086e8f2c72bb846780390 (diff) |
Make sure all specs run properly
- handling properties needs to be skipped when
creating test records in order to test the legacy
data
Diffstat (limited to 'spec/factories/services.rb')
-rw-r--r-- | spec/factories/services.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/factories/services.rb b/spec/factories/services.rb index ecb481ed84a..cd1d2c33373 100644 --- a/spec/factories/services.rb +++ b/spec/factories/services.rb @@ -100,4 +100,16 @@ FactoryBot.define do type 'HipchatService' token 'test_token' end + + trait :without_properties_callback do + after(:build) do |service| + allow(service).to receive(:handle_properties) + end + + after(:create) do |service| + # we have to remove the stub because the behaviour of + # handle_properties method is tested after the creation + allow(service).to receive(:handle_properties).and_call_original + end + end end |