Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1694 from scottsds/hills_recovered_test_branch
Flesh out Archive Tests
- Loading branch information
Showing
51 changed files
with
1,414 additions
and
266 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'faker' | ||
FactoryGirl.define do | ||
factory :abuse_report do | ||
email {Faker::Internet.email} | ||
url "http://archiveofourown.org/tags/2000%20AD%20(Comics)/works" | ||
comment {Faker::Lorem.paragraph(1)} | ||
category 11469 | ||
cc_me "0" | ||
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,10 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :admin do | ||
login | ||
password "password" | ||
password_confirmation { |u| u.password } | ||
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,9 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :admin_post do | ||
admin_id { FactoryGirl.create(:admin).id } | ||
title "AdminPost Title" | ||
content "AdminPost content long enough to pass validation" | ||
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,10 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :bookmark do | ||
bookmarkable_type "Work" | ||
bookmarkable_id { FactoryGirl.create(:work).id } | ||
pseud_id { FactoryGirl.create(:pseud).id } | ||
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,19 @@ | ||
require 'faker' | ||
FactoryGirl.define do | ||
factory :challenge_assignment do | ||
after(:build) do |assignment| | ||
assignment.collection_id = FactoryGirl.create(:collection, :challenge => GiftExchange.new).id unless assignment.collection_id | ||
assignment.request_signup = FactoryGirl.create(:challenge_signup, :collection_id => assignment.collection_id) | ||
assignment.offer_signup = FactoryGirl.create(:challenge_signup, :collection_id => assignment.collection_id) | ||
end | ||
end | ||
|
||
factory :challenge_signup do | ||
after(:build) do |signup| | ||
signup.pseud_id = FactoryGirl.create(:pseud).id unless signup.pseud_id | ||
signup.collection_id = FactoryGirl.create(:collection, :challenge => GiftExchange.new).id unless signup.collection_id | ||
signup.offers.build(pseud_id: signup.pseud_id, collection_id: signup.collection_id) | ||
signup.requests.build(pseud_id: signup.pseud_id, collection_id: signup.collection_id) | ||
end | ||
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,8 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :chapter do | ||
content "Awesome content!" | ||
work | ||
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,34 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
|
||
sequence(:collection_name) do |n| | ||
"basic_collection_#{n}" | ||
end | ||
|
||
sequence(:collection_title) do |n| | ||
"Basic Collection #{n}" | ||
end | ||
|
||
factory :collection_participant do | ||
pseud | ||
participant_role "Owner" | ||
end | ||
|
||
factory :collection_preference do |f| | ||
collection | ||
end | ||
|
||
factory :collection_profile do |f| | ||
collection | ||
end | ||
|
||
factory :collection do |f| | ||
name {generate(:collection_name)} | ||
title {generate(:collection_title)} | ||
|
||
after(:build) do |collection| | ||
collection.collection_participants.build(pseud_id: FactoryGirl.create(:pseud).id, participant_role: "Owner") | ||
end | ||
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,30 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :comment do | ||
name {Faker::Name.first_name} | ||
content {Faker::Lorem.sentence(25)} | ||
email {Faker::Internet.email} | ||
commentable_type {"Work"} | ||
commentable_id { FactoryGirl.create(:work).id } | ||
pseud | ||
end | ||
|
||
factory :adminpost_comment, class: Comment do | ||
name {Faker::Name.first_name} | ||
content {Faker::Lorem.sentence(25)} | ||
email {Faker::Internet.email} | ||
commentable_type {"AdminPost"} | ||
commentable_id { FactoryGirl.create(:admin_post).id } | ||
pseud | ||
end | ||
|
||
factory :tag_comment, class: Comment do | ||
name {Faker::Name.first_name} | ||
content {Faker::Lorem.sentence(25)} | ||
email {Faker::Internet.email} | ||
commentable_type {"Tag"} | ||
commentable_id { FactoryGirl.create(:fandom).id } | ||
pseud | ||
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,18 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
|
||
sequence(:faq_title) do |n| | ||
"The #{n} FAQ" | ||
end | ||
|
||
sequence(:content) do |n| | ||
"This is the #{n} FAQ" | ||
end | ||
|
||
factory :archive_faq do |f| | ||
title {generate(:faq_title)} | ||
content | ||
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,10 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :feedback do | ||
comment [Faker::Lorem.paragraph(1)] | ||
email {Faker::Internet.email} | ||
summary {Faker::Lorem.sentence(1)} | ||
category 11483 | ||
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,13 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
|
||
factory :invite_request do | ||
end | ||
|
||
factory :invitation do | ||
invitee_email "default@email.com" | ||
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,8 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :kudo do |f| | ||
f.commentable_id { FactoryGirl.create(:work).id } | ||
f.commentable_type "Work" | ||
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,8 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :pseud do | ||
name { Faker::Lorem.characters(8) } | ||
user | ||
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,12 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
|
||
sequence(:series_title) do |n| | ||
"Awesome Series #{n}" | ||
end | ||
|
||
factory :series do | ||
title {generate(:series_title)} | ||
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,14 @@ | ||
require 'faker' | ||
FactoryGirl.define do | ||
|
||
factory :private_work_skin, class: Skin do | ||
author_id {FactoryGirl.create(:user).id} | ||
title {Faker::Lorem.word} | ||
type "WorkSkin" | ||
public false | ||
|
||
factory :public_work_skin do | ||
public true | ||
end | ||
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,10 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
|
||
factory :subscription do | ||
subscribable_type "Series" | ||
subscribable_id { FactoryGirl.create(:series).id } | ||
user | ||
end | ||
end |
Oops, something went wrong.