From 5170dcb92cbfbbbf09e16a59040c421a800570d0 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 6 Jan 2012 15:23:02 +0000 Subject: Further work in progress --- spec/spec_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5c5cd9a7f..fe244c77d 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. -- cgit v1.2.3 From a5a7283300bc2eb9da608ceedba08f31315410b0 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 6 Jan 2012 15:58:26 +0000 Subject: Reduce excess flush operations (they're slooow) --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fe244c77d..29ce6bca5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -97,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 -- cgit v1.2.3 From a5f6dc2d8af9a12c05c1b6e3897292f2eaee3ab0 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Sun, 8 Jan 2012 09:38:43 +0000 Subject: Don't give error when viewing HTML versions. Fixes issue #321 --- spec/spec_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 29ce6bca5..9bf752c99 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -138,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) -- cgit v1.2.3