if ENV['CI'] require 'coveralls' Coveralls.wear! 'rails' end unless ENV['DRB'] require 'simplecov' SimpleCov.start 'rails' end # This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rspec/rails' require 'rspec/autorun' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } require 'webmock/rspec' require 'capybara/rspec' WebMock.disable_net_connect! allow: 'graph.facebook.com', allow_localhost: true #Capybara.ignore_hidden_elements = false # testing hidden fields RSpec.configure do |config| # == Mock Framework # # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: # # config.mock_with :mocha # config.mock_with :flexmock # config.mock_with :rr # config.mock_with :rspec # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = 'random' config.include Delorean ActionMailer::Base.perform_deliveries = false ActionMailer::Base.raise_delivery_errors = false ActionMailer::Base.delivery_method = :test config.before(:each) do back_to_the_present reset_email #load "#{Rails.root}/db/seeds.rb" end end