diff options
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 086def32a..42c5ff6bf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,9 +13,6 @@ config['ADMIN_PASSWORD'] = 'baz' # tests assume 20 days config['REPLY_LATE_AFTER_DAYS'] = 20 -# tests assume 20 days -config['RAW_EMAILS_LOCATION'] = 'files/raw_emails_tests' - # Uncomment the next line to use webrat's matchers #require 'webrat/integrations/rspec-rails' @@ -31,21 +28,6 @@ Spec::Runner.configure do |config| config.fixture_path = RAILS_ROOT + '/spec/fixtures/' - config.before(:each) do - # XXX this is a hack around the fact that our raw_email model - # is in transition to something that doesn't actually live in - # the database at all. The raw_email *fixture* saves to the - # model, the model then needs to be told to save itself on the - # filesystem. - begin - raw_email = raw_emails(:useless_raw_email) - raw_email.data=raw_email.dbdata - rescue NoMethodError - # only do it in tests with raw_emails fixtures - end - end - - # == Fixtures # # You can declare fixtures for each example_group like this: @@ -164,3 +146,12 @@ if $tempfilecount.nil? puts "WARNING: HTML validation script " + $html_validation_script + " not found" end end + +def load_raw_emails_data(raw_emails) + raw_email = raw_emails(:useless_raw_email) + begin + raw_email.destroy_file_representation! + rescue Errno::ENOENT + end + raw_email.data = load_file_fixture("useless_raw_email.email") +end |