[rspec-users] Odd parameter munging with with()

James Hughes hughes.james at gmail.com
Tue Feb 20 14:17:13 EST 2007


On 2/20/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> Here's the same output w/ the latest trunk. Note that it shows #with
> correctly receiving a Hash now.

David, thanks. I updated to latest trunk and can now pass the same
params hash to both #with and #post and get the expected results. Note
that I didn't have to deal with the :only_path stuff as I was looking
at params[:user] and not just params.

>
> 1)
> Spec::Mocks::MockExpectationError in 'a test controller should pass a
> hash to #with (1)'
> #<TestController:0x2578854> expected :amethod with ({"param2"=>"bar",
> "id"=>"1"}) but received it with ({"action"=>"index", "id"=>"1",
> "param2"=>"bar", "controller"=>"test"})
> ./spec/controllers/temp_spec.rb:4:in `index'
> ./spec/controllers/temp_spec.rb:16:
>
> 2)
> Spec::Mocks::MockExpectationError in 'a test controller should pass a
> hash to #with (2)'
> #<TestController:0x2516ec4> expected :amethod with ({"param2"=>"bar",
> "id"=>"1"}) but received it with ({"action"=>"index", "id"=>"1",
> "param2"=>"bar", "controller"=>"test"})
> ./spec/controllers/temp_spec.rb:4:in `index'
> ./spec/controllers/temp_spec.rb:19:
>
> 3)
> Spec::Mocks::MockExpectationError in 'a test controller should pass a
> hash to #with (3)'
> #<TestController:0x2461d58> expected :amethod with ({:only_path=>true,
> "param2"=>"bar", "id"=>"1", :action=>:index}) but received it with
> ({"action"=>"index", "id"=>"1", "param2"=>"bar",
> "controller"=>"test"})
> ./spec/controllers/temp_spec.rb:4:in `index'
> ./spec/controllers/temp_spec.rb:22:
>
> I have NO idea yet about  :only_path. I'll keep you posted...
>
> >
> >  rgds from "Confused of Hampshire".
> >
> >
> >
> >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list