blob: b6d0cd11b1e779b94d9e0870cfdd23ba044dc9e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
require 'test_helper'
class Admin::IndexControllerTest < ActionController::TestCase
test "should work for admins" do
@request.env['HTTP_AUTHORIZATION'] = basic_auth_creds('admin', GLSAMAKER_DEVEL_PASSWORD)
get :index
assert_response :success
end
test "should not grant access to regular users" do
@request.env['HTTP_AUTHORIZATION'] = basic_auth_creds('test', GLSAMAKER_DEVEL_PASSWORD)
get :index
assert_redirected_to :controller => '/index', :action => 'error', :type => 'access'
end
end
|