forked from openwichita/vote-wichita
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding model validations, tests and factory for answer, plus question…
… factory bc of dependency. resolves openwichita#3
- Loading branch information
Emily Behlmann
authored and
Emily Behlmann
committed
Oct 30, 2016
1 parent
ee097dc
commit 8484783
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
example_id | status | run_time | | ||
--------------------------------------- | ------ | --------------- | | ||
./spec/models/admin_user_spec.rb[1:1:1] | passed | 0.0534 seconds | | ||
./spec/models/answer_spec.rb[1:1] | passed | 0.10162 seconds | | ||
./spec/models/answer_spec.rb[1:2:1] | passed | 0.01378 seconds | | ||
./spec/models/answer_spec.rb[1:2:2] | passed | 0.01236 seconds | | ||
./spec/models/ballot_spec.rb[1:1:1] | passed | 0.04902 seconds | | ||
./spec/models/ballot_spec.rb[1:1:2] | passed | 0.0089 seconds | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# == Schema Information | ||
# | ||
# Table name: answers | ||
# | ||
# id :integer not null, primary key | ||
# text :text | ||
# info :text | ||
# question_id :integer | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :answer do | ||
text Faker::Lorem.sentence | ||
|
||
# Associations | ||
question | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# == Schema Information | ||
# | ||
# Table name: questions | ||
# | ||
# id :integer not null, primary key | ||
# text :text | ||
# summary :text | ||
# friendly_name :string | ||
# ballot_id :integer | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :question do | ||
text Faker::Lorem.sentence | ||
|
||
# Associations | ||
ballot | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters