aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/widget_votes.rb7
-rw-r--r--spec/models/widget_vote_spec.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/spec/factories/widget_votes.rb b/spec/factories/widget_votes.rb
new file mode 100644
index 000000000..964bbb20d
--- /dev/null
+++ b/spec/factories/widget_votes.rb
@@ -0,0 +1,7 @@
+require 'securerandom'
+FactoryGirl.define do
+ factory :widget_vote do
+ info_request
+ cookie { SecureRandom.hex(10) }
+ end
+end \ No newline at end of file
diff --git a/spec/models/widget_vote_spec.rb b/spec/models/widget_vote_spec.rb
index db5e4385d..b9f990eac 100644
--- a/spec/models/widget_vote_spec.rb
+++ b/spec/models/widget_vote_spec.rb
@@ -28,7 +28,7 @@ describe WidgetVote do
end
it 'is valid with a cookie and info request' do
- widget_vote = FactoryGirl.create(:info_request).widget_votes.build(:cookie => 'x' * 20)
+ widget_vote = FactoryGirl.create(:widget_vote)
widget_vote.should be_valid
end