Skip to content
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

V3 updates #50

Merged
merged 23 commits into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0866750
v3 changes (all just example changes in the README)
daria-lamberson Mar 24, 2017
a9c38ea
cleaned up styling
daria-lamberson Mar 24, 2017
06eb599
last few changes by searching for changed fields
daria-lamberson Mar 24, 2017
97542aa
removed object purpose from address param examples
daria-lamberson Mar 24, 2017
bbb35cb
removed object_[x] attrs from shipment apiobject example
daria-lamberson Mar 24, 2017
3198a43
removed shipment.state example
daria-lamberson Mar 24, 2017
2c38c58
fixed requirement
daria-lamberson Mar 24, 2017
358bf8e
updated api_object file
daria-lamberson Mar 24, 2017
4380589
removed object_status, since it will just be in the object dict under…
daria-lamberson Mar 24, 2017
b37ff8e
added back status because it's used in a few places still
daria-lamberson Mar 24, 2017
a338e77
chnged is_return example value from nil to false
daria-lamberson Mar 27, 2017
cc5fb6c
Merge branch 'master' into v3-updates
daria-lamberson Mar 30, 2017
110e5dc
Merge branch 'master' of https://github.com/goshippo/shippo-ruby-clie…
Mar 30, 2017
57627d2
removed fields for v3 update in examples
daria-lamberson Mar 30, 2017
b40344e
Merge branch 'v3-updates' of https://github.com/goshippo/shippo-ruby-…
Mar 30, 2017
ddda4ce
Update Shippo version to v3 in tests
Mar 31, 2017
278ad80
Update object_status to status
Mar 31, 2017
d0bcc81
Update fixtures
Mar 31, 2017
fa3764a
updated changelog and readme before updating gem
daria-lamberson Mar 31, 2017
52f754a
updated gem version
daria-lamberson Mar 31, 2017
4e46846
updated changelog header size inconsistency
daria-lamberson Mar 31, 2017
60f9f20
expanded parcel and changed to plural
daria-lamberson Mar 31, 2017
dcea188
changed more 'parcel's to be plural
daria-lamberson Mar 31, 2017
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
Prev Previous commit
Next Next commit
Update Shippo version to v3 in tests
  • Loading branch information
Vinh Vu committed Mar 31, 2017
commit ddda4cea7c22047419c5a62a722d27eecca7a9b0
2 changes: 1 addition & 1 deletion lib/shippo/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module Shippo
module API
@base = 'https://api.goshippo.com'
@version = nil
@version = ''
@token = ''
@debug = Integer(ENV['SHIPPO_DEBUG'] || 0) > 0 ? true : false
@warnings = true
Expand Down
7 changes: 2 additions & 5 deletions spec/shippo/api/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@
context '#new' do
before do |example|
unless example.metadata[:skip_before]
Shippo::API.version = "2016-10-25"
Shippo::API.version = "2017-03-29"
end
expect(RestClient::Request).to receive(:execute).and_return(http_response)
api_request.execute
end
it 'should not include Shippo-API-Version in header if one is not specified', skip_before: true do
expect(api_request.headers[:'Shippo-API-Version']).to be_nil
end
it 'should include Shippo-API-Version in header if one is specified' do
expect(api_request.headers[:'Shippo-API-Version']).to eql("2016-10-25")
expect(api_request.headers[:'Shippo-API-Version']).to eql("2017-03-29")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the test should always use v3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one does to test the headers (see line 18 above)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you.

end
it 'should successfully return the response object' do
expect(api_request.response).to_not be_nil
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
end

Shippo::API.token = 'shippo_test_09e74f332aa839940e6c241bb008157c19428339'
Shippo::API.version = '2017-03-29'
Shippo::API.warnings = false

CARRIER = 'usps'
Expand Down