aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-09-26 10:12:14 +0100
committerGareth Rees <gareth@mysociety.org>2014-09-26 10:12:14 +0100
commite5a9052a9ffd27117775e8adaeaa2e24607e8000 (patch)
treece6f8e5802de320d6eff077e79f06be169f0b4d6
parent58df56cda975b7ce9f88341082b5a0e824467598 (diff)
parentd255b1ac901a059c70eaf4e4383bb219e9aa97ba (diff)
Merge branch 'issues/1778-valid-outgoing-msg-factory' into rails-3-develop
-rw-r--r--spec/factories/outgoing_messages.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/factories/outgoing_messages.rb b/spec/factories/outgoing_messages.rb
index d1ed25093..3887d3f48 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'
@@ -17,6 +19,13 @@ FactoryGirl.define do
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,