A reading for Capybara (see Using Capybara with MiniTest :: Spec ) says that I can do this if I turn on the module correctly, but it does not give any illustrative examples of how ... I tried including the module as follows :
class MiniTest::Spec include Capybara::DSL end
... to no avail. I keep getting this error:
<main>': undefined method feature' for main: Object (NoMethodError)
How can I make it work the way it is written in the commented code?
specifications / reception / API / reward_terms_spec.rb:
require "#{Dir.pwd}/spec/acceptance/acceptance_helper"
specifications / acceptance / acceptance_helper.rb:
ENV["RAILS_ENV"] = "test" require "#{Dir.pwd}/config/environment" require 'minitest/autorun' require 'capybara/rails' def set_api_headers(device_id = 'abcd1234') header 'Accept', 'application/json' header 'X-Device-Id', device_id end
source share