diff --git a/Gemfile b/Gemfile index d54f13cb..72f66b27 100644 --- a/Gemfile +++ b/Gemfile @@ -63,7 +63,7 @@ group :test do gem 'chromedriver-helper' gem 'database_cleaner' gem 'email_spec' - gem 'factory_girl_rails' + gem 'factory_bot_rails', '~> 4' gem 'launchy' gem 'rspec-collection_matchers' gem 'selenium-webdriver' diff --git a/Gemfile.lock b/Gemfile.lock index 47ac0906..00e33e28 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,12 +48,12 @@ GEM archive-zip (0.12.0) io-like (~> 0.3.0) arel (6.0.4) - autoprefixer-rails (9.5.1.1) + autoprefixer-rails (9.6.0) execjs awesome_print (1.8.0) aws-eventstream (1.0.3) - aws-partitions (1.167.0) - aws-sdk-core (3.53.1) + aws-partitions (1.175.0) + aws-sdk-core (3.55.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.1) @@ -61,7 +61,7 @@ GEM aws-sdk-rails (2.1.0) aws-sdk-ses (~> 1) railties (>= 3) - aws-sdk-ses (1.21.0) + aws-sdk-ses (1.22.0) aws-sdk-core (~> 3, >= 3.53.0) aws-sigv4 (~> 1.1) aws-sigv4 (1.1.0) @@ -78,7 +78,7 @@ GEM bugsnag (6.11.1) concurrent-ruby (~> 1.0) builder (3.2.3) - capybara (3.21.0) + capybara (3.24.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -116,10 +116,10 @@ GEM erubis (2.7.0) eventmachine (1.2.7) execjs (2.7.0) - factory_girl (4.9.0) + factory_bot (4.11.1) activesupport (>= 3.0.0) - factory_girl_rails (4.9.0) - factory_girl (~> 4.9.0) + factory_bot_rails (4.11.1) + factory_bot (~> 4.11.1) railties (>= 3.0.0) faker (1.9.3) i18n (>= 0.7) @@ -157,7 +157,7 @@ GEM jquery-rails railties (>= 3.1) sass-rails - jquery-rails (4.3.3) + jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -204,7 +204,7 @@ GEM omniauth-github (1.3.0) omniauth (~> 1.5) omniauth-oauth2 (>= 1.4.0, < 2.0) - omniauth-google-oauth2 (0.6.1) + omniauth-google-oauth2 (0.7.0) jwt (>= 2.0) omniauth (>= 1.1.1) omniauth-oauth2 (>= 1.5) @@ -274,12 +274,12 @@ GEM regexp_parser (1.5.1) rspec-collection_matchers (1.1.3) rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.8.0) + rspec-core (3.8.1) rspec-support (~> 3.8.0) - rspec-expectations (3.8.3) + rspec-expectations (3.8.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) + rspec-mocks (3.8.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-rails (3.8.2) @@ -290,7 +290,7 @@ GEM rspec-expectations (~> 3.8.0) rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) - rspec-support (3.8.0) + rspec-support (3.8.2) ruby_parser (3.13.1) sexp_processor (~> 4.9) rubyzip (1.2.3) @@ -311,8 +311,8 @@ GEM selenium-webdriver (3.142.3) childprocess (>= 0.5, < 2.0) rubyzip (~> 1.2, >= 1.2.2) - sexp_processor (4.12.0) - shoulda-matchers (4.0.1) + sexp_processor (4.12.1) + shoulda-matchers (4.1.0) activesupport (>= 4.2.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) @@ -373,7 +373,7 @@ DEPENDENCIES database_cleaner email_spec execjs - factory_girl_rails + factory_bot_rails (~> 4) faker figaro haml-rails diff --git a/spec/factories.rb b/spec/factories.rb index c757cbc0..cc3ae1da 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,11 +1,11 @@ -FactoryGirl.define do +FactoryBot.define do factory :user do name { "#{Faker::Name.first_name.gsub("'", "")} #{Faker::Name.last_name.gsub("'", "")}" } sequence(:email) { |n| "example#{n}@example.com" } username { "#{name[0..3]}_#{Faker::Internet.domain_word}"} factory :member do - state "member" + state { "member" } factory :mature_member do after(:create) do |user| @@ -16,35 +16,35 @@ factory :setup_complete_member do sequence(:email_for_google) { |n| "googleemail#{n}@example.com" } - dues_pledge [10, 25, 50].sample - stripe_customer_id "123abc" - setup_complete true + dues_pledge { [10, 25, 50].sample } + stripe_customer_id { "123abc" } + setup_complete { true } end end factory :key_member do - state 'key_member' + state { 'key_member' } end factory :voting_member do - state "voting_member" - voting_policy_agreement true + state { "voting_member" } + voting_policy_agreement { true } end factory :applicant do - state "applicant" + state { "applicant" } end factory :admin do - is_admin true - state "voting_member" + is_admin { true } + state { "voting_member" } end end factory :vote do association :user, factory: :voting_member application - value false + value { false } end factory :sponsorship do @@ -54,22 +54,22 @@ factory :application do association :user, factory: :applicant - state "submitted" - agreement_terms true - agreement_policies true - agreement_female true + state { "submitted" } + agreement_terms { true } + agreement_policies { true } + agreement_female { true } factory :unsubmitted_application do - state "started" + state { "started" } end factory :stale_application do - stale_email_sent_at nil + stale_email_sent_at { nil } submitted_at { 14.days.ago } end factory :approvable_application do - submitted_at 7.days.ago + submitted_at { 7.days.ago } after(:create) do |application, _| create_list(:vote, Application.minimum_yes_votes, application: application, value: true) @@ -93,7 +93,7 @@ factory :comment do association :application, factory: :application association :user, factory: :member - body 'comment body' - created_at 1.day.ago + body { 'comment body' } + created_at { 1.day.ago } end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0c43e1bf..26f5418d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,7 +41,7 @@ RSpec.configure do |config| config.include(EmailSpec::Helpers) config.include(EmailSpec::Matchers) - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods config.infer_spec_type_from_file_location!