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