Skip to content
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ Or install it yourself as:
report.id #Returns the checkr id of the created report
report.status #Returns the status of the report
```

**Update report**

```Ruby
report = Checkr::Report.update("5878551b3ee1eacae5a2c558", :package => 'driver_pro')
report.id #Returns the checkr id of the updated report
report.package #Returns the updated package of the report
```

**Find individual reports**

```Ruby
Expand Down
5 changes: 5 additions & 0 deletions lib/checkr/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def self.find(id)
handle_response(response)
end

def self.update(id, params={})
response = self.post("/#{self.to_s.tablelize}/#{id}", :body => params, :basic_auth => Checkr.auth )
handle_response(response)
end

def self.construct(params)
records = params["records"]
report = self.new(params.except_key('records'))
Expand Down
40 changes: 39 additions & 1 deletion test/cassettes/test_0001_should_return_report_object.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions test/lib/checkr/report_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,16 @@
end
end

describe '.update' do
let(:report) { Checkr::Report.update("5878551b3ee1eacae5a2c558", :package => 'driver_pro')}

it "should return report object" do
report.must_be_instance_of(Checkr::Report)
end

it "returns report object with updated parameters" do
report.id.must_equal("5878551b3ee1eacae5a2c558")
report.package.must_equal("driver_pro")
end
end
end