2025-01-06 18:38:39 +08:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class UserShowTest < ActionDispatch::IntegrationTest
|
|
|
|
def setup
|
|
|
|
@inactive_user = users(:inactive)
|
|
|
|
@active_user = users(:archer)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should redirect when user not activated" do
|
|
|
|
get user_path(@inactive_user)
|
|
|
|
assert_response :redirect
|
|
|
|
assert_redirected_to root_url
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should display user when activated" do
|
|
|
|
get user_path(@active_user)
|
|
|
|
assert_response :success
|
2025-01-07 11:58:37 +08:00
|
|
|
assert_template "users/show"
|
2025-01-06 18:38:39 +08:00
|
|
|
end
|
|
|
|
end
|