Make sure hidden users are shown in order
The test "Action links remember the pagination setting and the filter" was failing sometimes because it assumed the third user created was going to appear in the third place, but that wasn't always the case. So we're using the same order we use in the rest of the sections dealing with hidden content.
This commit is contained in:
@@ -4,7 +4,7 @@ class Admin::HiddenUsersController < Admin::BaseController
|
|||||||
before_action :load_user, only: [:confirm_hide, :restore]
|
before_action :load_user, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@users = User.only_hidden.send(@current_filter).page(params[:page])
|
@users = User.only_hidden.send(@current_filter).order(hidden_at: :desc).page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ describe "Admin hidden users", :admin do
|
|||||||
|
|
||||||
visit admin_hidden_users_path(filter: "with_confirmed_hide", page: 2)
|
visit admin_hidden_users_path(filter: "with_confirmed_hide", page: 2)
|
||||||
|
|
||||||
accept_confirm("Are you sure? Restore \"#{users[2].name}\"") do
|
accept_confirm("Are you sure? Restore \"#{users[-3].name}\"") do
|
||||||
click_button "Restore", match: :first, exact: true
|
click_button "Restore", match: :first, exact: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user