-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from mattbeedle/lastmodified
Format lastmodified param automatically on all GET requests
- Loading branch information
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'spec_helper' | ||
|
||
describe CapsuleCRM::Connection do | ||
before { configure } | ||
|
||
describe '.get' do | ||
context 'when lastmodified is in the supplied params' do | ||
before do | ||
stub_request(:get, /\/api\/v1\/foo/).to_return(body: '{}') | ||
CapsuleCRM::Connection. | ||
get('/api/v1/foo', lastmodified: Time.new(2013, 10, 1, 13, 31, 56)) | ||
end | ||
|
||
it 'should make sure that the lastmodified is formatted in YYYYMMDDTHHMMSS' do | ||
WebMock.should have_requested( | ||
:get, 'https://1234:@company.capsulecrm.com/api/v1/foo' | ||
).with(query: { lastmodified: "20131001T133156" }) | ||
end | ||
end | ||
end | ||
end |