Created
November 16, 2011 04:15
-
-
Save mgreenly/1369218 to your computer and use it in GitHub Desktop.
Cucumber/RSpec onion layer 3
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 WarrantyClaim do | |
it "validates presence of failure_date" do | |
warranty_claim = Factory.build(:warranty_claim) | |
warranty_claim.failure_date = nil | |
warranty_claim.valid?.should be_false | |
warranty_claim.failure_date = Date.today | |
warranty_claim.valid?.should be_true | |
end | |
it "validates presence of customer name" do | |
warranty_claim = Factory.build(:warranty_claim) | |
warranty_claim.customer_name = nil | |
warranty_claim.valid?.should be_false | |
warranty_claim.customer_name = "valid customer name" | |
warranty_claim.valid?.should be_true | |
end | |
it "validates presence of customer phone" do | |
warranty_claim = Factory.build(:warranty_claim) | |
warranty_claim.customer_phone = nil | |
warranty_claim.valid?.should be_false | |
warranty_claim.customer_phone = "555-555-5555" | |
warranty_claim.valid?.should be_true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment