omniauth-identity
omniauth-identity copied to clipboard
Integration test with capybara
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
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.
It's interesting for me too
Same problem here. Commenting out OmniAuth.config.test_mode = true fixed it for me - although I haven't looked into why yet.
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
OmniAuth.config.test_mode = false #works for me too. Thanks guys!
Will leave this open until I can document this, or determine if it is still the case.