-
-
Save netinlet/0d3ea01ffe4a15f4b2b3 to your computer and use it in GitHub Desktop.
Spec Helper
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
# | |
# == Notes | |
# | |
# For more information take a look at Spec::Runner::Configuration and Spec::Runner | |
require 'rubygems' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) | |
require 'spec/autorun' | |
require 'spec/rails' | |
# Requires supporting files with custom matchers and macros, etc, | |
# in ./support/ and its subdirectories. | |
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f} | |
Spec::Runner.configure do |config| | |
config.use_transactional_fixtures = true | |
config.use_instantiated_fixtures = false | |
config.before(:each) do | |
Rails.logger.warn "ZipsTerritory.count == #{ZipsTerritory.count}" | |
end | |
# == Fixtures | |
# | |
# You can declare fixtures for each example_group like this: | |
# describe "...." do | |
# fixtures :table_a, :table_b | |
# | |
# Alternatively, if you prefer to declare them only once, you can | |
# do so right here. Just uncomment the next line and replace the fixture | |
# names with your fixtures. | |
# | |
config.global_fixtures = :products | |
config.fixture_path = RAILS_ROOT + '/spec/fixtures/' | |
# == Factories | |
# | |
# FactoryGirl... | |
require File.dirname(__FILE__) + '/factories' | |
# MileMeter Fixture Factory (pre-FactoryGirl) | |
require 'test/fixture_factory' | |
# == Helpers | |
# | |
# Necessary for running individual tests which use login_as() | |
include AuthenticatedTestHelper | |
def mock_time_zone(t = Time.zone.now) | |
@time_now = t | |
@time_zone = Time.zone | |
@time_zone.stub!(:now).and_return(@time_now) | |
Time.stub!(:zone).and_return(@time_zone) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 48 includes AuthenticatedTestHelper in the top level object. Change that to: