Satisfy hound

This commit is contained in:
Philipp Bayer
2018-10-07 21:26:02 +08:00
parent d3dde6166d
commit d85589e528
15 changed files with 17 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :fitbit_activity do
steps 100

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :fitbit_sleep do
minutes_asleep 480

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :genotype do
genotype_file_name 'foo.txt'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :mendeley_paper do
title 'Musterstudie'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :picture_phenotype do
characteristic 'Eye color'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :snp_comment do
comment_text 'This is a great SNP!'

View File

@@ -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)'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :snp do
sequence(:name) { |i| "rs#{i}" }

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user_achievement do
end

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user_phenotype do
association :user

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user_picture_phenotype do
variation 'pink'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user_snp do
local_genotype 'AG'

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user do
name 'Dogbert'

View File

@@ -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

View File

@@ -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