omniauth / omniauth-identity

A simple login and password strategy for OmniAuth.
MIT License
344 stars 98 forks source link

Integration test with capybara #26

Open surzycki opened 12 years ago

surzycki commented 12 years ago

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 => 'bob.hope@nbc.com'
    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

wafcio commented 12 years ago

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.

asiniy commented 12 years ago

It's interesting for me too

nickw commented 12 years ago

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

jjulian commented 12 years ago

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
jirihradil commented 11 years ago

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

pboling commented 3 years ago

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