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

David Chelimsky dchelimsky at gmail.com
Tue Apr 17 10:22:34 EDT 2007


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 don't know why this should be failing. Are you using edge rails?
Perhaps something changed there that we don't know about.

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

We moved the plugin out from within the example_rails_app, so to run
the specs you first must say:

rake rspec:install_plugin

That will copy {project_root}/rspec_on_rails to
{project_root}/example_rails_app/vendor/plugins/

Thanks for looking into this.

Cheers,
David

>
>
> regards
>  chris
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list