cavalle / steak

DISCONTINUED - The delicious combination of RSpec and Capybara for Acceptance BDD
MIT License
762 stars 30 forks source link

Integration with Devise #25

Closed rtacconi closed 13 years ago

rtacconi commented 13 years ago

I tried your GIST: https://gist.github.com/549262

I my acceptance_helper.rb I have:

RSpec.configure do |config| config.include Devise::TestHelpers config.after { Devise.test_reset! } end

but when I run this:

feature "Pledge", %q{ In order to create a pledge As a user I want to see the pledge form } do background do @user = User.make! @friend = User.make! @user.add_friend(@friend) @friend.confirm_friend(@user) sign_in @user visit home_page end

scenario "Scenario name" do

should be visible to any friend, even without active attempt (the user not the friend)

@user.has_active_attempt?.should == false 
visit "/friends/#{@friend.id}"
page.should have_content('Your pledge')

end end

I get:

Failures: 1) Pledge In order to create a pledge As a user I want to see the pledge form Scenario name Failure/Error: Unable to find matching line from backtrace undefined method `env' for nil:NilClass

cavalle commented 13 years ago

I'd suggest you to ask in the google group about this issue (it doesn't looks like a problem or bug in steak, just a configuration/integration issue).

If you ask there, I'd also suggest you to provide additional info about versions of all gems involved (rails, devise, steak, rspec, etc.), the backtrace of the exception, better formatting of the code. And make sure the problem is related to devise and the code in the gist

masonicboom commented 13 years ago

Devise docs say not to try using the test helpers in integration tests (http://rdoc.info/github/plataformatec/devise/master/Devise/TestHelpers). I believe the recommended method is to manually log in your user by going to your login page.