diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-22 15:26:28 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:42:19 +0100 |
commit | 8c11c9d8e03da1cbe9c253e3fe8a9b10173e526d (patch) | |
tree | 214fb975d0ec48d20d8da766191871be3383baaa | |
parent | fd0c811cc4e01435ca89a419a521f6ac31a858b1 (diff) |
Give incoming message a body attachment
By default, give an incoming message a body attachment.
-rw-r--r-- | spec/factories.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/factories.rb b/spec/factories.rb index 2a7ac6e5a..1784a3941 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -20,6 +20,11 @@ FactoryGirl.define do last_parsed { 1.week.ago } sent_at { 1.week.ago } mail_from 'A Public Body' + after(:create) do |incoming_message, evaluator| + FactoryGirl.create(:body_text, + incoming_message: incoming_message, + url_part_number: 1) + end factory :incoming_message_with_attachments do # foi_attachments_count is declared as an ignored attribute and available in # attributes on the factory, as well as the callback via the evaluator @@ -31,9 +36,6 @@ FactoryGirl.define do # evaluator, which stores all values from the factory, including ignored # attributes; after(:create) do |incoming_message, evaluator| - FactoryGirl.create(:body_text, - incoming_message: incoming_message, - url_part_number: 1) evaluator.foi_attachments_count.times do |count| FactoryGirl.create(:pdf_attachment, incoming_message: incoming_message, |