Commit 1c3b3dc2acd4cc3ffb211847ace057fae563b0c0

Authored by Luke Baker
1 parent 44e25767

validate_presence_of :data in Choice

app/models/choice.rb
... ... @@ -5,6 +5,7 @@ class Choice < ActiveRecord::Base
5 5  
6 6 validates_presence_of :creator, :on => :create, :message => "can't be blank"
7 7 validates_presence_of :question, :on => :create, :message => "can't be blank"
  8 + validates_presence_of :data
8 9 #validates_length_of :item, :maximum => 140
9 10  
10 11 has_many :votes
... ...
spec/models/choice_spec.rb
... ... @@ -10,6 +10,7 @@ describe Choice do
10 10 it {should have_many :prompts_on_the_right}
11 11 it {should validate_presence_of :question}
12 12 it {should validate_presence_of :creator}
  13 + it {should validate_presence_of :data}
13 14  
14 15 before(:each) do
15 16 @aoi_clone = Factory.create(:email_confirmed_user)
... ...