aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/general_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:46:57 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:46:57 +0100
commit6c4c822ef7a4491bf821326af779e5be9118c0a1 (patch)
tree39cf3564b1b2fb6be26499eda2a41be7ba59ad65 /spec/controllers/general_controller_spec.rb
parentea977a0b9e86bc99a84de8577fa4ce1d304ac489 (diff)
parent08dac0261325cd757b7146f9626f3c7b48cc672c (diff)
Merge branch 'release/0.6'0.6
Conflicts: locale/bs/app.po locale/ca/app.po locale/cs/app.po locale/cy/app.po locale/de/app.po locale/en_IE/app.po locale/es/app.po locale/eu/app.po locale/fr/app.po locale/ga_IE/app.po locale/gl/app.po locale/hu_HU/app.po locale/id/app.po locale/pt_BR/app.po locale/sq/app.po locale/sr@latin/app.po spec/fixtures/locale/en/app.po
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r--spec/controllers/general_controller_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 81f4ed6d5..df2c139bd 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -77,12 +77,34 @@ describe GeneralController, "when searching" do
end
describe "when using different locale settings" do
- home_link_regex = /href=".*\/en"/
+ home_link_regex = /href=".*\/en\//
it "should generate URLs with a locale prepended when there's more than one locale set" do
get :frontpage
response.should have_text(home_link_regex)
end
+ it "should use our test PO files rather than the application one" do
+ I18n.default_locale = :es
+ get :frontpage
+ response.should have_text(/XOXO/)
+ I18n.default_locale = :en
+ end
+
+ it "should generate URLs that include the locale when using one that includes an underscore" do
+ I18n.default_locale = :"en_GB"
+ get :frontpage
+ response.should have_text(/href="\/en_GB\//)
+ I18n.default_locale = :en
+ end
+
+ it "should fall back to the language if the territory is unknown" do
+ I18n.default_locale = :"en_US"
+ get :frontpage
+ response.should have_text(/href="\/en\//)
+ response.should_not have_text(/href="\/en_US\//)
+ I18n.default_locale = :en
+ end
+
it "should generate URLs without a locale prepended when there's only one locale set" do
old_fgt_available_locales = FastGettext.default_available_locales
old_i18n_available_locales = I18n.available_locales
@@ -215,5 +237,10 @@ describe GeneralController, "when searching" do
assigns[:xapian_users].results.map{|x|x[:model]}.should == [u]
end
+ it "should show tracking links for requests-only searches" do
+ get :search, :combined => ['"bob"', "requests"]
+ response.body.should include('Track this search')
+ end
+
end