diff --git a/spec/factories/stash_engine/resources.rb b/spec/factories/stash_engine/resources.rb index 0ac7d723f6..381843125f 100644 --- a/spec/factories/stash_engine/resources.rb +++ b/spec/factories/stash_engine/resources.rb @@ -61,8 +61,8 @@ create(:description, resource_id: resource.id) create(:right, resource: resource) create(:contributor, resource: resource) - resource.subjects << create(:subject, subject_scheme: 'fos') - 3.times { resource.subjects << create(:subject) } + resource.subjects << create(:subject, subject: Faker::Lorem.unique.word, subject_scheme: 'fos') + 3.times { resource.subjects << create(:subject, subject: Faker::Lorem.unique.word) } end trait :submitted do diff --git a/spec/models/stash_engine/resources_spec.rb b/spec/models/stash_engine/resources_spec.rb index 9156febfcc..52a7ab1ce1 100644 --- a/spec/models/stash_engine/resources_spec.rb +++ b/spec/models/stash_engine/resources_spec.rb @@ -792,7 +792,6 @@ module StashEngine end it 'purges duplicate subjects' do - @resource.purge_duplicate_subjects! @resource.subjects << create(:subject, subject: 'AARDVARKS') @resource.subjects << create(:subject, subject: 'Aardvarks') @resource.subjects << create(:subject, subject: 'aardvarks') @@ -802,7 +801,6 @@ module StashEngine end it "doesn't purge FOS subjects" do - @resource.purge_duplicate_subjects! existing_fos = @resource.subjects.fos.first @resource.subjects << create(:subject, subject: existing_fos.subject) # this one doesn't have fos subject_scheme set @resource.subjects << create(:subject, subject: existing_fos.subject) @@ -815,7 +813,6 @@ module StashEngine end it 'prefers to purge non-controlled vocab subjects over ones with vocabulary' do - @resource.purge_duplicate_subjects! existing_subj = @resource.subjects.non_fos.first @resource.subjects << create(:subject, subject: existing_subj.subject, subject_scheme: 'gumma') starting_size = @resource.subjects.count