X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5cbaa2fca73316962a8ec8bc591bf6d30d61b211..75c7f46a00cdb01f30af3a039e9343b00e247d3a:/test/integration/user_creation_test.rb diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index 77d73552a..da0ffd768 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -127,4 +127,28 @@ class UserCreationTest < ActionController::IntegrationTest assert_response :success assert_template "trace/list.html.erb" end + + def test_user_create_openid_success + new_email = "newtester-openid@osm.org" + display_name = "new_tester-openid" + assert_difference('User.count') do + assert_difference('ActionMailer::Base.deliveries.size', 1) do + post "/user/save", + {:user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :openid_url => "http://localhost:1123/john.doe?openid.success=newuser"}} + assert_response :redirect + res = openid_request(@response.redirected_to) + post '/user/save', res + assert_response :redirect + follow_redirect! + end + end + + # Check the page + assert_response :success + assert_template 'login' + + ActionMailer::Base.deliveries.clear + end + + end