-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude subjects still linked to set_member_subject in subject_remover #4306
Conversation
Related to: #4250 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Toyosi!
Apologies for the late review. Overall this looks good. I think the biggest thing is
- the
TypeError
added in remover.rb in order to get your tests to pass. I think the reason you've encountered this error in your specs lies possibly with how we are stubbing.
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: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the reason you are getting (and catching) TypeErrors when reaching remover.rb's has_been_talked_about?
(L68 of remover.rb) is because your stubbed response does not match that of the panoptes talk client.
.to_return(status: 200, body: '[]', headers: {}) | |
.to_return(status: 200, body: '{"discussions": []}', headers: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thanks. I had no idea the response
lib/subjects/remover.rb
Outdated
@@ -56,11 +59,19 @@ def has_been_collected_or_classified? | |||
!orphan_subject | |||
end | |||
|
|||
def belongs_to_other_subject_set? | |||
return false unless subject_set_id != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return false unless subject_set_id != nil | |
return false unless !subject_set_id.nil? |
Describe your change here.
Review checklist
apiary.apib
file?