[rspec-users] [cucumber] Creating an item without worrying about validity?

Matt Patterson matt-lists at reprocessed.org
Fri Mar 20 09:15:16 EDT 2009

On 20 Mar 2009, at 10:59, Tom Ten Thij wrote:

> In order to check at the cucumber level if permissions are working
> correctly I am trying to write a cucumber scenario that tests if a
> logged in user can create a certain model.

Hey Tom

> The alternative is to have to have to go through the steps of  
> filling in
> a valid form for a frooble, but I do not really care about that at  
> this
> stage, having to write them for each model will cost a lot of time and
> it will cause brittleness in my tests.
> Any suggestions? Should I give up trying to do this elegantly?

I wonder, if you don't care about the actual filling in of the form,  
is this really a controller-level spec which has snuck into your  
integration-level scenarios?

My gut would be to exercise the permission system in isolation at  
controller level and then write features to work through the actual  
filling stuff when that became important to me again.

I.e. write 'X can create Y' scenarios for your 'creating a Y' feature  
when you need it. You could also pop in some 'X should not be able to  
create Y' scenarios to exercise the refusal side of permissions, and  
the user experience of being refused...


   Matt Patterson | Design & Code
   <matt at reprocessed org> | http://www.reprocessed.org/

More information about the rspec-users mailing list