Make sure the account form is POSTed

Fixes #1601
This commit is contained in:
Tom Hughes 2017-08-02 15:31:21 +01:00
parent 60f2074bac
commit 85b0098b1c
2 changed files with 2 additions and 1 deletions

View file

@ -11,7 +11,7 @@
<% end %>
<%= error_messages_for current_user %>
<%= form_for current_user, :url => { :action => :account }, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
<%= form_for current_user, :url => { :action => :account }, :method => :post, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
<fieldset>
<div class="form-row">
<label class="standard-label"><%= t 'user.new.display name' %></label>

View file

@ -784,6 +784,7 @@ class UserControllerTest < ActionController::TestCase
assert_template :account
assert_select "form#accountForm" do |form|
assert_equal "post", form.attr("method").to_s
assert_select "input[name='_method']", false
assert_equal "/user/#{URI.encode(user.display_name)}/account", form.attr("action").to_s
end