test/helper.rb in challah-0.3.3 vs test/helper.rb in challah-0.3.4

- old
+ new

@@ -20,10 +20,11 @@ require 'factories' require 'rails/test_help' # Load the challah libraries require 'challah' +require 'challah/test' # Setup the challah app, including running migrations within the rails app # TODO - this causes some annoying output in 1.9.3, still works, but would like to suppress `rake --rakefile #{File.join(sample_root, 'Rakefile')} challah:setup:migrations` @@ -35,35 +36,10 @@ # so we can have a transactional rollback after each test. class ActiveSupport::TestCase self.use_transactional_fixtures = true end -# Used to persist session data in test mode instead of using cookies. Stores the session -# data lazily in a global var, accessible across the testing environment. -class TestSessionStore - def initialize(session = nil) - @session = session - end - - def destroy - $challah_test_session = nil - end - - def read - if $challah_test_session - return $challah_test_session.to_s.split(':') - end - - nil - end - - def save(token, user_id) - $challah_test_session = "#{token}:#{user_id}" - true - end -end - class MockController include Challah::Controller attr_accessor :request, :session @@ -114,11 +90,9 @@ def user_agent "Some Cool Browser" end end - -Challah.options[:storage_class] = TestSessionStore # Monkey patch fix for shoulda and Rails 3.1+. module Shoulda module ActiveRecord module Matchers \ No newline at end of file