diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-19 14:13:10 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-19 14:13:10 +0000 |
commit | 69637c1a5978c38f3734495e14a2e8666502c54a (patch) | |
tree | 5dd9675c8677a194b7272429b4bdccd486158cc8 /spec/spec_helper.rb | |
parent | 79c39c2a493824590c1862816649bc62e718fe19 (diff) | |
parent | c1cfd0944500982a62187ec0cf22f008b1f1e723 (diff) |
Merge branch 'release/0.5' into wdtk
Conflicts:
app/views/public_body/_search_ahead.rhtml
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e58c3890a..33a28449e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -143,7 +143,10 @@ if $tempfilecount.nil? module TestProcess # Hook into the process function, so can automatically get HTML after each request alias :original_process :process - + def is_fragment + # XXX there must be a better way of doing this! + return @request.query_parameters["action"] == "search_typeahead" + end def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET') self.original_process(action, parameters, session, flash, http_method) # don't validate auto-generated HTML @@ -152,7 +155,12 @@ if $tempfilecount.nil? return unless @response.template.controller.instance_eval { integrate_views? } # And then if HTML, not a redirect (302, 301) if @response.content_type == "text/html" && ! [301,302,401].include?(@response.response_code) + if !is_fragment validate_html(@response.body) + else + # it's a partial + validate_as_body(@response.body) + end end end end |