I've google and read stackoverflow about 4 hours, but cannot understand, why test similar to rails tutorial fail.
Test is very simple:
# encoding: utf-8
require 'spec_helper'
describe "StaticPages" do
subject { page }
describe "Contacts page" do
before { visit contacts_path }
it { should have_selector(:title, text: "|") }
end
end
So, I add save_and_open_page to see, what's wrong with my Contacts page, but it's looks good. Title tag is present and contain "|".
I cannot understand, what's wrong. I've:
- tryed get instead visit;
- response instead page;
- check something other permanently in body (body.should have_selector(:h1)).
Also I tryed to understand, how to improve rspec output to more infomative. At now I see:
Failure/Error: it { should have_selector(:title, text: "|") }
expected id :title with text "|" to return something