Skip to content

Commit

Permalink
Disabled gzip testing for ruby 1.8, since it's not implemented in Net…
Browse files Browse the repository at this point in the history
…::HTTP
  • Loading branch information
needto committed Feb 21, 2011
1 parent abfb051 commit 648e5d2
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions oa-enterprise/spec/omniauth/strategies/cas_spec.rb
Expand Up @@ -73,20 +73,22 @@ def strategy
end
end

describe 'GET /auth/cas/callback with a valid ticket and gzipped response from the server' do
before do
zipped = StringIO.new
Zlib::GzipWriter.wrap zipped do |io|
io.write File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'cas_success.xml'))
unless RUBY_VERSION =~ /^1\.8\.\d$/
describe 'GET /auth/cas/callback with a valid ticket and gzipped response from the server on ruby >1.8' do
before do
zipped = StringIO.new
Zlib::GzipWriter.wrap zipped do |io|
io.write File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'cas_success.xml'))
end
stub_request(:get, /^https:\/\/cas.example.org(:443)?\/serviceValidate\?([^&]+&)?ticket=593af/).
with { |request| @request_uri = request.uri.to_s }.
to_return(:body => zipped.string, :headers => { 'content-encoding' => 'gzip' })
get '/auth/cas/callback?ticket=593af'
end
stub_request(:get, /^https:\/\/cas.example.org(:443)?\/serviceValidate\?([^&]+&)?ticket=593af/).
with { |request| @request_uri = request.uri.to_s }.
to_return(:body => zipped.string, :headers => { 'content-encoding' => 'gzip' })
get '/auth/cas/callback?ticket=593af'
end

it 'should call through to the master app when response is gzipped' do
last_response.body.should == 'true'
it 'should call through to the master app when response is gzipped' do
last_response.body.should == 'true'
end
end
end
end

0 comments on commit 648e5d2

Please sign in to comment.