[rspec-users] Recall a example inside another (just like in Cucumber)
Marcelo de Moraes Serpa
celoserpa at gmail.com
Thu Feb 18 14:33:47 EST 2010
I was spec'ing a model and just tried to do something like this
it "should create a payment with period_start & period_end set
it "should create a new payment for an approved transaction"
previous_payment = Payment.find(Payment.last.id-1)
just_created_payment = Payment.last
#Here, check below for a documentation of how period_start and
#period_end should be set as of now:
payment.period_start.should == previous_payment.period_end
payment.period_end.should == previous_payment.period_end +
Calling an already defined example, since this one requires all the
tests/objects from the "should created a new payment for an approved
I know I could just recreted all objects locally or just use a before block,
but I think it would be useful if we could do like this just like Cucumber
allows with steps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users