[rspec-users] problem with rspec_on_rails and @controller.should_receive(:render) in trunk

David Chelimsky dchelimsky at gmail.com
Wed Apr 18 12:35:10 EDT 2007


On 4/17/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> Are you using the latest beta gem, trunk or the latest release?
>
> On 4/17/07, Christoph Sturm <christoph.sturm at gmail.com> wrote:
> > Hey guys!
> >
> > I am using rspec trunk, and I am having a little problem with the
> > latest version. (I am quite sure this worked with an older version
> > about a week ago)
> >
> > heres the spec:
> >   it "should render the new user form without layout for a xhr request" do
> >     @controller.should_receive(:render).with(:layout=>false)
> >     xhr :get,:new
> >   end
> >
> > and the controller:
> >   def new
> >     render :layout=>false
> >   end
> >
> > I would have loved to create a failing testcase for this, but I
> > couldnt get the rspec test suite running, if i do a simple "rake" in
> > the root rspec directory i get this error:
> >
> > (in /Users/christophsturm/Projects/rspec/example_rails_app)
> > ** Invoke pre_commit (first_time)
> > ** Execute pre_commit
> > #####################################################
> > running pre_commit against rails edge
> > #####################################################
> > #####################################################
> > ruby script/generate rspec_resource purchase order_id:integer
> > created_at:datetime amount:decimal keyword:string description:text
> > --force
> > #####################################################
> > /Users/christophsturm/Projects/rspec/example_rails_app/vendor/rails/edge/railties/lib/initializer.rb:514:in
> > `read': No such file or directory -
> > /Users/christophsturm/Projects/rspec/example_rails_app/config/database.yml
> > (Errno::ENOENT)
> >
> >
> > what am I doing wrong?
> >
> >
> > regards
> >  chris

FYI - Chris says the error is:

<UsersController:0x323fe94> expected :render with ({:layout=>false})
but received it with (no args)



> > _______________________________________________
> > 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