Skip to content

controller test -> be_authorized_to -> create? & new? #214

Answered by palkan
danielnc asked this question in Q&A
Discussion options

You must be logged in to vote

Doesn't an_instance_of(Product) work here? I believe, it should.

In general, I recommend against calling authorize! against non-yet-created records. Creating a record is usually protected by some outer context, which should be authorized.

Check out also this discussion: #209

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danielnc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants