Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Nov 14, 2024
1 parent d82e1ca commit 706a4df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 11 additions & 0 deletions test/controllers/admin/home_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "test_helper"

class Admin::HomeControllerTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers

test "should get admin root after sign in" do
sign_in users(:user_guochunzhong)
get admin_root_path
assert_response :success
end
end
7 changes: 0 additions & 7 deletions test/controllers/home_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ class HomeControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end

test "should redirect to admin home page if user admin" do
sign_in users(:user_guochunzhong)
get root_url
assert_response :redirect
assert_redirected_to admin_root_path
end

test "should get root if not sign in" do
get root_url
assert_response :success
Expand Down

0 comments on commit 706a4df

Please sign in to comment.