aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony <tony>2009-03-13 11:45:54 +0000
committertony <tony>2009-03-13 11:45:54 +0000
commit987a0350240f3da0c48d8dfeebb2ad3870c11d52 (patch)
treeeb19614e8b3f3ae12433400cf9d464724f1011f1
parent92b0f3b4c8f62b6a3f0648ba27de11f40c247df0 (diff)
Call rebuild_xapian_index in more tests to reduce order dependency
-rw-r--r--spec/controllers/general_controller_spec.rb5
-rw-r--r--spec/controllers/request_controller_spec.rb1
-rw-r--r--spec/controllers/track_controller_spec.rb3
-rw-r--r--spec/spec_helper.rb5
4 files changed, 8 insertions, 6 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 5390468ee..942f99db2 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -1,10 +1,5 @@
require File.dirname(__FILE__) + '/../spec_helper'
-def rebuild_xapian_index
- rebuild_name = File.dirname(__FILE__) + '/../../script/rebuild-xapian-index'
- Kernel.system(rebuild_name) or raise "failed to launch rebuild-xapian-index"
-end
-
describe GeneralController, "when searching" do
integrate_views
fixtures :users, :outgoing_messages, :incoming_messages, :raw_emails, :info_requests, :info_request_events, :public_bodies, :comments
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 72829b26f..9bdb02850 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
describe RequestController, "when listing recent requests" do
integrate_views
fixtures :info_requests, :outgoing_messages, :info_request_events
+ rebuild_xapian_index
it "should be successful" do
get :list, :view => 'recent'
diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index 68064b908..bd91edf61 100644
--- a/spec/controllers/track_controller_spec.rb
+++ b/spec/controllers/track_controller_spec.rb
@@ -59,7 +59,8 @@ end
describe TrackController, "when viewing RSS feed for a track" do
integrate_views
fixtures :info_requests, :outgoing_messages, :incoming_messages, :raw_emails, :info_request_events, :users, :track_things, :comments, :public_bodies
-
+ rebuild_xapian_index
+
it "should get the RSS feed" do
track_thing = track_things(:track_fancy_dog_request)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8945bc7b2..4400c0a28 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -30,6 +30,11 @@ def receive_incoming_mail(email_name, email_to)
RequestMailer.receive(content)
end
+def rebuild_xapian_index
+ rebuild_name = File.dirname(__FILE__) + '/../script/rebuild-xapian-index'
+ Kernel.system(rebuild_name) or raise "failed to launch rebuild-xapian-index"
+end
+
# Monkeypatch! Validate HTML in tests.
$html_validation_script = "/usr/bin/validate" # from Debian package wdg-html-validator
if $tempfilecount.nil?