Skip to content

Instantly share code, notes, and snippets.

@fellix
Created October 3, 2012 13:25
Show Gist options
  • Save fellix/3826889 to your computer and use it in GitHub Desktop.
Save fellix/3826889 to your computer and use it in GitHub Desktop.
test approach
context 'order' do
let :first_payment do
Payment.create
end
let :last_payment do
Payment.create
end
let :payments do
[first_payment, last_payment]
end
before do
payments
end
it "should be ordered by payment id" do
expect(Payment.all).to eq payments
end
end
it 'returns the payments ordered by the id' do
first_payment, last_payment = Payment.create, Payment.create
expect(Payment.all).to eq [first_payment, last_payment]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment