Skip to content

Instantly share code, notes, and snippets.

@karthiks
Created October 21, 2011 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthiks/1304375 to your computer and use it in GitHub Desktop.
Save karthiks/1304375 to your computer and use it in GitHub Desktop.
leveraging Subject in RSpec - 2
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