Skip to content

Instantly share code, notes, and snippets.

@markfeedly
Created September 25, 2013 18:16
Show Gist options
  • Save markfeedly/6703725 to your computer and use it in GitHub Desktop.
Save markfeedly/6703725 to your computer and use it in GitHub Desktop.
Could I improve this?
describe "StaticPages" do
describe "About page" do
it "should have the content 'About'" do
'/about'.should contain_content('About')
end
# etc .....
=================================
RSpec::Matchers.define :contain_content do |expected_content|
match do |the_page|
visit the_page
expect(page).to have_content(expected_content)
end
end
=================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment