Rails: undefined method `stub!' (NoMethodError)

From FVue
Jump to: navigation, search

Problem

When running `rake spec', I receive this message:

$ 
...
active_record/base.rb:1959:in `method_missing_without_paginate': 
undefined method `stub!' for #<Class:0xb6d68218> (NoMethodError)
...

Solution

`stub!' should be called *inside* an `it' block:

<     Checkin.stub!(:find).and_return([mock_checkin])
<     it "should create balance records" do
---
>     it "should create balance records" do
>       Checkin.stub!(:find).and_return([mock_checkin])

Comments

blog comments powered by Disqus