aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/incoming_message_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-29 16:26:50 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-29 16:26:50 +0000
commit5aa2bd13042110e73212f83564c35b3a1d672bbb (patch)
treeba9cea38b8c326a8384da8848fad33e8ee650edb /spec/models/incoming_message_spec.rb
parentcc3b87f5367679ba9f68e88f02ec16fa9172bb0a (diff)
Load all raw emails for testing
Previously there was just one raw email, and the test code relied on that fact. Generalise it to handle multiple raw emails. This change causes a number of tests to fail, because it exposes failures that should have happened when the second raw email was added but were masked by the fact that the text of this second raw email was never loaded. These failures will be fixed in the next commit.
Diffstat (limited to 'spec/models/incoming_message_spec.rb')
-rw-r--r--spec/models/incoming_message_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index 7808ef24c..c096e61e0 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -6,7 +6,7 @@ describe IncomingMessage, " when dealing with incoming mail" do
before(:each) do
@im = incoming_messages(:useless_incoming_message)
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
after(:all) do
@@ -236,7 +236,7 @@ describe IncomingMessage, " when censoring data" do
@censor_rule_2.last_edit_comment = "none"
@im.info_request.censor_rules << @censor_rule_2
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should do nothing to a JPEG" do
@@ -336,7 +336,7 @@ describe IncomingMessage, " when censoring whole users" do
@censor_rule_1.last_edit_editor = "unknown"
@censor_rule_1.last_edit_comment = "none"
@im.info_request.user.censor_rules << @censor_rule_1
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should apply censor rules to HTML files" do
@@ -357,7 +357,7 @@ describe IncomingMessage, " when uudecoding bad messages" do
fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users, :foi_attachments
before(:each) do
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should be able to do it at all" do
@@ -401,7 +401,7 @@ describe IncomingMessage, "when messages are attached to messages" do
fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users, :foi_attachments
before(:each) do
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should flatten all the attachments out" do
@@ -426,7 +426,7 @@ describe IncomingMessage, "when Outlook messages are attached to messages" do
fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users, :foi_attachments
before(:each) do
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should flatten all the attachments out" do
@@ -449,7 +449,7 @@ describe IncomingMessage, "when TNEF attachments are attached to messages" do
fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users, :foi_attachments
before(:each) do
- load_raw_emails_data(raw_emails)
+ load_raw_emails_data
end
it "should flatten all the attachments out" do