Commit 1c3b3dc2acd4cc3ffb211847ace057fae563b0c0
1 parent
44e25767
Exists in
master
and in
1 other branch
validate_presence_of :data in Choice
Showing
2 changed files
with
2 additions
and
0 deletions
Show diff stats
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) | ... | ... |