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

Can't stub two methods for one URL #137

Closed
rimian opened this issue Nov 25, 2015 · 3 comments
Closed

Can't stub two methods for one URL #137

rimian opened this issue Nov 25, 2015 · 3 comments

Comments

@rimian
Copy link
Contributor

rimian commented Nov 25, 2015

I'm trying to stub out a preflight request then, a post. But I can't stub out two methods on one URL:

    proxy.stub('http://example.com/api', :method => 'options').and_return(
      :headers => {
        'Access-Control-Allow-Methods' => 'POST, GET, PUT, OPTIONS',
        'Access-Control-Allow-Headers' => 'X-Requested-With, X-Prototype-Version, Token',
        'Access-Control-Max-Age' => '1728000'
      },
      :code => 200
    )

    proxy.stub('http://example.com/api', :method => 'post').and_return(
      :headers => {
        'Access-Control-Allow-Origin' => '*',
        'Access-Control-Allow-Credentials' => 'true'
      },
      :code => 201
    )
@ronwsmith
Copy link
Collaborator

The stub handler looks like it should support two methods but I haven't touched that code personally. Des it is always stub one over the other? What does the billy log show?

@rimian
Copy link
Contributor Author

rimian commented Feb 27, 2016

I got some specs wrapped around this. It works!

#141

@ronwsmith
Copy link
Collaborator

Merged in related PR, closing issue.

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