Sha256: cd0bb02b4c1d3de921acf7a2566d27d031c4e2b992868ddc9c3774b5a9ae76d5

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../dummy/config/environment.rb',  __FILE__)
require 'rspec/rails'
require 'shoulda-matchers'
require 'capybara/rails'
require 'capybara/rspec'
require 'database_cleaner'
require 'factory_girl'
require 'timecop'

Rails.backtrace_cleaner.remove_silencers!
DatabaseCleaner.strategy = :truncation

# No longer autoloading support, individually requiring instead.
#
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

# Load factory girl factories.
Dir[File.join(File.dirname(__FILE__), 'factories/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
  config.infer_spec_type_from_file_location!
  config.order = :random
  config.use_transactional_fixtures = true

  # config.mock_with :rspec

  config.expect_with :rspec do |expectations|
    expectations.syntax = :expect
  end

  config.mock_with :rspec do |mocks|
    mocks.syntax = :expect
  end


  config.after(:each, :type => :feature) do
    DatabaseCleaner.clean       # Truncate the database
    Capybara.reset_sessions!    # Forget the (simulated) browser state
    Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
  end
end


def restore_default_configuration
  puts 'restore_default_configuration called!!!!!!!!!!!!!!!!!!!!!'
end

def mock_request(params = {})
  req = double("request")
  allow(req).to receive(:params).and_return(params)
  allow(req).to receive(:remote_ip).and_return('111.111.111.111')
  req
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.3.1 spec/spec_helper.rb
authenticate-0.3.0 spec/spec_helper.rb