mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Add new columns and sorting to admin users list (#1004)
* Add trial end date to admin users list * Add new columns * Regression
This commit is contained in:
28
test/controllers/admin/users_controller_test.rb
Normal file
28
test/controllers/admin/users_controller_test.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
require "test_helper"
|
||||
|
||||
class Admin::UsersControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:sure_support_staff)
|
||||
end
|
||||
|
||||
test "index sorts users by subscription trial end date with nils last" do
|
||||
get admin_users_url
|
||||
|
||||
assert_response :success
|
||||
|
||||
body = response.body
|
||||
trial_user_index = body.index("user1@example.com")
|
||||
no_trial_user_index = body.index("bob@bobdylan.com")
|
||||
|
||||
assert_not_nil trial_user_index
|
||||
assert_not_nil no_trial_user_index
|
||||
assert_operator trial_user_index, :<, no_trial_user_index
|
||||
end
|
||||
|
||||
test "index shows n/a when trial end date is unavailable" do
|
||||
get admin_users_url
|
||||
|
||||
assert_response :success
|
||||
assert_match(/n\/a/, response.body, "Page should show n/a for users without trial end date")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user