]> git.openstreetmap.org Git - rails.git/commitdiff
Move edit account action to show
authorAnton Khorev <tony29@yandex.ru>
Sun, 16 Feb 2025 23:35:09 +0000 (02:35 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 17 Feb 2025 14:14:31 +0000 (17:14 +0300)
25 files changed:
app/abilities/ability.rb
app/controllers/accounts/pd_declarations_controller.rb
app/controllers/accounts/terms_controller.rb
app/controllers/accounts_controller.rb
app/controllers/confirmations_controller.rb
app/controllers/user_mutes_controller.rb
app/controllers/users_controller.rb
app/views/accounts/deletions/show.html.erb
app/views/accounts/show.html.erb [moved from app/views/accounts/edit.html.erb with 100% similarity]
app/views/application/_auth_providers.html.erb
app/views/application/_settings_menu.html.erb
app/views/layouts/_header.html.erb
app/views/site/_not_public_flash.erb
app/views/users/show.html.erb
config/locales/en.yml
config/routes.rb
test/controllers/accounts/pd_declarations_controller_test.rb
test/controllers/accounts/terms_controller_test.rb
test/controllers/accounts_controller_test.rb
test/controllers/confirmations_controller_test.rb
test/controllers/users_controller_test.rb
test/system/account_deletion_test.rb
test/system/user_email_change_test.rb
test/system/user_muting_test.rb
test/system/user_suspension_test.rb

index dd377a727c817d275fa97d5339aef32904c178ab..7f47b578cb5f9bffb2e8b5805f1a591c8acd2322 100644 (file)
@@ -36,7 +36,7 @@ class Ability
         can [:read, :create, :update, :destroy], :oauth2_application
         can [:read, :destroy], :oauth2_authorized_application
         can [:read, :create, :destroy], :oauth2_authorization
-        can [:update, :destroy], :account
+        can [:read, :update, :destroy], :account
         can :update, :account_terms
         can :create, :account_pd_declaration
         can :read, :dashboard
index 2d2569d62b0adb342a50ce35f53289745b4d3652..4a636a8880c76275f598ecc6e740a05e35008850 100644 (file)
@@ -22,7 +22,7 @@ module Accounts
         end
       end
 
-      redirect_to edit_account_path
+      redirect_to account_path
     end
   end
 end
index 03007a5323f6788152d37eeb43eff5aa40a9dde0..568abcdb96d84a8ab74360c237c0084a71616680 100644 (file)
@@ -21,7 +21,7 @@ module Accounts
 
         if current_user.terms_agreed?
           # Already agreed to terms, so just show settings
-          redirect_to edit_account_path
+          redirect_to account_path
         end
       end
     end
@@ -43,7 +43,7 @@ module Accounts
 
       referer = safe_referer(params[:referer]) if params[:referer]
 
-      redirect_to referer || edit_account_path
+      redirect_to referer || account_path
     end
   end
 end
index d02943640147a37476832d74fed15a107a314af2..e2a82c20edc154b8c4c4aa625ac583e153d8be2c 100644 (file)
@@ -12,10 +12,10 @@ class AccountsController < ApplicationController
   before_action :check_database_readable
   before_action :check_database_writable, :only => [:update]
 
-  allow_thirdparty_images :only => [:edit, :update]
-  allow_social_login :only => [:edit, :update]
+  allow_thirdparty_images :only => [:show, :update]
+  allow_social_login :only => [:show, :update]
 
-  def edit
+  def show
     if errors = session.delete(:user_errors)
       errors.each do |attribute, error|
         current_user.errors.add(attribute, error)
@@ -32,9 +32,9 @@ class AccountsController < ApplicationController
         params[:user][:auth_uid] == current_user.auth_uid)
       update_user(current_user, user_params)
       if current_user.errors.empty?
-        redirect_to edit_account_path
+        redirect_to account_path
       else
-        render :edit
+        render :show
       end
     else
       session[:new_user_settings] = user_params.to_h
index 72c1955e039ebf225f862752dff681b978fc2e78..27f2c949ebae500426aa1a7b76474382236faf43 100644 (file)
@@ -91,7 +91,7 @@ class ConfirmationsController < ApplicationController
         flash[:error] = t ".unknown_token"
       end
 
-      redirect_to edit_account_path
+      redirect_to account_path
     end
   end
 
index 2068ab6a33bcf531e58068a7a04cf790edf904d9..dfd89083e10228d3972fa3276e09b62f4a5fa39a 100644 (file)
@@ -16,7 +16,7 @@ class UserMutesController < ApplicationController
     @muted_users = current_user.muted_users
     @title = t ".title"
 
-    redirect_to edit_account_path unless @muted_users.any?
+    redirect_to account_path unless @muted_users.any?
   end
 
   def create
index 0df971bd4f39dd55d2f1eba2307143a41f2aae5a..7f6619eab664f4b08dd9836fbee1b165b73dc125 100644 (file)
@@ -101,7 +101,7 @@ class UsersController < ApplicationController
     current_user.data_public = true
     current_user.save
     flash[:notice] = t ".flash success"
-    redirect_to edit_account_path
+    redirect_to account_path
   end
 
   ##
@@ -135,7 +135,7 @@ class UsersController < ApplicationController
 
       session[:user_errors] = current_user.errors.as_json
 
-      redirect_to edit_account_path
+      redirect_to account_path
     else
       user = User.find_by(:auth_provider => provider, :auth_uid => uid)
 
index 9b9b0f182ccd88caae6844096ce887594294c257..5a22aa67b8097decd63eceb2565e057fc3d49162 100644 (file)
@@ -40,4 +40,4 @@
   <button class="btn btn-secondary" disabled><%= t(".delete_account") %></button>
 <% end %>
 
-<%= link_to t(".cancel"), edit_account_path, :class => "btn btn-link" %>
+<%= link_to t(".cancel"), account_path, :class => "btn btn-link" %>
index 3edc6edd2476d9a8fd195867f7d01b832c7f29eb..221e704728491b456ffca127e503de559b390b15 100644 (file)
@@ -37,7 +37,7 @@
       </label>
       <%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %>
       <%= text_field_tag("openid_url", "https://", :tabindex => 20, :autocomplete => "on", :class => "form-control") %>
-      <span class="form-text text-body-secondary">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
+      <span class="form-text text-body-secondary">(<a href="<%= t "accounts.show.openid.link" %>" target="_new"><%= t "accounts.show.openid.link text" %></a>)</span>
     </div>
 
     <%= submit_tag t(".openid_login_button"), :tabindex => 21, :class => "btn btn-primary" %>
index 14f1c2927b69321afd10fa6942bff48cf28a2e4f..a0d3c0ad4cd597cb1ef8d940fae4ae1560510188 100644 (file)
@@ -3,7 +3,7 @@
 <% content_for :heading do %>
   <ul class="nav nav-tabs flex-column flex-sm-row">
     <li class="nav-item">
-      <%= link_to t(".account_settings"), edit_account_path, :class => "nav-link #{'active' if %w[accounts deletions].include?(controller_name)}" %>
+      <%= link_to t(".account_settings"), account_path, :class => "nav-link #{'active' if %w[accounts deletions].include?(controller_name)}" %>
     </li>
     <li class="nav-item">
       <%= link_to t(".oauth2_applications"), oauth_applications_path, :class => "nav-link #{'active' if controller_name == 'oauth2_applications'}" %>
index f09812972ef31ff234233072891f20a0bb1d4300..69e323a997d6222a34e6f37d3ec46301cb35d29a 100644 (file)
@@ -85,7 +85,7 @@
             <span class='badge count-number'><%= number_with_delimiter(current_user.new_messages.size) %></span>
           <% end %>
           <%= link_to t("users.show.my profile"), current_user, :class => "dropdown-item" %>
-          <%= link_to t("users.show.my_account"), edit_account_path, :class => "dropdown-item" %>
+          <%= link_to t("users.show.my_account"), account_path, :class => "dropdown-item" %>
           <%= link_to t("users.show.my_preferences"), preferences_path, :class => "dropdown-item" %>
           <div class="dropdown-divider"></div>
           <% if current_user.home_location? %>
index bcd010f352bf757e82901415cb7fed54eb0d647c..3451288761992f34032b082794564d0733e05a76 100644 (file)
@@ -1,3 +1,3 @@
 <p><%= t ".not_public" %></p>
-<p><%= t ".not_public_description_html", :user_page => (link_to t(".user_page_link"), edit_account_path(:anchor => "public")) %></p>
+<p><%= t ".not_public_description_html", :user_page => (link_to t(".user_page_link"), account_path(:anchor => "public")) %></p>
 <p><%= t ".anon_edits_html", :link => link_to(t(".anon_edits_link_text"), t(".anon_edits_link")) %></p>
index a32f5fae1e071337716f945fbd5b531093cd3e92..30245adedc79fe30f122af57a0fc31b24ab79bd6 100644 (file)
@@ -30,7 +30,7 @@
               <span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
             </li>
             <li>
-              <%= link_to t(".my_account"), edit_account_path %>
+              <%= link_to t(".my_account"), account_path %>
             </li>
 
             <% if current_user.blocks.exists? %>
index 42669ca9e3f5ba19ac77998c7cc3b0130dc7aa0f..0320bc2a698ca2058911a1608b48a997fdc3fdb9 100644 (file)
@@ -244,7 +244,7 @@ en:
         comment: Comment
         full: Full note
   accounts:
-    edit:
+    show:
       title: "Edit account"
       my_account: My Account
       current email address: "Current Email Address"
index e5c5772c38631603f79c5bcf0afe9c08cdc13635..67991b251a7238277944216cf47accdcae92d546 100644 (file)
@@ -297,10 +297,10 @@ OpenStreetMap::Application.routes.draw do
       resource :status, :only => :update
     end
   end
-  get "/user/:display_name/account", :to => redirect(:path => "/account/edit")
+  get "/user/:display_name/account", :to => redirect(:path => "/account")
   get "/user/:display_name/diary/comments(/:page)", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/diary_comments")
 
-  resource :account, :only => [:edit, :update, :destroy] do
+  resource :account, :only => [:show, :update, :destroy] do
     scope :module => :accounts do
       resource :terms, :only => [:show, :update]
       resource :pd_declaration, :only => [:show, :create]
@@ -308,6 +308,7 @@ OpenStreetMap::Application.routes.draw do
       resource :home, :only => :show
     end
   end
+  get "/account/edit", :to => redirect(:path => "/account"), :as => nil
 
   resource :dashboard, :only => [:show]
   resource :preferences, :only => [:show, :update]
index be0d46f1e57d354eb20383b0c29d360ef9cf2aeb..fe3c8bad2f08b94d1c8943fc00dd3dbecf25556d 100644 (file)
@@ -42,7 +42,7 @@ module Accounts
 
       post account_pd_declaration_path
 
-      assert_redirected_to edit_account_path
+      assert_redirected_to account_path
       assert_nil flash[:notice]
       assert_equal "You didn't confirm that you consider your edits to be in the Public Domain.", flash[:warning]
 
index 55b30506b41f1bba226869a57125ba088e91bb9b..ea8cd4e9fff5ce39523b04db17b53dd81d2d6b5a 100644 (file)
@@ -29,7 +29,7 @@ module Accounts
       session_for(user)
 
       get account_terms_path
-      assert_redirected_to edit_account_path
+      assert_redirected_to account_path
     end
 
     def test_show_not_seen_without_referer
@@ -53,7 +53,7 @@ module Accounts
       session_for(user)
 
       put account_terms_path, :params => { :read_ct => 1, :read_tou => 1 }
-      assert_redirected_to edit_account_path
+      assert_redirected_to account_path
       assert_equal "Thanks for accepting the new contributor terms!", flash[:notice]
 
       user.reload
@@ -82,8 +82,8 @@ module Accounts
       user = create(:user, :terms_seen => false, :terms_agreed => nil)
       session_for(user)
 
-      get edit_account_path
-      assert_redirected_to account_terms_path(:referer => "/account/edit")
+      get account_path
+      assert_redirected_to account_terms_path(:referer => account_path)
     end
   end
 end
index f13574213a7fdcc5927aebc63f0eb343f32a8692..199bf4aab53ac23825d3ed6de8b25d4186510ac2 100644 (file)
@@ -5,8 +5,8 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
   # test all routes which lead to this controller
   def test_routes
     assert_routing(
-      { :path => "/account/edit", :method => :get },
-      { :controller => "accounts", :action => "edit" }
+      { :path => "/account", :method => :get },
+      { :controller => "accounts", :action => "show" }
     )
     assert_routing(
       { :path => "/account", :method => :put },
@@ -16,9 +16,12 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
       { :path => "/account", :method => :delete },
       { :controller => "accounts", :action => "destroy" }
     )
+
+    get "/account/edit"
+    assert_redirected_to "/account"
   end
 
-  def test_account
+  def test_show_and_update
     # Get a user to work with - note that this user deliberately
     # conflicts with uppercase_user in the email and display name
     # fields to test that we can change other fields without any
@@ -28,14 +31,14 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
 
     # Make sure that you are redirected to the login page when
     # you are not logged in
-    get edit_account_path
-    assert_redirected_to login_path(:referer => "/account/edit")
+    get account_path
+    assert_redirected_to login_path(:referer => account_path)
 
     # Make sure we get the page when we are logged in as the right user
     session_for(user)
-    get edit_account_path
+    get account_path
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select "form#accountForm" do |form|
       assert_equal "post", form.attr("method").to_s
       assert_select "input[name='_method']", true
@@ -45,9 +48,9 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     # Updating the description using GET should fail
     user.description = "new description"
     user.preferred_editor = "default"
-    get edit_account_path, :params => { :user => user.attributes }
+    get account_path, :params => { :user => user.attributes }
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_not_equal user.description, User.find(user.id).description
 
     # Adding external authentication should redirect to the auth provider
@@ -60,7 +63,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     new_attributes = user.attributes.dup.merge(:display_name => create(:user).display_name)
     patch account_path, :params => { :user => new_attributes }
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", false
     assert_select "form#accountForm > div > input.is-invalid#user_display_name"
 
@@ -68,17 +71,17 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     new_attributes = user.attributes.dup.merge(:display_name => create(:user).display_name.upcase)
     patch account_path, :params => { :user => new_attributes }
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", false
     assert_select "form#accountForm > div > input.is-invalid#user_display_name"
 
     # Changing name to one that doesn't exist should work
     new_attributes = user.attributes.dup.merge(:display_name => "new tester")
     patch account_path, :params => { :user => new_attributes }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     follow_redirect!
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", /^User information updated successfully/
     assert_select "form#accountForm > div > input#user_display_name[value=?]", "new tester"
 
@@ -93,7 +96,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
       end
     end
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", false
     assert_select "form#accountForm > div > input.is-invalid#user_new_email"
 
@@ -105,7 +108,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
       end
     end
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", false
     assert_select "form#accountForm > div > input.is-invalid#user_new_email"
 
@@ -116,10 +119,10 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
         patch account_path, :params => { :user => user.attributes }
       end
     end
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     follow_redirect!
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select ".alert-success", /^User information updated successfully/
     assert_select "form#accountForm > div > input#user_new_email[value=?]", user.new_email
     email = ActionMailer::Base.deliveries.first
@@ -127,19 +130,19 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     assert_equal user.new_email, email.to.first
   end
 
-  def test_private_account
+  def test_show_private_account
     user = create(:user, :data_public => false)
 
     # Make sure that you are redirected to the login page when
     # you are not logged in
-    get edit_account_path
-    assert_redirected_to login_path(:referer => "/account/edit")
+    get account_path
+    assert_redirected_to login_path(:referer => account_path)
 
     # Make sure we get the page when we are logged in as the right user
     session_for(user)
-    get edit_account_path
+    get account_path
     assert_response :success
-    assert_template :edit
+    assert_template :show
     assert_select "form#accountForm" do |form|
       assert_equal "post", form.attr("method").to_s
       assert_select "input[name='_method']", true
index f07dadd85dd6cb7fb14841ec4be7ef6bb11c14ee..f7c99a0c6d4cca412d2bd0a3e885b2bef7780e29 100644 (file)
@@ -248,7 +248,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     confirm_string = user.generate_token_for(:new_email)
 
     post user_confirm_email_path, :params => { :confirm_string => confirm_string }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert_match(/Confirmed your change of email address/, flash[:notice])
   end
 
@@ -257,13 +257,13 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     confirm_string = user.generate_token_for(:new_email)
 
     post user_confirm_email_path, :params => { :confirm_string => confirm_string }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert_match(/already been confirmed/, flash[:error])
   end
 
   def test_confirm_email_bad_token
     post user_confirm_email_path, :params => { :confirm_string => "XXXXX" }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert_match(/confirmation code has expired or does not exist/, flash[:error])
   end
 
@@ -279,7 +279,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     # precondition gravatar should be turned off
     assert_not user.image_use_gravatar
     post user_confirm_email_path, :params => { :confirm_string => confirm_string }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert_match(/Confirmed your change of email address/, flash[:notice])
     # gravatar use should now be enabled
     assert User.find(user.id).image_use_gravatar
@@ -293,7 +293,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     # precondition gravatar should be turned on
     assert user.image_use_gravatar
     post user_confirm_email_path, :params => { :confirm_string => confirm_string }
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert_match(/Confirmed your change of email address/, flash[:notice])
     # gravatar use should now be disabled
     assert_not User.find(user.id).image_use_gravatar
index b398762f20a57a718d783e2294ec498f9e7adca1..6b37ed3d99ff40882bfe02a1a3038eb122e1535f 100644 (file)
@@ -195,7 +195,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
 
     post user_go_public_path
 
-    assert_redirected_to edit_account_path
+    assert_redirected_to account_path
     assert User.find(user.id).data_public
   end
 
@@ -249,7 +249,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/traces']", 1
       assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/diary']", 1
       assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/diary_comments']", 1
-      assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/account']", 0
+      assert_select "a[href='/account']", 0
       assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/blocks']", 0
       assert_select "a[href='/user/#{ERB::Util.u(moderator_user.display_name)}/blocks_by']", 1
       assert_select "a[href='/user_blocks/new/#{ERB::Util.u(moderator_user.display_name)}']", 0
@@ -266,7 +266,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='/traces/mine']", 1
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary']", 1
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary_comments']", 1
-      assert_select "a[href='/account/edit']", 1
+      assert_select "a[href='/account']", 1
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
       assert_select "a[href='/user_blocks/new/#{ERB::Util.u(user.display_name)}']", 0
@@ -284,7 +284,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/traces']", 1
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary']", 1
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/diary_comments']", 1
-      assert_select "a[href='/account/edit']", 0
+      assert_select "a[href='/account']", 0
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks']", 0
       assert_select "a[href='/user/#{ERB::Util.u(user.display_name)}/blocks_by']", 0
       assert_select "a[href='/user_blocks/new/#{ERB::Util.u(user.display_name)}']", 1
index ca5ef7fe8bc37578973782fed115478e2037d73c..729f9cccc620495276cb8c704664931b3fe8c4e4 100644 (file)
@@ -7,7 +7,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
   end
 
   test "the status is deleted and the personal data removed" do
-    visit edit_account_path
+    visit account_path
 
     click_on "Delete Account..."
     accept_confirm do
@@ -21,7 +21,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
   end
 
   test "the user is signed out after deletion" do
-    visit edit_account_path
+    visit account_path
 
     click_on "Delete Account..."
     accept_confirm do
@@ -32,7 +32,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
   end
 
   test "the user is shown a confirmation flash message" do
-    visit edit_account_path
+    visit account_path
 
     click_on "Delete Account..."
     accept_confirm do
@@ -45,7 +45,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
   test "can delete with any delay setting value if the user has no changesets" do
     with_user_account_deletion_delay(10000) do
       travel 1.hour do
-        visit edit_account_path
+        visit account_path
 
         click_on "Delete Account..."
 
@@ -59,7 +59,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
       create(:changeset, :user => @user)
 
       travel 1.hour do
-        visit edit_account_path
+        visit account_path
 
         click_on "Delete Account..."
 
@@ -73,7 +73,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
       create(:changeset, :user => @user, :created_at => Time.now.utc, :closed_at => Time.now.utc + 1.hour)
 
       travel 12.hours do
-        visit edit_account_path
+        visit account_path
 
         click_on "Delete Account..."
 
@@ -87,7 +87,7 @@ class AccountDeletionTest < ApplicationSystemTestCase
       create(:changeset, :user => @user, :created_at => Time.now.utc, :closed_at => Time.now.utc + 1.hour)
 
       travel 10.hours do
-        visit edit_account_path
+        visit account_path
 
         click_on "Delete Account..."
 
index 83f0a47bf0d9cf7259978c2915a57039a2b934f9..ccf1cf2ad93027f0234946b8695459d8726946a0 100644 (file)
@@ -12,7 +12,7 @@ class UserEmailChangeTest < ApplicationSystemTestCase
     sign_in_as(user)
 
     assert_emails 1 do
-      visit edit_account_path
+      visit account_path
       fill_in "New Email Address", :with => "new_tester@example.com"
       click_on "Save Changes"
       assert_equal "new_tester@example.com", user.reload.new_email
@@ -25,7 +25,7 @@ class UserEmailChangeTest < ApplicationSystemTestCase
 
     if email.parts[0].parts[0].decoded =~ %r{(/user/confirm-email\?confirm_string=[A-Za-z0-9\-_%]+)\s}
       visit Regexp.last_match(1)
-      assert page.has_css?("body.accounts-edit")
+      assert page.has_css?("body.accounts-show")
     end
 
     assert_equal "new_tester@example.com", user.reload.email
index e70005e647abad142dddac009d1ec0bb477a1a18..d46d5a04cc7543b9a4000b6e3d1983df28c41aef 100644 (file)
@@ -13,7 +13,7 @@ class UserMutingTest < ApplicationSystemTestCase
     click_on "Mute this User"
     assert_content "You muted #{other_user.display_name}"
 
-    visit edit_account_path
+    visit account_path
     assert_content "Muted Users"
     click_on "Muted Users"
     assert_content "You have muted 1 User"
@@ -21,7 +21,7 @@ class UserMutingTest < ApplicationSystemTestCase
 
     assert_content "You unmuted #{other_user.display_name}"
     refute_content "Muted Users"
-    assert_current_path edit_account_path
+    assert_current_path account_path
   end
 
   test "messages sent by muted users are set `muted` and do not cause notification emails" do
index d6368b68b28edfb4a8aa825428341d93b660dcea..55c4b82d7c7c445d65ac885fcfac77f460d3b7cd 100644 (file)
@@ -4,12 +4,12 @@ class UserSuspensionTest < ApplicationSystemTestCase
   test "User shown a message when suspended mid-session" do
     user = create(:user)
     sign_in_as(user)
-    visit edit_account_path
+    visit account_path
     assert_content "My Account"
 
     user.suspend!
 
-    visit edit_account_path
+    visit account_path
     assert_content "This decision will be reviewed by an administrator shortly"
   end
 end