diff --git a/lib/instapaper/api/oauth.rb b/lib/instapaper/api/oauth.rb index 995eee8..3c74940 100644 --- a/lib/instapaper/api/oauth.rb +++ b/lib/instapaper/api/oauth.rb @@ -7,7 +7,7 @@ module Instapaper module OAuth # Gets an OAuth access token for a user. def access_token(username, password) - response = perform_post_with_unparsed_response('/api/1/oauth/access_token', x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth') + response = perform_post_with_unparsed_response('/api/1.1/oauth/access_token', x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth') parsed_response = QLineParser.parse(response) fail Instapaper::Error::OAuthError, parsed_response['error'] if parsed_response.key?('error') Instapaper::Credentials.new(parsed_response) diff --git a/spec/instapaper/api/oauth_spec.rb b/spec/instapaper/api/oauth_spec.rb index a6b522c..c132705 100644 --- a/spec/instapaper/api/oauth_spec.rb +++ b/spec/instapaper/api/oauth_spec.rb @@ -5,15 +5,15 @@ describe Instapaper::Client::OAuth do describe '#token' do before do - stub_post('/api/1/oauth/access_token').with(body: {x_auth_username: 'ohai', x_auth_password: 'p455w0rd', x_auth_mode: 'client_auth'}) + stub_post('/api/1.1/oauth/access_token').with(body: {x_auth_username: 'ohai', x_auth_password: 'p455w0rd', x_auth_mode: 'client_auth'}) .to_return(body: fixture('access_token.txt'), headers: {content_type: 'text/plain; charset=utf-8'}) - stub_post('/api/1/oauth/access_token').with(body: {x_auth_username: 'inval1d', x_auth_password: 'cr3dentials', x_auth_mode: 'client_auth'}) + stub_post('/api/1.1/oauth/access_token').with(body: {x_auth_username: 'inval1d', x_auth_password: 'cr3dentials', x_auth_mode: 'client_auth'}) .to_return(body: fixture('invalid_credentials.txt'), headers: {content_type: 'text/plain; charset=utf-8'}) end it 'gets the correct resource' do client.access_token('ohai', 'p455w0rd') - expect(a_post('/api/1/oauth/access_token')) + expect(a_post('/api/1.1/oauth/access_token')) .to have_been_made end