X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/934d81aa551c791e0200f3be06b1e97de23c008e..c9a36291601a60dee792ce8681bce65562e15cec:/test/controllers/profiles_controller_test.rb diff --git a/test/controllers/profiles_controller_test.rb b/test/controllers/profiles_controller_test.rb index 824ecb5e3..f388349ab 100644 --- a/test/controllers/profiles_controller_test.rb +++ b/test/controllers/profiles_controller_test.rb @@ -21,45 +21,41 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest # Updating the description should work put profile_path, :params => { :user => { :description => "new description" } } - assert_response :redirect assert_redirected_to user_path(user) follow_redirect! assert_response :success assert_template :show - assert_select ".notice", /^Profile updated./ + assert_select ".alert-success", /^Profile updated./ assert_select "div", "new description" # Changing to an uploaded image should work image = Rack::Test::UploadedFile.new("test/gpx/fixtures/a.gif", "image/gif") put profile_path, :params => { :avatar_action => "new", :user => { :avatar => image, :description => user.description } } - assert_response :redirect assert_redirected_to user_path(user) follow_redirect! assert_response :success assert_template :show - assert_select ".notice", /^Profile updated./ + assert_select ".alert-success", /^Profile updated./ get edit_profile_path assert_select "form > fieldset > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep" # Changing to a gravatar image should work put profile_path, :params => { :avatar_action => "gravatar", :user => { :description => user.description } } - assert_response :redirect assert_redirected_to user_path(user) follow_redirect! assert_response :success assert_template :show - assert_select ".notice", /^Profile updated./ + assert_select ".alert-success", /^Profile updated./ get edit_profile_path assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar" # Removing the image should work put profile_path, :params => { :avatar_action => "delete", :user => { :description => user.description } } - assert_response :redirect assert_redirected_to user_path(user) follow_redirect! assert_response :success assert_template :show - assert_select ".notice", /^Profile updated./ + assert_select ".alert-success", /^Profile updated./ get edit_profile_path assert_select "form > fieldset > div > div.col-sm-10 > div > input[name=avatar_action][checked]", false assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked]", false