diff options
| author | Azul <azul@leap.se> | 2012-11-04 21:01:27 +0100 | 
|---|---|---|
| committer | Azul <azul@leap.se> | 2012-11-04 21:01:27 +0100 | 
| commit | e1fc3f4850ee73e0591bd67a92b104db4f63e4cb (patch) | |
| tree | 1207ce14cb1c2551a3fda09e7c670cc97182a0f6 /users/test/functional/application_controller_test.rb | |
| parent | c0f92bf9f481463dcaef6f4b30343130a8910a00 (diff) | |
stubbing current_user the warden way
Diffstat (limited to 'users/test/functional/application_controller_test.rb')
| -rw-r--r-- | users/test/functional/application_controller_test.rb | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/users/test/functional/application_controller_test.rb b/users/test/functional/application_controller_test.rb index 69bcb2f..857bae5 100644 --- a/users/test/functional/application_controller_test.rb +++ b/users/test/functional/application_controller_test.rb @@ -8,20 +8,19 @@ class ApplicationControllerTest < ActionController::TestCase    end    def test_authorize_redirect -    stub_logged_out      @controller.send(:authorize)      assert_access_denied    end    def test_authorized -    @user = stub_logged_in +    login      @controller.send(:authorize)      assert_access_denied(false)    end    def test_authorize_admin -    @user = stub_logged_in -    @user.expects(:is_admin?).returns(false) +    login +    @current_user.expects(:is_admin?).returns(false)      @controller.send(:authorize_admin)      assert_access_denied    end | 
