diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-25 08:22:42 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-25 08:22:42 +0000 |
commit | 4cbdf45b2077541a7bbc7e0a719289442c1d0fa3 (patch) | |
tree | 9a9d370d3d2d8f6bc5500b557cda3eb1a565b785 /spec/controllers/general_controller_spec.rb | |
parent | 498cbca64bf3e4075e74f110b1e02b47c39b45fc (diff) | |
parent | 05b8714c5f8d69c310f554d403a86a64781ee70a (diff) |
Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtk
Conflicts:
app/controllers/request_controller.rb
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index e1539fa68..2750a33f3 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -2,6 +2,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require 'fakeweb' describe GeneralController, "when trying to show the blog" do + before (:each) do + FakeWeb.clean_registry + end + after (:each) do + FakeWeb.clean_registry + end + it "should fail silently if the blog is returning an error" do FakeWeb.register_uri(:get, %r|.*|, :body => "Error", :status => ["500", "Error"]) get :blog @@ -28,6 +35,7 @@ describe GeneralController, "when searching" do before(:each) do load_raw_emails_data(raw_emails) + rebuild_xapian_index end it "should render the front page successfully" do @@ -84,30 +92,28 @@ describe GeneralController, "when searching" do describe "when using different locale settings" do home_link_regex = /href=".*\/en"/ it "should generate URLs with a locale prepended when there's more than one locale set" do - ActionController::Routing::Routes.add_filters('conditionallyprependlocale') get :frontpage response.should have_text(home_link_regex) end it "should generate URLs without a locale prepended when there's only one locale set" do - ActionController::Routing::Routes.add_filters('conditionallyprependlocale') - old_available_locales = FastGettext.default_available_locales - available_locales = ['en'] - FastGettext.default_available_locales = available_locales - I18n.available_locales = available_locales + old_fgt_available_locales = FastGettext.default_available_locales + old_i18n_available_locales = I18n.available_locales + FastGettext.default_available_locales = I18n.available_locales = ['en'] get :frontpage response.should_not have_text(home_link_regex) - FastGettext.default_available_locales = old_available_locales - I18n.available_locales = old_available_locales + FastGettext.default_available_locales = old_fgt_available_locales + I18n.available_locales = old_i18n_available_locales end end describe 'when using xapian search' do # rebuild xapian index after fixtures loaded - before(:all) do + before(:each) do + load_raw_emails_data(raw_emails) rebuild_xapian_index end |