Closed elle closed 10 years ago
I think it happens because of misunderstanding of capybara mechanics. What driver do you use, webkit, selenium? I do not think it is an Authority issue.
You are right. Not n Authority issue. It was a problem with posting forms via ajax.
@focused Thanks for the help. I am obviously behind on looking at issues. :)
I am not sure this is a problem in the gem, but just not sure where to post a question, so hoping you could help me.
I have a Company resource which has
self.authorizer_name = "OperationsAuthorizer"
In the companies controller I have
authorize_actions_for(Company)
In my specs, I log in as an operations user, and even check that
expect(Company.creatable_by?(user)).to be_truthy
which passesBut when I submit the form in my feature spec (using capybara), I get an error:
User is not authorized to create this resource: Company
And if I adddebugger
in my create action, I don't even get to it. And the path stays on the new view.I do not get this error when I check the form in the browser.
What am I missing?