aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories/outgoing_messages.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-12-03 09:22:41 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-03 09:22:41 +0000
commit7414ed478f212be2b48c95fafde15726b348b197 (patch)
tree1d89b90f604b837b097fb4274775c4f3b3a319d6 /spec/factories/outgoing_messages.rb
parent479c9cd4567e2042d00c347f25a411373a6b1df9 (diff)
parentd05082c1cf1ddec789e547b54943f6e7d5bdffc1 (diff)
Merge branch 'release/0.20'0.20.0.0
Conflicts: config/general.yml-example
Diffstat (limited to 'spec/factories/outgoing_messages.rb')
-rw-r--r--spec/factories/outgoing_messages.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/factories/outgoing_messages.rb b/spec/factories/outgoing_messages.rb
index d1ed25093..e11cbdfb9 100644
--- a/spec/factories/outgoing_messages.rb
+++ b/spec/factories/outgoing_messages.rb
@@ -1,6 +1,8 @@
FactoryGirl.define do
factory :outgoing_message do
+ info_request
+
factory :initial_request do
ignore do
status 'ready'
@@ -8,7 +10,9 @@ FactoryGirl.define do
body 'Some information please'
what_doing 'normal_sort'
end
+
end
+
factory :internal_review_request do
ignore do
status 'ready'
@@ -16,14 +20,27 @@ FactoryGirl.define do
body 'I want a review'
what_doing 'internal_review'
end
+
end
+
+ # FIXME: This here because OutgoingMessage has an after_initialize,
+ # which seems to call everything in the app! FactoryGirl calls new with
+ # no parameters and then uses the assignment operator of each attribute
+ # to update it. Because after_initialize executes before assigning the
+ # attributes, loads of stuff fails because whatever after_initialize is
+ # doing expects some of the attributes to be there.
initialize_with { OutgoingMessage.new({ :status => status,
:message_type => message_type,
:body => body,
:what_doing => what_doing }) }
+
after_create do |outgoing_message|
- outgoing_message.send_message
+ outgoing_message.sendable?
+ outgoing_message.record_email_delivery(
+ 'test@example.com',
+ 'ogm-14+537f69734b97c-1ebd@localhost')
end
+
end
end