Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 18th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # weird legacy code fucking with me -- anything obvious I'm doing wrong?
  2.  
  3.   it "goes thru AASM states" do
  4.     @foo = Foo.new
  5.     @foo.aasm_current_state.should == :pending
  6.  
  7.     # wtf? this shit is so broken. the following fails, nfi why:
  8.     # @foo.should_receive(:bar_ready?).and_return(true)
  9.     # what that method actually does is simply delegate to bar.ready_for_delivery?
  10.     class << @foo
  11.       def bar_ready?
  12.         true
  13.       end
  14.     end
  15.     @foo.capture
  16.     @foo.aasm_current_state.should == :used
  17.  
  18.     @foo.refund
  19.     @foo.aasm_current_state.should == :refunded
  20.   end