Skip to content

Implement Invitation#report and Invitation#report_id= #84

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

- Add `report_id` attribute to `Invitation` class

## 1.8.0 (2023-01-24)

- Add support for the Report Lifecycle
Expand Down
2 changes: 2 additions & 0 deletions lib/checkr/invitation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Invitation < APIResource
attribute :package
attribute :candidate, :Candidate
attribute_writer_alias :candidate_id, :candidate
attribute :report, :Report
attribute_writer_alias :report_id, :report

api_class_method :all, :get,
constructor: APIList.constructor(:Invitation)
Expand Down
5 changes: 5 additions & 0 deletions test/checkr/invitation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ class InvitationTest < Test::Unit::TestCase
assert_equal(test_invitation[:candidate_id], @invitation.candidate.id)
assert(@invitation.candidate.is_a?(Candidate))
end

should 'have the report_id attribute' do
assert_equal(test_invitation[:report_id], @invitation.report.id)
assert(@invitation.report.is_a?(Report))
end
end

end
Expand Down
3 changes: 2 additions & 1 deletion test/test_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ def test_invitation
package: 'mvr',
object: 'invitation',
created_at: '2015-05-14T17:45:34Z',
candidate_id: '0130da24eb04f6f13973b490'
candidate_id: '0130da24eb04f6f13973b490',
report_id: '4722c07dd9a10c3985ae432a'
}
end

Expand Down