Fixed access denied error checking step
This commit is contained in:
parent
37f87e694c
commit
a921c44ce9
@ -8,7 +8,7 @@ def do_api_request(type, url, param_string = nil)
|
|||||||
params = param_string && JSON.parse(param_string) || {}
|
params = param_string && JSON.parse(param_string) || {}
|
||||||
@json_response = do_request(type, api_base_url, url,
|
@json_response = do_request(type, api_base_url, url,
|
||||||
params.merge({ 'CONTENT_TYPE' => 'application/json' }))
|
params.merge({ 'CONTENT_TYPE' => 'application/json' }))
|
||||||
rescue Exception
|
rescue CanCan::AccessDenied
|
||||||
@error = $!
|
@error = $!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -65,5 +65,5 @@ end
|
|||||||
|
|
||||||
Then /^an access denied error should occur$/ do
|
Then /^an access denied error should occur$/ do
|
||||||
@error.should_not be_nil
|
@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
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user