diff options
author | Henare Degan <henare.degan@gmail.com> | 2012-12-12 14:18:33 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2012-12-12 15:39:24 +1100 |
commit | 0a5b470e28f67c191d962706cf5b1be039d770bf (patch) | |
tree | 12eee9d6111e2710788a5dfa9ae4e6dfd48faa8a | |
parent | 1beb9b6abea59a231b1799283d9a59388d9a7659 (diff) |
Allow the FoiAttachment specs to run
-rw-r--r-- | spec/spec_helper.rb.rails2 | 8 | ||||
-rw-r--r-- | spec/support/load_raw_emails.rb | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/spec/spec_helper.rb.rails2 b/spec/spec_helper.rb.rails2 index c433896e7..ab2f11d27 100644 --- a/spec/spec_helper.rb.rails2 +++ b/spec/spec_helper.rb.rails2 @@ -107,14 +107,6 @@ def parse_all_incoming_messages IncomingMessage.find(:all).each{ |x| x.parse_raw_email! } end -def load_raw_emails_data - raw_emails_yml = File.join(Spec::Runner.configuration.fixture_path, "raw_emails.yml") - for raw_email_id in YAML::load_file(raw_emails_yml).map{|k,v| v["id"]} do - raw_email = RawEmail.find(raw_email_id) - raw_email.data = load_file_fixture("raw_emails/%d.email" % [raw_email_id]) - end -end - # Rebuild the current xapian index def rebuild_xapian_index(terms = true, values = true, texts = true, dropfirst = true) if dropfirst diff --git a/spec/support/load_raw_emails.rb b/spec/support/load_raw_emails.rb new file mode 100644 index 000000000..db9e2884e --- /dev/null +++ b/spec/support/load_raw_emails.rb @@ -0,0 +1,7 @@ +def load_raw_emails_data + raw_emails_yml = File.join(RSpec.configuration.fixture_path, "raw_emails.yml") + for raw_email_id in YAML::load_file(raw_emails_yml).map{|k,v| v["id"]} do + raw_email = RawEmail.find(raw_email_id) + raw_email.data = load_file_fixture("raw_emails/%d.email" % [raw_email_id]) + end +end |