[rspec-users] Stories - Use view matchers rather than assigns[].should?
Ashley Moran
ashley.moran at patchspace.co.uk
Thu Apr 10 17:57:17 EDT 2008
On 10 Apr 2008, at 17:59, David Chelimsky wrote:
> I definitely agree with this, however I do see a difference between
> accessing models directly through their API (which I do) and accessing
> the internals of the request cycle (which I don't).
Ok that's what I was doing - not interfering with anything, just using
a lower-level API in the same story as a high-level API. Perhaps it
wouldn't have felt as strange if I was using a web service request
instead of ORM calls?
and Pat wrote:
>> - is this acceptable in the long run, if you write a story that shows
>> that the database changes produce the corresponding user-visible
>> changes?
>
> I'm not entirely sure what you mean here. But generally if I'm
> testing that the user sees something, then I also want to include the
> step where they initiate that chain of events.
Sorry wasn't clear what I meant. I was thinking something like
Given ...
When I run User.create!(:foo => "bar")
Then the Users page should have a row with "bar" in the "foo" column
etc...
Ashley
--
http://www.patchspace.co.uk/
http://aviewfromafar.net/
More information about the rspec-users
mailing list