Skip to content

Conversation

BookOfGreg
Copy link
Contributor

@BookOfGreg BookOfGreg commented Oct 4, 2019

Summary

ActionDispatch::Integration::Session#process already lists OPTIONS as a valid verb symbol to pass
https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/testing/integration.rb#L184
Therefore it should be as simple as allowing the method through.

Other Information

Rails doesn't appear to allow OPTIONS verb in it's router, so people depend on gems like Rack::Cors for it normally. However as part of adding Swagger support for both OPTIONS and TRACE verbs, I'm having to find work-around for this.

There is another conversation about testing using :options in this conversation here where Rack::Cors uses :options on process directly, therefore this should work.

#14071 (comment)

ActionDispatch::Integration::Session#process already lists OPTIONS as a valid verb symbol to pass
@rails-bot rails-bot bot added the actionpack label Oct 4, 2019
@BookOfGreg BookOfGreg changed the title Support the OPTIONS Http Verb Support the OPTIONS Http Verb in Integration tests Oct 4, 2019
@kaspth kaspth merged commit bd40a2e into rails:master Oct 5, 2019
@kaspth
Copy link
Contributor

kaspth commented Oct 5, 2019

I've needed this in the past, so this is a nice CORS correction 😂, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants