On Sep 15, 2008, at 6:16 PM, Zach Dennis wrote:

On Mon, Sep 15, 2008 at 5:32 PM, Jonathan Linowes
<[EMAIL PROTECTED]> wrote:
Hi,
suggestions how to add w3 validation to a story step?
eg
Then the page should be valid


You could write a "then" step that takes the current response.body,
uploads it to the w3 validator, and checks the the response. Rather
than uploading you could use the ruby tidy bindings to do offline
validation which would most likely be much faster. See
http://tidy.rubyforge.org/ for more information.


fyi, this goes out to w3
http://blogs.smarteguru.com/2008/09/rails-plugin-to-validate-xhtml- and-css/
        http://github.com/CodeMonkeySteve/assert-valid-asset/tree/master
but required i hack it to work with stories
(in file assert_valid_asset.rb#180, add line:
    method_name ||= 'story'

But also found this, which uses tidy and is significantly faster
        http://blog.cosinux.org/pages/rails-tidy
        http://www.cosinux.org/~dam/projects/rails-tidy/doc/

So
  Then "the browser page should be valid" do
    assert_tidy
  end



-- jonathan linowes
    parkerhill technology group llc
    [EMAIL PROTECTED]
    office: 603-838-2884
    www.parkerhill.com
    blog: www.vaporbase.com


_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to