foauth 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/foauth/rewrite_middleware.rb +1 -0
- data/lib/foauth/version.rb +1 -1
- data/spec/client_spec.rb +2 -2
- data/spec/middleware_spec.rb +5 -0
- metadata +2 -2
data/lib/foauth/version.rb
CHANGED
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(:
|
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
|
-
|
15
|
+
expect(request_headers['Authorization']).to eq 'Basic Ym9iQGV4YW1wbGUub3JnOjEyMw=='
|
16
16
|
end
|
17
17
|
end
|
data/spec/middleware_spec.rb
CHANGED
@@ -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
|
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-
|
12
|
+
date: 2013-01-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|