aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/foi_attchments.rb5
-rw-r--r--spec/factories/incoming_messages.rb8
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/factories/foi_attchments.rb b/spec/factories/foi_attchments.rb
index 4e9875a00..a1d04ccf0 100644
--- a/spec/factories/foi_attchments.rb
+++ b/spec/factories/foi_attchments.rb
@@ -16,6 +16,11 @@ FactoryGirl.define do
filename 'interesting.rtf'
body { load_file_fixture('interesting.rtf') }
end
+ factory :html_attachment do
+ content_type 'text/html'
+ filename 'interesting.html'
+ body { load_file_fixture('interesting.html') }
+ end
end
end
diff --git a/spec/factories/incoming_messages.rb b/spec/factories/incoming_messages.rb
index 16930b887..b29fe8ce9 100644
--- a/spec/factories/incoming_messages.rb
+++ b/spec/factories/incoming_messages.rb
@@ -26,6 +26,14 @@ FactoryGirl.define do
end
end
+ factory :incoming_message_with_html_attachment do
+ after_create do |incoming_message, evaluator|
+ FactoryGirl.create(:html_attachment,
+ :incoming_message => incoming_message,
+ :url_part_number => 2)
+ end
+ 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