This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
# Requires supporting files with custom matchers and macros, etc, | |
# in ./support/ and its subdirectories. | |
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | |
RSpec.configure do |config| | |
config.mock_with :mocha | |
config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
config.use_transactional_fixtures = true | |
end | |
module AuthlogicTestHelper | |
def login_as(user) | |
@user_session = mock('user_session') | |
@user_session.stubs(:user).returns(user) | |
@user_session.stubs(:record).returns(user) | |
@user_session.stubs(:destroy) | |
UserSession.stubs(:find).returns(@user_session) | |
end | |
def user_logout | |
@user_session = nil | |
UserSession.stubs(:find).returns(nil) | |
end | |
end | |
include AuthlogicTestHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3' | |
group :test do | |
gem "rspec-rails", ">= 2.0.0.beta.20" | |
gem "mocha" | |
gem "factory_girl_rails" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment