diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-09 21:34:15 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-09 21:34:15 +0000 |
commit | 4fe1a1d68234197d5303ad7323dd91636b84db14 (patch) | |
tree | e66779ac77cd3ab8d9b39f6957e7e06fa2a4ae4e /spec/spec_helper.rb | |
parent | bb87d842ec3559483a2c0132dbc0c216e0cb597e (diff) | |
parent | 19a0a2fedf68a256084d4dcfd70b9cb9377b9a09 (diff) |
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into release/0.5
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5c5cd9a7f..9bf752c99 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -78,7 +78,6 @@ def load_file_fixture(file_name) end def rebuild_xapian_index(terms = true, values = true, texts = true, dropfirst = true) - parse_all_incoming_messages if dropfirst begin ActsAsXapian.readable_init @@ -86,7 +85,9 @@ def rebuild_xapian_index(terms = true, values = true, texts = true, dropfirst = rescue RuntimeError end ActsAsXapian.writable_init + ActsAsXapian.writable_db.close end + parse_all_incoming_messages verbose = false # safe_rebuild=true, which involves forking to avoid memory leaks, doesn't work well with rspec. # unsafe is significantly faster, and we can afford possible memory leaks while testing. @@ -96,7 +97,7 @@ end def update_xapian_index verbose = false - ActsAsXapian.update_index(flush_to_disk=true, verbose) + ActsAsXapian.update_index(flush_to_disk=false, verbose) end # Validate an entire HTML page @@ -137,10 +138,10 @@ if $tempfilecount.nil? 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 + return if @request.query_parameters["action"] == "get_attachment_as_html" # XXX Is there a better way to check this than calling a private method? 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) validate_html(@response.body) |