Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

why should events have unique titles?

  • Loading branch information...
commit d33bebd8ad0ffbcfda2475eced5539c1b9058847 1 parent 90ddac7
@joemsak joemsak authored
View
2  app/models/event.rb
@@ -16,7 +16,7 @@ class Event < ActiveRecord::Base
acts_as_indexed :fields => [:title, :venue_name, :venue_address, :ticket_link, :description]
- validates :title, :presence => true, :uniqueness => true
+ validates :title, :presence => true
validates :ticket_price, :numericality => true, :allow_blank => true
validates :ticket_link, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :allow_blank => true
validate :ends_after_start
View
10 features/manage_events.feature
@@ -44,16 +44,6 @@ Feature: Events
And I should be on the list of events
And I should not see "A title"
- @events-duplicate @duplicate
- Scenario: Create Duplicate Event
- Given I only have events titled UniqueTitleOne, UniqueTitleTwo
- When I go to the list of events
- And I follow "Add New Event"
- And I fill in "Title" with "UniqueTitleTwo"
- And I press "Save"
- Then I should see "There were problems"
- And I should have 2 events
-
@events-delete @delete
Scenario: Delete Event
Given I only have events titled UniqueTitleOne
View
5 spec/models/event_spec.rb
@@ -22,11 +22,6 @@ def reset_event(options = {})
it "rejects empty title" do
Event.new(@valid_attributes.merge(:title => "")).should_not be_valid
end
-
- it "rejects non unique title" do
- # as one gets created before each spec by reset_event
- Event.new(@valid_attributes).should_not be_valid
- end
it "rejects a non-numerical ticket price" do
Event.new({
Please sign in to comment.
Something went wrong with that request. Please try again.