Basic tests added

This commit is contained in:
Christoph Haas 2018-08-14 14:19:07 +02:00
parent 6239fb4dcb
commit 5498e9b9a4
8 changed files with 137 additions and 30 deletions

View file

@ -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