Replace All FactoryGirl Constant References

This commit is contained in:
Henne Vogelsang 2018-09-03 20:44:39 +02:00
parent 82c3372af2
commit 0a19418d15
55 changed files with 56 additions and 56 deletions

View file

@ -4,7 +4,7 @@ namespace :data do
desc 'Create demo data using our factories'
task demo: :environment do
include FactoryGirl::Syntax::Methods
include FactoryBot::Syntax::Methods
conference = create(:full_conference, title: 'Open Source Event Manager Demo', short_title: 'osemdemo' ,description: "This is a [Open Source Event Manager](http://osem.io/) demo instance. You can log in as **admin** with the password **password123** or just you just [sign up](/accounts/sign_up) with your own user. We hope you enjoy checking out all the functionality, if you have questions don't hesitate to [contact us](http://osem.io/#contact)!\r\n\r\n## Data will be destroyed every thirty minutes or whenever someone updates the [OSEM source code on github](https://github.com/openSUSE/osem/commits/master).")
conference.contact.update_attributes(email: 'osemdemo@osem.io', sponsor_email: 'osemdemo@osem.io')
create(:admin, email: 'admin@osem.io', username: 'admin', password: 'password123', password_confirmation: 'password123')

View file

@ -2,7 +2,7 @@
namespace :data do
desc 'Create demo data for our local development'
include FactoryGirl::Syntax::Methods
include FactoryBot::Syntax::Methods
task surveys: :environment do
conference = create(:full_conference, start_date: Date.current, end_date: Date.current + 1.day)

View file

@ -1,12 +1,12 @@
# frozen_string_literal: true
namespace :factory_girl do
desc "Verify that all FactoryGirl factories are valid"
desc "Verify that all FactoryBot factories are valid"
task lint: :environment do
if Rails.env.test?
begin
DatabaseCleaner.start
FactoryGirl.lint
FactoryBot.lint
ensure
DatabaseCleaner.clean
end

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :answer do
title 'Do you?'
end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :booth_request do
booth
user

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :booth do
title { Faker::Hipster.sentence }
description { Faker::Lorem.paragraph }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :campaign do
name 'Test Campaign'
utm_campaign 'testcampaign'

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :cfp do
start_date { 1.day.ago }
end_date { 2.days.from_now }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :comment do
body 'Most interresting comment ever, created by a girl.'
user

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :commercial do
sequence(:url) { |n| "https://www.youtube.com/watch?v=4VrhlyIgo3M&factory=#{n}" }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :conference do
title { Faker::Book.title }
short_title { SecureRandom.urlsafe_base64(4) }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :contact do
social_tag { SecureRandom.urlsafe_base64(4) }
email { Faker::Internet.email }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :difficulty_level do
title 'Example Difficulty Level'
description 'Lorem Ipsum dolsum'

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :email_settings do
send_on_registration true
send_on_accepted false

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :event_schedule do
event
after(:build) do |event_schedule|

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :event_type do
title 'Example Event Type'
length 30

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :event_user do
user

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :event do
title { Faker::Hipster.sentence }
abstract { Faker::Hipster.paragraph(2) }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :events_registration do
event
registration

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :lodging do
name { "#{Faker::App.name} Hotel" }
description { Faker::Lorem.paragraph }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :openid do
provider { Faker::Internet.domain_word }
email { Faker::Internet.email }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :organization do
sequence(:name) { |n| "#{Faker::Company.name} #{n}" }
description { Faker::Lorem.paragraph }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :payment do
user
conference

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :physical_ticket do
ticket_purchase
end

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :program do
schedule_public false
schedule_fluid false

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :qanswer do
question
answer

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :question do
title { Faker::Lorem.sentence }
question_type

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :question_type do
title 'Multiple Choice'
end

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :registration do
user
conference

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :registration_period do
start_date { 3.days.ago }
end_date { 5.days.from_now }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :resource do
name { 'Resource' }
quantity { 10 }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :role do
name 'my role'

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :room do
name { "Room #{Faker::Address.country}" }
size 4

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :schedule do
program
end

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :splashpage do
public false

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :sponsor do
name { Faker::Company.name }
website_url { Faker::Internet.url }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :sponsorship_level do
title { Faker::Lorem.word }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :subscription do
user
conference

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :survey_question do
survey
title 'What about this question?'

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :survey_reply do
user
survey_question

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :survey_submission do
user
survey

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :survey do
title 'This is my survey'
start_date Date.current - 1.day

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :target do
due_date { 14.days.from_now }
target_count 100

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :ticket_purchase do
user
conference

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :ticket_scanning do
physical_ticket
end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :ticket do
title { "#{Faker::Hipster.word} Ticket" }
price_cents 1000

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :track do
name { Faker::Commerce.department(2, true) }
description { Faker::Lorem.sentence }

View file

@ -15,7 +15,7 @@
# For a non-admin user, use: `create(:user)`
# For an admin user, use: `create(:admin)
FactoryGirl.define do
FactoryBot.define do
factory :user do
sequence(:email) { |n| "example#{n}@example.com" }
sequence(:name) { |n| "name#{n}" }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :vday do
day { Time.zone.today }
description 'Lorem Ipsum dolsum'

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :venue do
name { "#{Faker::Company.name} Office" }
street { Faker::Address.street_address }

View file

@ -2,7 +2,7 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
FactoryBot.define do
factory :visit do
end
end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :vote do
event
user

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
FactoryGirl.define do
FactoryBot.define do
factory :vposition do
title 'Example Volunteer Position'
description 'Lorem Ipsum dolsum'

View file

@ -73,7 +73,7 @@ RSpec.configure do |config|
end
# Includes helpers and connect them to specific types of tests
config.include FactoryGirl::Syntax::Methods
config.include FactoryBot::Syntax::Methods
config.include OmniauthMacros
config.include Devise::TestHelpers, type: :controller
config.include LoginMacros, type: :feature

View file

@ -11,7 +11,7 @@ RSpec.configure do |config|
begin
DatabaseCleaner.start
mock_commercial_request
FactoryGirl.lint
FactoryBot.lint
ensure
DatabaseCleaner.clean
end