Rails 3.2.10 and Rspec Tests that Fail?

The following tests used to reside in requests directory and used to
work ... since I have upgraded to rails 3.2.9 and now 3.2.10 they
I have the following tests in(I am only showing the first two tests):

         require 'spec_helper'

         describe "Authentication" do

         subject { page }

            describe "signin" do
            before { visit signin_path }

               it { should have_selector('h2', text: 'Sign in') }
               it { should have_selector('title', text: 'Sign in') }

The first test passes, that is once I created the features directory
and moved the authentication_pages_spec file to it, and the second
fails with the message "expected to find css 'title' with "Sign in"
but the were no matches.

The application code( I am showing just the first three lines since
the rest are the attributes for this view):

            - provide(:title, 'Sign in')
            %h2 Sign in
            = form_for(:session, url: sessions_path) do |f|
It looks to me that I have all the necessary features in place for the
test to pass. So it can only mean that something else is the problem,
maybe the syntax of the test has changed?

Does anyone have some thoughts on this?


Capybara 2.0 upwards no longer supports Title tests see:


I used the solution, work around, given by 'murdoch' towards the end
of the discussion, namely:

    should have_xpath("//title[contains(.,'marflar')]")

now my title tests work ... thanks

I found another solution ... a little more professional in my opinion.
It has to do with defining a Rspec_matcher ... see it here:


It works great.