intridea (owner)

Revisions

gist: 205803 Download_button fork
public
Public Clone URL: git://gist.github.com/205803.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#####
# What I have to do now
#####
 
it 'should make a call to mymethod' do
  val = SomeClass.mymethod('arg')
  SomeClass.should_receive(:mymethod).with('arg').once.and_return(val)
  post :create
end
 
# Results in error when later code in the run tries to act on the
# results of the now-stubbed method.
 
#####
# What I want to do
#####
 
it 'should make a call to mymethod' do
  SomeClass.should_receive(:mymethod).with('arg').once.and_return_as_normal
  post :create
end