Created
May 26, 2010 10:52
-
-
Save levent/414340 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| context "while not logged in" do | |
| describe "index" do | |
| %w(index show destroy update).each do |action| | |
| it "should not allow access to #{action}" do | |
| bypass_rescue | |
| lambda {get action.to_sym}.should raise_exception(Acl9::AccessDenied) | |
| end | |
| end | |
| end | |
| end | |
| SUPPORTED_FORMATS.each do |format| | |
| it "should return current user if requested with allowed roles in #{format}" do | |
| @user.roles_for(nil).should_not be_blank | |
| get :show, :format => format, :id => @user.id | |
| response.body.should =~ /allowed[_-]roles/ | |
| end | |
| it "should return the requested user in #{format}" do | |
| owned_user = @user.owned_users.make(:random, :owned_by_id => @user.id) | |
| get :show, :format => format, :id => owned_user.id | |
| send("expected_user_#{format}", owned_user) | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment