Sha256: 5f02fa0ec53c15e00c9e7a800a13a50fddb71ece20a205948778a15f2536c0aa

Contents?: true

Size: 1.23 KB

Versions: 51

Compression:

Stored size: 1.23 KB

Contents

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

require 'simplecov'
require 'rails/all'
SimpleCov.start 'rails'

ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'true'
require File.expand_path('../dummy_app/config/environment', __FILE__)

require 'rspec/rails'
require 'factory_girl'
require 'factories'
require 'database_helpers'

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

Rails.backtrace_cleaner.remove_silencers!

include DatabaseHelpers
# Run any available migration
puts 'Setting up database...'
drop_all_tables
migrate_database
ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'false'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each{|f| require f}

RSpec.configure do |config|
  require 'rspec/expectations'

  config.include RSpec::Matchers
  config.include DatabaseHelpers
  config.include Piggybak::Engine.routes.url_helpers

  config.before(:each) do
    RailsAdmin::AbstractModel.all_models = nil
    RailsAdmin::AbstractModel.all_abstract_models = nil
    RailsAdmin::AbstractModel.new("User").destroy_all!
    RailsAdmin::AbstractModel.new("Image").destroy_all!
  end

  config.after(:each) do
    Piggybak.reset
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
piggybak-0.6.2 spec/spec_helper.rb
piggybak-0.6.1 spec/spec_helper.rb
piggybak-0.6.0 spec/spec_helper.rb
piggybak-0.5.5 spec/spec_helper.rb
piggybak-0.5.4 spec/spec_helper.rb
piggybak-0.5.3 spec/spec_helper.rb
piggybak-0.5.2 spec/spec_helper.rb
piggybak-0.5.1 spec/spec_helper.rb
piggybak-0.5.0 spec/spec_helper.rb
piggybak-0.4.39 spec/spec_helper.rb
piggybak-0.4.38 spec/spec_helper.rb
piggybak-0.4.37 spec/spec_helper.rb
piggybak-0.4.36 spec/spec_helper.rb
piggybak-0.4.35 spec/spec_helper.rb
piggybak-0.4.34 spec/spec_helper.rb
piggybak-0.4.33 spec/spec_helper.rb
piggybak-0.4.32 spec/spec_helper.rb
piggybak-0.4.31 spec/spec_helper.rb
piggybak-0.4.30 spec/spec_helper.rb
piggybak-0.4.29 spec/spec_helper.rb