Skip to content

Commit

Permalink
fix sample type validation test that contributor projects match
Browse files Browse the repository at this point in the history
need to make sure the sample_type isn't saved first
  • Loading branch information
stuzart committed Dec 12, 2024
1 parent da9a1e0 commit 9ffde4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/unit/sample_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def setup

#contributor must belong in the same project
sample_type = SampleType.new title: 'fish', projects: @projects, contributor: FactoryBot.create(:person)
FactoryBot.create(:simple_string_sample_attribute, is_title: true, sample_type: sample_type)
sample_type.sample_attributes << FactoryBot.build(:simple_string_sample_attribute, is_title: true)
refute sample_type.valid?
sample_type.errors.added?(:base, 'associate projects that you are an active member of')
sample_type.contributor = @person
Expand Down

0 comments on commit 9ffde4c

Please sign in to comment.