Skip to content

Commit

Permalink
fix: ensure tests work and address tii check list items
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Dec 20, 2023
1 parent 38d4059 commit 3dc5cb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions app/models/turn_it_in/tii_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def handle_error(error, codes = [])
when 403
self.error_code = :authentication_error
return
when 451
self.error_cde = :no_user_with_accepted_eula
return
when 429
self.error_code = :rate_limited
retry_request
Expand Down
5 changes: 1 addition & 4 deletions app/models/turn_it_in/tii_action_upload_task_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ def update_from_attachment_status(response)

save_and_mark_complete
when 'ERROR'
self.error_code = :custom_tii_error
self.custom_error_message = response.error_code
Doubtfire::Application.config.logger.error "Error with tii submission: #{id} #{self.custom_error_message}"
save_and_log_custom_error
save_and_log_custom_error "Error with tii submission #{id} - #{response.error_code}"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/models/tii_group_attachment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_group_attachment_process
action.perform

assert_requested get_status_stub, times: 3
assert_equal 'TOO_LITTLE_TEXT', action.error_message
assert action.error_message.include?('TOO_LITTLE_TEXT')
assert_equal :custom_tii_error, action.error_code.to_sym
assert action.error?

Expand Down

0 comments on commit 3dc5cb1

Please sign in to comment.