Use BestInPlace::TestHelpers with minitest

55 views Asked by At

I'm trying to use this line in a minitest test that uses capybara, poltergeist, and phantomjs:

    bip_select(@gs, :goal_id, Goal.first.name)

This is a helper that best_in_place offers to simulate a user choosing a value from a field. I've read a few questions elsewhere on StackOverflow where other developers who are using RSpec have added this line to their spec_helper.rb file:

config.include BestInPlace::TestHelpers 

I've tried adding this line to my test_helper.rb file and I've tried adding it to the test in question. But I'm still getting the error

NoMethodError: undefined method `bip_select' for #<GoalStudentsPoltergeistEditTest:0x00000006d85148>

Thank you in advance for any insight.

1

There are 1 answers

0
Caleb Huitt - cjhuitt On

To get the method definition available in your integration tests, edit test_helper.rb to include the lines referring to Best in Place (other lines left for context):

require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'best_in_place/test_helpers'

# ...

class ActionDispatch::IntegrationTest
  include BestInPlace::TestHelpers
end