Hartl RoR tutorial Section 5.3.4

Hi can anyone help me with a snag, in Section 5.3.4?

Having to do with Listing 5.27, Prettier tests for the static pages,
Terminal gives me this when I run the

bundle exec rspec spec/requests/static_pages_spec.rb

Roberts-MacBook-Air:sample_app robertjoonkim$ bundle exec rspec
spec/requests/static_pages_
spec.rb
.F.F.F…F

Failures:

  1. Static pages Contact page
    Failure/Error: it { should have_selector(‘title’, text:
    full_title(‘Contact’)) }
    NoMethodError:
    undefined method `full_title’ for
    #RSpec::Core::ExampleGroup::Nested_1::Nested_4:0x007fcc84b11a90

    ./spec/requests/static_pages_spec.rb:33:in `block (3 levels) in

<top (required)>’

  1. Static pages About page
    Failure/Error: it { should have_selector(‘title’, text:
    full_title(‘About Us’)) }
    NoMethodError:
    undefined method `full_title’ for
    #RSpec::Core::ExampleGroup::Nested_1::Nested_3:0x007fcc84f465c0

    ./spec/requests/static_pages_spec.rb:26:in `block (3 levels) in

<top (required)>’

  1. Static pages Home page
    Failure/Error: it { should have_selector(‘title’, text:
    full_title(’’)) }
    NoMethodError:
    undefined method `full_title’ for
    #RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007fcc81d074b0

    ./spec/requests/static_pages_spec.rb:11:in `block (3 levels) in

<top (required)>’

  1. Static pages Help page
    Failure/Error: it { should have_selector(‘title’, text:
    full_title(‘Help’)) }
    NoMethodError:
    undefined method `full_title’ for
    #RSpec::Core::ExampleGroup::Nested_1::Nested_2:0x007fcc829594e8

    ./spec/requests/static_pages_spec.rb:19:in `block (3 levels) in

<top (required)>’

Finished in 0.39844 seconds
9 examples, 4 failures

Failed examples:

rspec ./spec/requests/static_pages_spec.rb:33 # Static pages Contact
page
rspec ./spec/requests/static_pages_spec.rb:26 # Static pages About page
rspec ./spec/requests/static_pages_spec.rb:11 # Static pages Home page
rspec ./spec/requests/static_pages_spec.rb:19 # Static pages Help page

Randomized with seed 14196

Thanks again!

On 7 September 2012 02:15, Robonix [email protected] wrote:

spec.rb
# ./spec/requests/static_pages_spec.rb:33:in `block (3 levels) in <top
(required)>’

Have you provided spec/support/utilities.rb as in listing 5.26? If so
then check that there are no typos.

Colin

I just want to add to this because this has been driving me nuts. I
found my fix.

Which was simply making sure my spec/support/utilities.rb file included
the “.rb” on utilities file. I was leaving of the .rb So simple yet so
stupid of me, anyway hope this helps someone in the future.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs