Skip to content

Instantly share code, notes, and snippets.

@caffo
Created November 25, 2013 16:28
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 caffo/5672cebddc34d395c9a7 to your computer and use it in GitHub Desktop.
Save caffo/5672cebddc34d395c9a7 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe City do
it { should respond_to(:name) }
it { should respond_to(:friendly_id) }
context 'when validating' do
it 'is invalid without a name' do
city = build(:city, :name => nil)
city.should_not be_valid
city.should have(1).error_on(:name)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment