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

Christoph Sturm christoph.sturm at gmail.com
Tue Apr 17 10:08:25 EDT 2007


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


More information about the rspec-users mailing list