daze wrote in post #970823:
[...]
>> My usual procedure:
>> Write a Cucumber story for functionality, watch it fail.
>> Figure out the first thing I need to do to implement that functionality,
>> write a unit spec in RSpec, watch it fail, make it pass.
>> Do next unit spec likewise.
>> When Cucumber story passes, feature is complete. Write another story.
>
> Instead of RSpec, is it okay to use Shoulda (with Cucumber, I mean)?
Probably -- if that will even work. I don't know. Cucumber grew out of
RSpec, so I don't know how well it works with other test frameworks.
Why don't you check the docs?
> All I see, including in the Rails 3 installation instructions here...
> https://github.com/aslakhellesoy/cucumber-rails/blob/master/README.rdoc
> ... are instructions involving RSpec only. :/ Bleh.
Bleh? What have you got against RSpec.
>
> Should I get acquainted with RSpec?
Yes.
> Actually, can't Shoulda and RSpec work together?
I think so. But I don't use Shoulda.
> There's got to be some down-to-earth tutorial about all this...
>
>> > undefined method `paginate' for #<Class:0x5eb4ad0>"
>>
>> > (SectionsControllerTest):
>> > NoMethodError: undefined method `response_code' for nil:NilClass
>>
>> > This doesn't mean anything to me.
>>
>> How can that not mean anything to you, when it's telling you exactly
>> what the error is?
>
> All this error tells me is that something that is nil is trying to
> call response_code.
Exactly! So where are you calling response_code ? Find out why you've
got a nil object there.
> The error I get with rails server and browsing to
> the page is
> undefined method `paginate' for #<Class:0x5eb4ad0>" which tells me
> that I have to check out the paginate method - something much more
> direct/useful!!!
>
There you go, then.
>> > (In my test, I had should
>> > respond_with :success.)
>>
>> You can step through with the debugger to see where it fails.
>>
>> Also, RSpec and Cucumber have better error reporting than Test::Unit.
>
> ohhh I hope so.
>
> So from here, I'll try to get Cucumber working for my functional
> tests... Is cucumber ONLY for functionals, or integration/others too?
Cucumber stories tend to cover the same ground as functional and
integration tests. Again, read the docs.
> I have shoulda working for unit tests...
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
Sent from my iPhone
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment