Skip to content

Instantly share code, notes, and snippets.

@ivanacostarubio
Created September 24, 2010 20:35
Show Gist options
  • Select an option

  • Save ivanacostarubio/595994 to your computer and use it in GitHub Desktop.

Select an option

Save ivanacostarubio/595994 to your computer and use it in GitHub Desktop.
in Gemfile:
gem 'w3c_validators'
in spec/support/w3c_validator.rb:
include W3CValidators
def validate_url(url)
visit url
result = MarkupValidator.new.validate_text(page.body)
result.errors.should == []
end
in spec/acceptance/w3c_valid_spec.rb:
require File.dirname(__FILE__) + '/acceptance_helper'
feature "W3C Validation" do
before :all do
Capybara.use_default_driver
Capybara.run_server = true
end
scenario "HTML" do
validate_url '/'
end
# scenario "feed XML" do
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment