[rspec-users] Stories - Use view matchers rather than assigns[].should?

Ashley Moran ashley.moran at patchspace.co.uk
Thu Apr 10 12:21:52 EDT 2008


On 10 Apr 2008, at 17:00, David Chelimsky wrote:

> otooh - having some scenarios logging in using a post and some by
> poking around under the hood creates an untested logical binding
> between the post and the poking. This has the same risk associated
> with it that raises so much concern about mocks without integration
> tests that don't use mocks.
>
> I'm not saying that there should be a visible log-in step in every
> scenario. I would just use a request (or series of requests) instead
> of controller.send("current_user=",...).

Recently I've done a load of selenium-based stories and every single  
one had to log in, except the one that checks you can't do anything  
when you are not logged in.  There was no way round the login process,  
so I had to put it in.  But there were other stories that I couldn't  
do purely through the browser (eg those that needed users created and  
attached to organisations) because not all of the required GUI had not  
been built first*.  For these I resorted to database access.

My questions are:
- is this acceptable as a bootstrapping processes (direct DB creation  
of data until the GUI exists)

- is this acceptable in the long run, if you write a story that shows  
that the database changes produce the corresponding user-visible  
changes?

Ashley


* it was not an agile project

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/





More information about the rspec-users mailing list