aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-07-25 13:29:55 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-07-25 14:07:21 +0100
commita51aa8a93246e6c10efec14dec8efbdf3301db5f (patch)
tree42ed43dd8ac5db14bbb7173f5784d0b0edbe2fd6 /spec/spec_helper.rb
parentb1559ff033a3eeb289d50d1caadba0190a139cd9 (diff)
move load-email-fixtures-to-filesystem hack to global config, so that we don't need to remember to run it everywhere that the raw_emails fixture is used. At the same time, correct the migration that previously removed the data_binary column, as this is assumed for fixture loading. In a future iteration, we should probably stop abusing fixtures like this...
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index bbcc9aa23..086def32a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -30,6 +30,22 @@ Spec::Runner.configure do |config|
# in your config/boot.rb
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: