Created
June 17, 2009 15:09
-
-
Save diabolo/131277 to your computer and use it in GitHub Desktop.
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
describe Customer, "last billing address" do | |
before do | |
@customer = Customer.generate! | |
@customer = Address.new | |
end | |
it "should be settable and gettable" do | |
@customer.last_billing_address = @account_address | |
@customer.last_billing_address.should == @account_address | |
end | |
... | |
end | |
describe Customer, "last delivery address" do | |
before do | |
@customer = Customer.generate! | |
@account_address = Address.new | |
end | |
it "should be settable and gettable" do | |
@customer.last_delivery_address = @account_address | |
@customer.last_delivery_address.should == @account_address | |
end | |
end |
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
share_examples_for "named address" do | |
it "should be settable and gettable" do | |
named_address = @account_address | |
@named_address.should == @account_address | |
end | |
end | |
describe Customer, "last billing address" do | |
it_should_behave_like "named address" | |
before do | |
named_address = @customer.last_billing_address= | |
@named_address = @customer.last_billing_address | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment