foauth 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@ module Foauth
5
5
  def call(env)
6
6
  url = env[:url]
7
7
  env[:url] = URI.parse("https://foauth.org/#{url.host}#{url.path}")
8
+ env[:url].query = url.query
8
9
  @app.call(env)
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module Foauth
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Foauth do
4
4
  let(:client) { Foauth.new('bob@example.org', '123') }
5
5
  let(:response) { client.get('https://api.twitter.com/1/statuses/user_timeline.json') }
6
- let(:auth) { response.env[:request_headers]['Authorization'] }
6
+ let(:request_headers) { response.env[:request_headers] }
7
7
 
8
8
  before do
9
9
  client.adapter :test do |stub|
@@ -12,6 +12,6 @@ describe Foauth do
12
12
  end
13
13
 
14
14
  it "authenticates with email and password" do
15
- auth.should == 'Basic Ym9iQGV4YW1wbGUub3JnOjEyMw=='
15
+ expect(request_headers['Authorization']).to eq 'Basic Ym9iQGV4YW1wbGUub3JnOjEyMw=='
16
16
  end
17
17
  end
@@ -14,4 +14,9 @@ describe Foauth::RewriteMiddleware do
14
14
  res = conn.get('https://api.twitter.com/1/statuses/user_timeline.json')
15
15
  expect(res.env[:url].to_s).to eq 'https://foauth.org/api.twitter.com/1/statuses/user_timeline.json'
16
16
  end
17
+
18
+ it "preserves the query parameters" do
19
+ res = conn.get('https://api.twitter.com/1/statuses/user_timeline.json', foo: 'bar')
20
+ expect(res.env[:url].query).to eq 'foo=bar'
21
+ end
17
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-03 00:00:00.000000000 Z
12
+ date: 2013-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday