1
votes

new to ROR and working through the MH tutorials. I am working through lesson 03 and have slightly dynamic pages configuration double and triple checked for home page title and get the following error message when I save page_controller_spec.rb or home.html.erb.

Error Message

Failures:

1) PagesController GET 'home' should have the right title Failure/Error: response.should have_selector("title",:content => "Ruby on Rails Tutorial Sample | Home") NoMethodError: undefined method has_selector?' for #<ActionController::TestResponse:0x007f99bad28e48> # ./spec/controllers/pages_controller_spec.rb:13:inblock (3 levels) in '

Finished in 0.1075 seconds 4 examples, 1 failure

Failed examples:

rspec ./spec/controllers/pages_controller_spec.rb:11 # PagesController GET 'home' should have the right title

any direction would be appreciated

All the best Peter

2

2 Answers

0
votes

I googled your problem and found this:

http://getsatisfaction.com/railstutorial/topics/rspec_undefined_method_has_selector

Looks like you're missing a needed gem which is what implements has_selector? for you.

0
votes

It used to be called have_tag, but RSpec now uses Webrat for have_selector. Install that.

http://www.rubyfocus.biz/blog/2011/01/08/from_have_tag_to_have_selector_in_rspec2_gotchas.html