ok, so here's the deal. Going over the Rails tutorial. We're running a testing environment to make sure that the things we want showing up on our pages are making it. Doing this using pages_controller_spec.rb file. And this is one of three arguments that we passed:

describe "GET 'home'" do
    it "returns http success" do
      get 'home'
      response.should be_success
    end
    it "should have the right title" do
      get 'home'
      response.should has_selector("title", 
                  :content => "Ruby on Rails Tutorial Sample App | Home")
    end

All three tests are the same. When I run rspec spec/ from the command line (I'm using windows vista) I get this error on all three tests:


1) PagesController GET 'home' should have the right title
←[31mFailure/Error:←[0m ←[31mresponse.should have_selector("title",←[0m
←[31mNoMethodError:←[0m
←[31mundefined method `has_selector?' for #<ActionController::TestResponse:0x4d71bd8>←[0m
←[36m # ./spec/controllers/pages_controller_spec.rb:13:in `block (3 levels)
in <top (required)>'←[0m

As you can see, I am not using anything called has_selector, but have_selector. Where is this coming from? Does anyone know how to fix it? I've checked over the code repeatedly for 2 days now to make sure that my example matches the video and that the text being checked for by rspec is identical on the actual web pages. I mean, heck, the pages even display properly after I start the server. So I am totally without a clue. The closest I came to an answer was on another forum where someone mentioned that they forgot to include the 'render_views' near the top after the first 'describe'. Double checked that too and I got it where it needs to be. *sad programmer*

Ok, Sorry bout this if anyone has been looking at this. But I have come to the conclusion here that the problem is my own for trying to do this project from two different sources. I'm marking this as solved and starting the project over from scratch and tackling it from another angle using one source. Thanks to anyone who read this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.