Skip to content

Commit

Permalink
add spec for request header multiple cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjingboy committed Jan 21, 2014
1 parent 1e555e8 commit 4fd0a7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/faraday-cookie_jar/cookie_jar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
sleep 2
conn.get('/dump').body.should_not == 'foo=bar'
end

it 'multiple cookies' do
conn.get('/default')

response = conn.send('get') do |request|
request.url '/multiple_cookies'
request.headers.merge!({:Cookie => 'language=english'})
end

response.body.should == 'foo=bar;language=english'
end
end

4 changes: 4 additions & 0 deletions spec/support/fake_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ class FakeApp < Sinatra::Application
get '/expires' do
response.set_cookie "foo", :value => "bar", :expires => Time.now + 1
end

get '/multiple_cookies' do
"foo=#{request.cookies['foo']};language=#{request.cookies['language']}"
end
end

0 comments on commit 4fd0a7a

Please sign in to comment.