Configuring RSpec to run a feature file
Let's have a look now at spec/feature_helper.rb, which will load all of the setup code, helpers, and custom matchers. This is what that file contains:
require_relative 'config/common' require_relative 'config/capybara' require_relative 'helpers/web_input_helpers' require_relative 'helpers/custom_matchers'
It's just a little wrapper that pulls in four different files. We've kept everything nice and clean by using separate files for each concern. This will help keep our RSpec code maintainable and will make it easier to follow changes as our feature evolves over the course of this and the following chapter.
We have first a little file called spec/config/capybara.rb with some basic RSpec configuration:
RSpec.configure do |config| config.color = true end
Let's look at the next file that we load, spec/config/capybara.rb:
require 'capybara/rspec'
Capybara.default_driver = :selenium
if ENV['APP_HOST'] == 'local'
puts 'Booting a local server using config...