get users_list_path, :params => { :status => "suspended" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(suspended_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='status'][value='suspended']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(suspended_user)}']", :count => 1
+ end
end
# Should be able to limit by name
get users_list_path, :params => { :username => "Test User" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(name_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='username'][value='Test User']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(name_user)}']", :count => 1
+ end
end
# Should be able to limit by name ignoring case
get users_list_path, :params => { :username => "test user" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(name_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='username'][value='test user']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(name_user)}']", :count => 1
+ end
end
# Should be able to limit by email
get users_list_path, :params => { :username => "test@example.com" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(email_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='username'][value='test@example.com']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(email_user)}']", :count => 1
+ end
end
# Should be able to limit by email ignoring case
get users_list_path, :params => { :username => "TEST@example.com" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(email_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='username'][value='TEST@example.com']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(email_user)}']", :count => 1
+ end
end
# Should be able to limit by IP address
get users_list_path, :params => { :ip => "1.2.3.4" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(ip_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='ip'][value='1.2.3.4']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(ip_user)}']", :count => 1
+ end
end
# Should be able to limit to users with edits
get users_list_path, :params => { :edits => "yes" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 1 do
- assert_select "a[href='#{user_path(edits_user)}']", :count => 1
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='edits'][value='yes']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 1 do
+ assert_select "a[href='#{user_path(edits_user)}']", :count => 1
+ end
end
# Should be able to limit to users with no edits
get users_list_path, :params => { :edits => "no" }
assert_response :success
assert_template :show
- assert_select "table#user_list tbody tr", :count => 9 do
- assert_select "a[href='#{user_path(edits_user)}']", :count => 0
+ assert_select "turbo-frame#pagination", :count => 1 do
+ assert_select "input[type='hidden'][name='edits'][value='no']", :count => 1
+ assert_select "table#user_list tbody tr", :count => 9 do
+ assert_select "a[href='#{user_path(edits_user)}']", :count => 0
+ end
end
end