[rspec-users] Suggestions on how to use stub_model with webrat?
d at sofer.com
Tue Jun 24 11:39:44 EDT 2008
I am using story runner with webrat, but I am not sure how to
incorporate stub_model into my tests.
The webrat steps only care about the user interface and have nothing
to say about interaction with the database.
Following Ben Mabey, I have a line in my story like:
"When clicks the Create button"
And a step like:
When "clicks the $button button" do |button|
Would it be sensible to extend it as follows:
"And clicks the Create button to create a new thing"
When "clicks the $button button to create a new $resource" do |button,
klass = resource.classify.constantize
Or is there a better way of making sure that all required models are
More information about the rspec-users