
Untitled
By: a guest on
May 18th, 2012 | syntax:
None | size: 0.57 KB | hits: 16 | expires: Never
# weird legacy code fucking with me -- anything obvious I'm doing wrong?
it "goes thru AASM states" do
@foo = Foo.new
@foo.aasm_current_state.should == :pending
# wtf? this shit is so broken. the following fails, nfi why:
# @foo.should_receive(:bar_ready?).and_return(true)
# what that method actually does is simply delegate to bar.ready_for_delivery?
class << @foo
def bar_ready?
true
end
end
@foo.capture
@foo.aasm_current_state.should == :used
@foo.refund
@foo.aasm_current_state.should == :refunded
end