[rspec-users] Forum.count.should, should doesn't work?
dchelimsky at gmail.com
Tue May 19 11:19:08 EDT 2009
On Tue, May 19, 2009 at 10:09 AM, Zhenning Guan <lists at ruby-forum.com> wrote:
> Scenario: List Tasks
> Then I should have 3 forums
> Then /^I should have ([0-9]+) forums$/ do |counts|
> Forum.count.should == counts.to_i
> When I go to the homepage #
> Then I should have 3 forums #
> expected: 3,
> got: 0 (using ==)
> @@ -1,2 +1,2 @@
> features/forums.feature:8:in `Then I should have 3 forums'
> 1 scenario (1 failed)
> 2 steps (1 failed, 1 passed)
> Forum.count == counts.to_i does fine
That's not an expectation so it won't pass or fail. I'd bet that's
returning false, which is not going to make a step fail (only an error
> why Forum.count.should throw a
> how could I do?
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users