<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Thank you for the reply.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Doesn't look like it.  The setup does this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    @fund = mock_model(Fund)</DIV><DIV>    Fund.should_receive(:find).with(@fund.id.to_s).and_return(@fund)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I changed setup to say </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    @fund = mock_model(Fund)</DIV><DIV>    @fund_id = @fund.id</DIV><DIV>    Fund.should_receive(:find).with(@fund.id.to_s).and_return(@fund)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>And the test to</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>  it "should provide the fund" do</DIV><DIV>    @fund_id.should_not be(nil)</DIV><DIV>    get(:timesheet,{:id=&gt;@fund_id})</DIV><DIV>    assigns[:fund].should == @fund</DIV><DIV>  end</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Still gives the same error on the "get" line.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Jim</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV><DIV>On May 16, 2007, at 12:57 AM, Jeff Dean wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Is @fund nil?  I'm guessing here, but the []= could be from the underlying attributes (@<A href="http://fund.id">fund.id</A> is the same as @fund.attributes['id']).<BR><BR><DIV><SPAN class="gmail_quote">On 5/16/07, <B class="gmail_sendername">Jim Hughes</B> &lt;<A href="mailto:jeem@hughesorama.com">jeem@hughesorama.com</A>&gt; wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Here's a snippet:<BR><BR>   it "should provide the fund" do<BR>     get(:timesheet,{:id=&gt;@<A href="http://fund.id">fund.id</A>})<BR>     assigns[:fund].should == @fund<BR>   end<BR><BR>Works fine on my box, fails on my CI server.  Here's the output: <BR><BR>NoMethodError in 'The FundController timesheet should provide the fund'<BR>You have a nil object when you didn't expect it!<BR>You might have expected an instance of Array.<BR>The error occurred while evaluating nil.[]= <BR>./spec/controllers/fund_controller_spec.rb:19:<BR>./script/spec:4:<BR><BR>The line raising is the "get" line.  I don't see a foo[bar] = x,<BR>implied anywhere in the statement.<BR><BR>Has anyone seen this? <BR><BR>Thanks for any help.<BR><BR>Jim<BR>_______________________________________________<BR>rspec-users mailing list<BR><A href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</A><BR><A href="http://rubyforge.org/mailman/listinfo/rspec-users"> http://rubyforge.org/mailman/listinfo/rspec-users</A><BR></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">rspec-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>