From 92cd207c5083e60074e0ce123bb5b848a58e7417 Mon Sep 17 00:00:00 2001 From: Chad Pytel Date: Fri, 14 Apr 2017 19:21:02 -0400 Subject: Introduce capybara and first feature spec (#1801) This commit introduces Capybara and the first feature spec. I focused on coverage for log in for the first feature spec because that would have prevented 624a9a7136159d460228a0c2f5df18a9ead3b7f2 causing #1236. --- spec/rails_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/rails_helper.rb') diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index faac96982..536c5a774 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -7,6 +7,7 @@ require 'spec_helper' require 'rspec/rails' require 'webmock/rspec' require 'paperclip/matchers' +require 'capybara/rspec' Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } @@ -24,6 +25,11 @@ RSpec.configure do |config| config.include Devise::Test::ControllerHelpers, type: :controller config.include Devise::TestHelpers, type: :view config.include Paperclip::Shoulda::Matchers + + config.before :each, type: :feature do + https = ENV['LOCAL_HTTPS'] == 'true' + Capybara.app_host = "http#{https ? 's' : ''}://#{ENV.fetch('LOCAL_DOMAIN')}" + end end RSpec::Sidekiq.configure do |config| -- cgit