[rspec-users] integrate_views is not executing my views

David Chelimsky dchelimsky at gmail.com
Wed Jan 23 02:34:59 EST 2008

On Jan 23, 2008 1:17 AM, Ze No <lists at ruby-forum.com> wrote:
> I wanted to use "integrate_views" as Ryan explains in his RailsCast #71
> (http://railscasts.com/episodes/71)
> ...but I can't get it to work: the view code in not executed
> I looked everywhere but I can't understand what I am doing wrong.
> Here is what I did:
> I created a new application from scratch (Rails 2.0.2), added rspec and
> rspec_on_rails plugins, and run
> script/generate rspec_scaffold User name:string
> This is my users_controller spec:
> describe UsersController do
>   fixtures :users
>   integrate_views
>   describe "handling GET /users" do
>     it "should be successful" do
>       get :index
>       response.should be_success
>     end
>   end
> end

Try it without nesting:

describe UsersController, "handling GET /users" do
 fixtures :users

 it "should be successful" do
   get :index
   response.should be_success

If that works, then you've uncovered a bug with integrate_views not
working in nested example groups. If so, please report it to the



> I then added something wrong (on purpose) in index.html.erb  (<% WRONG
> %>) so that when I visit /users I get a view error (undefined local
> variable or method....)
> But when I run the spec everything is ok and the test does NOT fail :-(
> I can even trash the index.html.erb file and the test still passes
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list