Skip to content

Instantly share code, notes, and snippets.

@smtlaissezfaire
Created August 25, 2009 22:42
Show Gist options
  • Save smtlaissezfaire/e4193a685a7f2fc0b4ab to your computer and use it in GitHub Desktop.
Save smtlaissezfaire/e4193a685a7f2fc0b4ab to your computer and use it in GitHub Desktop.
describe Event do
describe "Validations" do
before do
@publication = Publication.new(:time_zone => "Eastern Time (US & Canada)")
@publication.stub!(:find_all_event_by_day_and_slug).and_return([])
@event = Event.new(:publication => @publication, :state => Event::PUBLISHED)
end
it { @event.should have_valid_associations }
it { @event.should validate_presence_of(:title) }
it { @event.should validate_presence_of(:short_title) }
it { @event.should validate_presence_of(:genre) }
it { @event.should_not validate_presence_of(:slug) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment