Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rack update to 2.1.1 breaks omniauth #997

Open
utkarsh2102 opened this issue Mar 29, 2020 · 2 comments
Open

rack update to 2.1.1 breaks omniauth #997

utkarsh2102 opened this issue Mar 29, 2020 · 2 comments

Comments

@utkarsh2102
Copy link

Hi there,

Whilst updating rack to 2.1.1 (from 2.0.8), there is a test failure in omniauth as below:

Failures:

  1) OmniAuth::Strategy#redirect uses javascript if :iframe is true
     Failure/Error: expect(response.last.body.first).to be_include('top.location.href')

     NoMethodError:
       undefined method `body' for #<Array:0x000055e164b0a1f8>
     # ./spec/omniauth/strategy_spec.rb:245:in `block (3 levels) in <top (required)>'

Any clue about the fix?

@BobbyMcWho
Copy link
Member

Hi @utkarsh2102, what version of omniauth are you testing against? I believe we had resolved this.

@utkarsh2102
Copy link
Author

Hi @bobbymarko,
This was 1.9.0.

And with the latest version, that is, 1.9.1, there is a failure, too:

Failures:

  1) OmniAuth::Strategy#redirect uses javascript if :iframe is true
     Failure/Error: expect(response.last).to include(expected_body)
     
       expected #<Rack::BodyProxy:0x000055c9b51b4ef8 @body=#<Rack::Response:0x000055c9b51b51c8 @status=200, @header={..."]>, @block=#<Proc:0x000055c9b51b4ea8 /usr/lib/ruby/vendor_ruby/rack/response.rb:69>, @closed=false> to include "<script type='text/javascript' charset='utf-8'>top.location.href = 'http://abc.com';</script>"
       Diff:
       @@ -1,2 +1,15 @@
       -["<script type='text/javascript' charset='utf-8'>top.location.href = 'http://abc.com';</script>"]
       +#<Rack::BodyProxy:0x000055c9b51b4ef8
       + @block=
       +  #<Proc:0x000055c9b51b4ea8 /usr/lib/ruby/vendor_ruby/rack/response.rb:69>,
       + @body=
       +  #<Rack::Response:0x000055c9b51b51c8
       +   @block=nil,
       +   @body=
       +    ["<script type='text/javascript' charset='utf-8'>top.location.href = 'http://abc.com';</script>"],
       +   @header={"Content-Length"=>"93"},
       +   @length=93,
       +   @status=200,
       +   @writer=
       +    #<Proc:0x000055c9b51b5060 /usr/lib/ruby/vendor_ruby/rack/response.rb:32 (lambda)>>,
       + @closed=false>
       
     # ./spec/omniauth/strategy_spec.rb:247:in `block (3 levels) in <top (required)>'

Finished in 0.21563 seconds (files took 0.61028 seconds to load)
180 examples, 1 failure

Failed examples:

rspec ./spec/omniauth/strategy_spec.rb:243 # OmniAuth::Strategy#redirect uses javascript if :iframe is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants