omniauth-identity icon indicating copy to clipboard operation
omniauth-identity copied to clipboard

Integration test with capybara

Open surzycki opened this issue 13 years ago • 6 comments

With an integration test that looks like

it 'should make a new user' do
  lambda do
    visit register_path
    fill_in 'first_name',            :with => 'bob'
    fill_in 'last_name',             :with => 'hope'
    fill_in 'email',                 :with => '[email protected]'
    fill_in 'password',              :with => 'password'
    fill_in 'password_confirmation', :with => 'password'

     click_button 'Go!'
     #    save_and_open_page
     page.current_path.should eq(registration_step_one_path)
  end.should change(User, :count).by(1)
end

The POST path '/auth/identity/register' is not found by Capybara

surzycki avatar May 07 '12 10:05 surzycki

You must know that Omniauth use Rack middleware and in test environment Rails using Fake Rack which doesn't have some functionality, maybe it is problem.

wafcio avatar May 09 '12 08:05 wafcio

It's interesting for me too

asiniy avatar May 11 '12 13:05 asiniy

Same problem here. Commenting out OmniAuth.config.test_mode = true fixed it for me - although I haven't looked into why yet.

nickw avatar May 21 '12 19:05 nickw

FWIW, setting OmniAuth.config.test_mode = false fixed it for me too.

test 'Visitor can sign up with a username and password' do
  OmniAuth.config.test_mode = false
  # ...test here...
  OmniAuth.config.test_mode = true
end

jjulian avatar Nov 06 '12 18:11 jjulian

OmniAuth.config.test_mode = false #works for me too. Thanks guys!

jirihradil avatar Aug 20 '13 09:08 jirihradil

Will leave this open until I can document this, or determine if it is still the case.

pboling avatar Feb 14 '21 09:02 pboling