diff --git a/spec/factories/fitbit_activities.rb b/spec/factories/fitbit_activities.rb index 0fb709e..6ac1a38 100644 --- a/spec/factories/fitbit_activities.rb +++ b/spec/factories/fitbit_activities.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :fitbit_activity do steps 100 diff --git a/spec/factories/fitbit_sleeps.rb b/spec/factories/fitbit_sleeps.rb index d443f1c..4f4740e 100644 --- a/spec/factories/fitbit_sleeps.rb +++ b/spec/factories/fitbit_sleeps.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :fitbit_sleep do minutes_asleep 480 diff --git a/spec/factories/genotypes.rb b/spec/factories/genotypes.rb index 1bf25b8..a33c122 100644 --- a/spec/factories/genotypes.rb +++ b/spec/factories/genotypes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :genotype do genotype_file_name 'foo.txt' diff --git a/spec/factories/mendeley_papers.rb b/spec/factories/mendeley_papers.rb index b54436c..48980d5 100644 --- a/spec/factories/mendeley_papers.rb +++ b/spec/factories/mendeley_papers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :mendeley_paper do title 'Musterstudie' diff --git a/spec/factories/picture_phenotypes.rb b/spec/factories/picture_phenotypes.rb index 35354ab..750767e 100644 --- a/spec/factories/picture_phenotypes.rb +++ b/spec/factories/picture_phenotypes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :picture_phenotype do characteristic 'Eye color' diff --git a/spec/factories/snp_comments.rb b/spec/factories/snp_comments.rb index 5228559..dd18c01 100644 --- a/spec/factories/snp_comments.rb +++ b/spec/factories/snp_comments.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :snp_comment do comment_text 'This is a great SNP!' diff --git a/spec/factories/snpedia_papers.rb b/spec/factories/snpedia_papers.rb index c7356a6..af3d620 100644 --- a/spec/factories/snpedia_papers.rb +++ b/spec/factories/snpedia_papers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :snpedia_paper do url 'http://www.snpedia.com/index.php/Rs1234(A;C)' diff --git a/spec/factories/snps.rb b/spec/factories/snps.rb index 90873a1..fd6460a 100644 --- a/spec/factories/snps.rb +++ b/spec/factories/snps.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :snp do sequence(:name) { |i| "rs#{i}" } diff --git a/spec/factories/user_achievements.rb b/spec/factories/user_achievements.rb index fd26877..a626e82 100644 --- a/spec/factories/user_achievements.rb +++ b/spec/factories/user_achievements.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :user_achievement do end diff --git a/spec/factories/user_phenotypes.rb b/spec/factories/user_phenotypes.rb index 879ce94..5784138 100644 --- a/spec/factories/user_phenotypes.rb +++ b/spec/factories/user_phenotypes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :user_phenotype do association :user diff --git a/spec/factories/user_picture_phenotypes.rb b/spec/factories/user_picture_phenotypes.rb index 736bb34..1910c08 100644 --- a/spec/factories/user_picture_phenotypes.rb +++ b/spec/factories/user_picture_phenotypes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :user_picture_phenotype do variation 'pink' diff --git a/spec/factories/user_snps.rb b/spec/factories/user_snps.rb index c82b938..3ff5ec7 100644 --- a/spec/factories/user_snps.rb +++ b/spec/factories/user_snps.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :user_snp do local_genotype 'AG' diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 5979bf2..8c75083 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + FactoryBot.define do factory :user do name 'Dogbert' diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 2aded90..0982a8e 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -4,7 +4,7 @@ require_relative '../test_helper' class UsersControllerTest < ActionController::TestCase context "Users" do setup do - @user = FactoryBot.create(:user, name: "The Dude") + @user = FactoryBot.create(:user, name: 'The Dude') activate_authlogic assert_nil @controller.send(:current_user) Object.any_instance.stubs(:recaptcha_tags) @@ -81,7 +81,7 @@ class UsersControllerTest < ActionController::TestCase context "other users" do setup do @controller = UsersController.new - @other_user = FactoryBot.create(:user, name: "The Nihilist") + @other_user = FactoryBot.create(:user, name: 'The Nihilist') @session = UserSession.create(@other_user) assert_equal @other_user, @controller.send(:current_user) end diff --git a/test/unit/mendeley_search_test.rb b/test/unit/mendeley_search_test.rb index a989d58..a3f4222 100644 --- a/test/unit/mendeley_search_test.rb +++ b/test/unit/mendeley_search_test.rb @@ -98,8 +98,8 @@ class MendeleySearchTest < ActiveSupport::TestCase should "not update existing valid papers" do uuid = @document["uuid"] - existing_mendeley_paper = FactoryBot. - build_stubbed(:mendeley_paper, uuid: uuid, snps: [@snp]) + existing_mendeley_paper = FactoryBot + .build_stubbed(:mendeley_paper, uuid: uuid, snps: [@snp]) MendeleyPaper.expects(:find_or_initialize_by).with(uuid: uuid). returns(existing_mendeley_paper) MendeleyPaper.any_instance.expects(:save).never