Created
December 24, 2016 00:22
-
-
Save MilanGrubnic70/d3ae54f0609f94497552fa93e067175d to your computer and use it in GitHub Desktop.
RSpec Refactored
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Static pages" do | |
let(:base_title) {"Ruby on Rails Tutorial Sample App"} | |
subject { page } | |
describe "Home page" do | |
before { visit root_path } | |
it { should have_selector('h1', text: 'Sample App') } | |
it { should have_selector('title', text: "#{base_title}")} | |
it { should have_selector('title', text: full_title(''))} #refactored | |
it { should_not have_selector('title', text: '| Home')} | |
# it "should have the content 'Sample App'" do | |
# page.should have_content('Sample App') | |
# end | |
it { should have_content('Sample App')} | |
# it "should have the base title" do | |
# page.should have_selector('title', text: "#{base_title}") | |
# end | |
it { should have_selector('title', text: "#{base_title}")} | |
# it "should not have a custom page title" do | |
# visit root_path | |
# page.should_not have_selector('title', text: '| Home') | |
# end | |
it { should_not have_selector('title', text: '| Home')} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment