Created
August 9, 2015 22:09
-
-
Save sprite2005/f318d674e65d9c9cc131 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class Admin::DashboardControllerTest < ActionController::TestCase | |
test "should not get index without user" do | |
get :index | |
assert_redirected_to new_user_session_path | |
end | |
test "should not get index with regular user" do | |
sign_in_user | |
get :index | |
assert_redirected_to root_path | |
end | |
test "should not get index with vip user" do | |
sign_in_vip | |
get :index | |
assert_redirected_to root_path | |
end | |
test "should get index with moderator user" do | |
sign_in_admin | |
get :index | |
assert_response :success | |
end | |
test "should get index with admin user" do | |
sign_in_admin | |
get :index | |
assert_response :success | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment