Created
March 30, 2011 01:47
-
-
Save phuibonhoa/893715 to your computer and use it in GitHub Desktop.
ex: execute in shoulda tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context ".rent book with quantity" do | |
setup do | |
@book = Factory(:book, :quantity => 1) | |
@customer = Factory(:customer) | |
end | |
execute do | |
@customer.rent(@book) | |
end | |
should "create order for customer" do | |
assert_equal 1, @customer.orders.size | |
end | |
should "decrement quantity for book" do | |
assert_equal 0, @book.quantity | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment