Skip to content

Instantly share code, notes, and snippets.

@maimai-swap
Created June 20, 2015 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maimai-swap/ea93bff05805eeb8c3b2 to your computer and use it in GitHub Desktop.
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>
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
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
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