Created
October 21, 2011 17:17
-
-
Save karthiks/1304375 to your computer and use it in GitHub Desktop.
leveraging Subject in RSpec - 2
This file contains hidden or 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 Address do | |
describe "#validations" do | |
before(:each) do | |
@a = Address.new | |
@a.should_not be_valid | |
end | |
it "must have a city" do | |
@a.errors_on(:city).should_not be_nil | |
end | |
it "must have a state" do | |
@a.errors_on(:state).should_not be_nil | |
end | |
it "must have a country" do | |
@a.errors_on(:country).should_not be_nil | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment