Skip to content

Commit

Permalink
hound cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooyosi committed Mar 25, 2024
1 parent 87c1d85 commit 8ff902a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/subjects/remover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def has_been_collected_or_classified?
end

def belongs_to_other_subject_set?
return false if !subject_set_id
return false unless subject_set_id != nil

orphan_subject.set_member_subjects.where.not(subject_set_id: subject_set_id).count > 0
orphan_subject.set_member_subjects.where.not(subject_set_id: subject_set_id).count.positive?
end

def has_been_talked_about?
Expand Down
8 changes: 4 additions & 4 deletions spec/lib/subjects/remover_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
expect { SetMemberSubject.find(sms_ids) }.to raise_error(ActiveRecord::RecordNotFound)
end

context "with multiple subject sets" do
context 'with multiple subject sets' do
let(:alternate_subject_set) { create(:subject_set) }
let(:remover) { Subjects::Remover.new(subject.id, panoptes_client, alternate_subject_set.id) }
it "should not remove subjects associated with multiple set_member_subjects" do
create(:set_member_subject, subject: subject, subject_set: alternate_subject_set)
let(:remover) { described_class.new(subject.id, panoptes_client, alternate_subject_set.id) }
let(:new_sms) { create(:set_member_subject, subject: subject, subject_set: alternate_subject_set) }
it 'should not remove subjects associated with multiple set_member_subjects' do
remover.cleanup
expect(Subject.where(id: subject.id)).to exist
end
Expand Down
4 changes: 2 additions & 2 deletions spec/workers/subject_removal_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

def stub_discussions_request(subject_id)
stub_request(:get, discussions_url)
.with(query: { focus_id: subject_id, focus_type: "Subject" })
.to_return(status: 200, body: "[]", headers: {})
.with(query: { focus_id: subject_id, focus_type: 'Subject' })
.to_return(status: 200, body: '[]', headers: {})
end

before do
Expand Down

0 comments on commit 8ff902a

Please sign in to comment.