diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-03-25 11:03:12 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-03-25 15:14:49 +0000 |
commit | 9fbca08732650407f697b7d76eee174968e15cdc (patch) | |
tree | 0c60cd57867c9b0d0793f09177a1704a2bb2f780 /spec/factories/outgoing_messages.rb | |
parent | 7a108776e4f45b10ef5956326fdd9c66514d1ddd (diff) |
Split factories in to individual files
Factories are loaded automatically from:
- test/factories.rb
- spec/factories.rb
- test/factories/*.rb
- spec/factories/*.rb
Keeping factories per-model helps navigation, especially when they get
more complex with traits and inheritance.
Diffstat (limited to 'spec/factories/outgoing_messages.rb')
-rw-r--r-- | spec/factories/outgoing_messages.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/factories/outgoing_messages.rb b/spec/factories/outgoing_messages.rb new file mode 100644 index 000000000..d1ed25093 --- /dev/null +++ b/spec/factories/outgoing_messages.rb @@ -0,0 +1,29 @@ +FactoryGirl.define do + + factory :outgoing_message do + factory :initial_request do + ignore do + status 'ready' + message_type 'initial_request' + body 'Some information please' + what_doing 'normal_sort' + end + end + factory :internal_review_request do + ignore do + status 'ready' + message_type 'followup' + body 'I want a review' + what_doing 'internal_review' + end + end + 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 + end + end + +end |