Skip to content
  • eileencodes's avatar
    922a066e
    Fix GET JSON integration test request to use method override · 922a066e
    eileencodes authored
    When a `GET` request is sent `as: :json` in an integration test the test
    should use Rack's method override to change to a post request so the
    paramters are included in the postdata. Otherwise it will not encode the
    parameters correctly for the integration test.
    
    Because integration test sets up it's own middleware,
    `Rack::MethodOverride` needs to be included in the integration tests as
    well.
    
    `headers ||= {}` was moved so that headers are never nil. They should
    default to a hash.
    
    Fixes #26033
    
    [Eileen M. Uchitelle & Aaron Patterson]
    922a066e
    Fix GET JSON integration test request to use method override
    eileencodes authored
    When a `GET` request is sent `as: :json` in an integration test the test
    should use Rack's method override to change to a post request so the
    paramters are included in the postdata. Otherwise it will not encode the
    parameters correctly for the integration test.
    
    Because integration test sets up it's own middleware,
    `Rack::MethodOverride` needs to be included in the integration tests as
    well.
    
    `headers ||= {}` was moved so that headers are never nil. They should
    default to a hash.
    
    Fixes #26033
    
    [Eileen M. Uchitelle & Aaron Patterson]
Loading