Fixed access denied error checking step

This commit is contained in:
Alex Sanford 2012-04-26 16:10:40 -03:00
parent 37f87e694c
commit a921c44ce9
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ def do_api_request(type, url, param_string = nil)
params = param_string && JSON.parse(param_string) || {}
@json_response = do_request(type, api_base_url, url,
params.merge({ 'CONTENT_TYPE' => 'application/json' }))
rescue Exception
rescue CanCan::AccessDenied
@error = $!
end
end
@ -65,5 +65,5 @@ end
Then /^an access denied error should occur$/ do
@error.should_not be_nil
@error.message.should == 'You are not authorized to access this page.'
@error.is_a?(CanCan::AccessDenied).should be_true
end