Using Rails for custom applications and avoiding the CMS trap. Starting specific version of thin web server
Oct 01

Spent a little time scratching my head on this week. @params is reserved in Rspec controller tests apparently much like Rails. @params will contain extra keys like “controller” and “action” which if you try and assert against will fail of you do something like this:

<pre>

@params = {:id => ‘niceid’}

Model.expects(:method).with(@params)

</pre>

2 Responses to “Beware asserting against Rspec @params”

  1. Ulysses Carmolli Says:

    Hi this article was very helpful for me. But it was
    difficult to find it with yahoo. Maybe you should improve it with
    seo plugins for wordpress like headspace2.

  2. hbeaver Says:

    Thanks. I’m very behind on responding to comments. I’ll take your headspace advice soon.

    H

Leave a Reply