From: Tom Hughes Date: Tue, 1 Aug 2017 18:23:41 +0000 (+0100) Subject: Fix user settings form X-Git-Tag: live~3853 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f258af223bd2b9b682398b072864b68090b37d25 Fix user settings form Fixes #1601 --- diff --git a/app/views/user/account.html.erb b/app/views/user/account.html.erb index 2e7f68d9d..752d1cd01 100644 --- a/app/views/user/account.html.erb +++ b/app/views/user/account.html.erb @@ -11,7 +11,7 @@ <% end %> <%= error_messages_for current_user %> -<%= form_for current_user, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %> +<%= form_for current_user, :url => { :action => :account }, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb index 3e71ea06a..4dcb1108a 100644 --- a/test/controllers/user_controller_test.rb +++ b/test/controllers/user_controller_test.rb @@ -782,6 +782,10 @@ class UserControllerTest < ActionController::TestCase get :account, :params => { :display_name => user.display_name }, :session => { :user => user } assert_response :success assert_template :account + assert_select "form#accountForm" do |form| + assert_equal "post", form.attr("method").to_s + assert_equal "/user/#{URI.encode(user.display_name)}/account", form.attr("action").to_s + end # Updating the description should work user.description = "new description"