Sha256: d5fb81581424a17fb0aeed3a09e3899b11dffce89d4f444817d37cbfdce7348e
Contents?: true
Size: 784 Bytes
Versions: 5
Compression:
Stored size: 784 Bytes
Contents
require 'test_helper' class ShowAllUsersTest < ActionDispatch::IntegrationTest def setup @john = cally_users(:john) @joe = cally_users(:joe) end test 'show all users as admin (valid)' do login_as(@john, 'john12345678901234567890') get '/cally/users' assert_template 'users/index' end test 'show all users as non-admin (invalid)' do login_as(@joe, 'joe12345678901234567890') get '/cally/users' follow_redirect! assert_template 'users/show' assert_match 'You need to be admin for this action.', response.body end test 'show all users when not logged in (invalid)' do get '/cally/users' follow_redirect! assert_template 'users/login' assert_match 'You need to be admin for this action.', response.body end end
Version data entries
5 entries across 5 versions & 1 rubygems