aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-07-30 02:42:59 +0200
committerDavid Cabo <david@calibea.com>2011-07-30 02:42:59 +0200
commit13035996a5a794051507f5927cb2f00104be34c0 (patch)
tree54b65e55f796c54cb623422c7d0d979ecdf072ca /spec/spec_helper.rb
parenta4ee2cfdc61aefda87f3585187cedc6f283505a6 (diff)
parentfaa8c8ed4a3de3ad5b41dc63a2d32dd4c92a444e (diff)
Merge branch 'master' of github.com:sebbacon/alaveteli into asktheeu
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb27
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