On Wed, Sep 10, 2008 at 12:24 PM, Mark Dodwell <[EMAIL PROTECTED]> wrote:
> It seems that RSpec-Rails isn't restricted to the HTTP methods
> correctly.
>
> For example doing:
>
>   http://foo.local/session/destroy
>
> in the browser doesn't work, because the destroy action is only
> recognised with the HTTP 'delete' verb.
>
> But in Rspec specs if you do:
>
>  get :destroy
>
> It works.
>
> Is this intended behaviour or a bug?

RSpec controller examples and scenarios each wrap testing services
provided by Rails. You'll get the same results from rails functional
tests as you do in rspec controller examples, and you'll get the same
results from rails integration tests as you do from rspec scenarios
(using RailsStory).

In controller examples (wrapping rails functional tests), routing is
bypassed, so I think you'll find that you can get, post, put, delete
any action that aren't restricted from the controller.

In RailsStory, the RSpec wrapper for rails integration tests, requests
DO go through routing, so, similarly, I think you'll find that you can
get, post, put, delete any action that aren't restricted from routing.

That all make sense? Let us know if you have any additional questions.

Cheers,
David

>
> Many Thanks,
>
> ~ Mark
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to