Created
June 20, 2015 06:37
-
-
Save maimai-swap/ea93bff05805eeb8c3b2 to your computer and use it in GitHub Desktop.
railstutorial 5.3.4
NoMethodError: undefined method `full_title' for #<RSpec::ExampleGroups::StaticPages::HomePage:0x007fbd94a315e8>
This file contains hidden or 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 "support/utilities" | |
RSpec.configure do |config| | |
config.expect_with :rspec do |expectations| | |
expectations.include_chain_clauses_in_custom_matcher_descriptions = true | |
end | |
config.mock_with :rspec do |mocks| | |
mocks.verify_partial_doubles = true | |
end | |
end |
This file contains hidden or 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' | |
require 'rails_helper' | |
# require 'support/utilities' | |
describe "Static pages" do | |
subject { page } | |
describe "Home page" do | |
before { visit root_path } | |
it { should have_content('Sample App') } | |
it { should have_title(full_title('')) } | |
it { should_not have_title('| Home') } | |
end | |
describe "Help page" do | |
before { visit help_path } | |
it { should have_content('Help') } | |
it { should have_title(full_title('Help')) } | |
end | |
describe "About page" do | |
before { visit about_path } | |
it { should have_content('About Us') } | |
it { should have_title(full_title('About Us')) } | |
end | |
describe "Contact page" do | |
before { visit contact_path } | |
it { should have_content('Contact') } | |
it { should have_title(full_title('Contact')) } | |
end | |
end |
This file contains hidden or 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
def full_title(page_title) | |
base_title = "Ruby on Rails Tutorial Sample App" | |
if page_title.empty? | |
base_title | |
else | |
"#{base_title} | #{page_title}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment