Basic tests added
This commit is contained in:
parent
6239fb4dcb
commit
5498e9b9a4
8 changed files with 137 additions and 30 deletions
|
|
@ -1,9 +1,21 @@
|
|||
require "test_helper"
|
||||
|
||||
class AdminControllerTest < ActionController::TestCase
|
||||
test "should get status" do
|
||||
test "user must login" do
|
||||
get :status
|
||||
assert_response :redirect
|
||||
assert_redirected_to user_session_path
|
||||
end
|
||||
|
||||
test "normal user must not see admin status" do
|
||||
sign_in users(:normal)
|
||||
get :status
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
test "admin can see status" do
|
||||
sign_in users(:admin)
|
||||
get :status
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue