# Rspec problem "undefined method \`should\_recieve'"

**URL:** <https://www.ruby-forum.com/t/rspec-problem-undefined-method-should-recieve/142976>\
**Category:** Rails\
**Created:** [July 14, 2008, 5:31am UTC](https://www.ruby-forum.com/t/rspec-problem-undefined-method-should-recieve/142976 "2008-07-14T05:31:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Poz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@J\_Poz](https://www.ruby-forum.com/u/J_Poz)\
**Post date:** [July 14, 2008, 5:31am UTC](https://www.ruby-forum.com/t/rspec-problem-undefined-method-should-recieve/142976/1 "2008-07-14T05:31:53Z")

</div>

Hello all,

I’ve been bashing my head against the wall this this one, and can find  
anything about why this would be happening.

I keep getting "undefined method `should\_recieve’ " when ever I’m  
trying to mock a model with RSpec.

My Rspec code is the following:

before(:each) do  
zipcode = 98117  
xml = File.read(RAILS\_ROOT + “/spec/fixtures/feeds/  
feed\_for\_98117.xml”)

```
Weather.should_recieve(:open).
  with("http://weather.yahooapis.com/forecastrss?p=#{zipcode}").
  and_return(xml)

@weather = Weather.new

```

end

The Error message is:

undefined method `should_recieve' for #<Class:0x22ada80> /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:1532 :in`method\_missing’  
/Users/Poz/Sites/Rails/forcaster/spec/models/weather\_spec.rb:21

1530 send(method\_id, \*arguments)  
1531 else  
1532 super  
1533 end  
1534 end  
1535# gem install syntax to get syntax highlighting

Anyone have any idea what’s going on??

Thanks in advance!  
JPoz

---

<div class="post-metadata">

**Author:** ![J\_Poz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@J\_Poz](https://www.ruby-forum.com/u/J_Poz)\
**Post date:** [July 14, 2008, 5:41am UTC](https://www.ruby-forum.com/t/rspec-problem-undefined-method-should-recieve/142976/2 "2008-07-14T05:41:49Z")

</div>

Try “receive” instead of “recieve”
