Sha256: 807224c9d3ec0a7ed7c29b7b10261b2a2c5a09fb25547f1d7d7a96736e21bca1

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

# Configure Rails Envinronment
ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment.rb",  __FILE__)
require "rails/test_help"

ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default_url_options[:host] = "test.com"

Rails.backtrace_cleaner.remove_silencers!

# Configure capybara for integration testing
require "capybara/rails"
Capybara.default_driver   = :rack_test
Capybara.default_selector = :css

# Run any available migration
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

#
# Common methods
#

def sign_in_as(username, password)
  visit sign_in_path
  fill_in 'username', :with => username
  fill_in 'password', :with => password
  click_button 'Sign in'
end

def user_factory(name, username, password)
  User.create! :name => name, :username => username, :password => password
end

def reset_quo_vadis_configuration
  QuoVadis.signed_in_url         = :root
  QuoVadis.override_original_url = false
  QuoVadis.signed_out_url        = :root
  QuoVadis.signed_in_hook        = nil
  QuoVadis.failed_sign_in_hook   = nil
  QuoVadis.signed_out_hook       = nil
  QuoVadis.layout                = 'application'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quo_vadis-1.0.1 test/test_helper.rb