summaryrefslogtreecommitdiff
path: root/spec/factories/services.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/services.rb')
-rw-r--r--spec/factories/services.rb12
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