]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/site_controller_test.rb
Merge remote-tracking branch 'upstream/pull/2381'
[rails.git] / test / controllers / site_controller_test.rb
index a798013dbe40e5a5b8e6ee6084a5cb824ad4cc7e..4dc07f9960a8613b43248d16d541ec28ac4f7aa0 100644 (file)
@@ -8,8 +8,6 @@ class SiteControllerTest < ActionController::TestCase
 
     Settings.id_key = create(:client_application).key
     Settings.potlatch2_key = create(:client_application).key
-
-    stub_hostip_requests
   end
 
   ##
@@ -54,6 +52,18 @@ class SiteControllerTest < ActionController::TestCase
       { :path => "/fixthemap", :method => :get },
       { :controller => "site", :action => "fixthemap" }
     )
+    assert_routing(
+      { :path => "/help", :method => :get },
+      { :controller => "site", :action => "help" }
+    )
+    assert_routing(
+      { :path => "/about", :method => :get },
+      { :controller => "site", :action => "about" }
+    )
+    assert_routing(
+      { :path => "/about/locale", :method => :get },
+      { :controller => "site", :action => "about", :about_locale => "locale" }
+    )
     assert_routing(
       { :path => "/export", :method => :get },
       { :controller => "site", :action => "export" }
@@ -409,6 +419,17 @@ class SiteControllerTest < ActionController::TestCase
     get :copyright
     assert_response :success
     assert_template "copyright"
+    assert_select "div[lang='en'][dir='ltr']"
+
+    get :copyright, :params => { :copyright_locale => "fr" }
+    assert_response :success
+    assert_template "copyright"
+    assert_select "div[lang='fr'][dir='ltr']"
+
+    get :copyright, :params => { :copyright_locale => "ar" }
+    assert_response :success
+    assert_template "copyright"
+    assert_select "div[lang='ar'][dir='rtl']"
   end
 
   # Test the welcome page
@@ -441,6 +462,17 @@ class SiteControllerTest < ActionController::TestCase
     get :about
     assert_response :success
     assert_template "about"
+    assert_select "div[lang='en'][dir='ltr']"
+
+    get :about, :params => { :about_locale => "fr" }
+    assert_response :success
+    assert_template "about"
+    assert_select "div[lang='fr'][dir='ltr']"
+
+    get :about, :params => { :about_locale => "ar" }
+    assert_response :success
+    assert_template "about"
+    assert_select "div[lang='ar'][dir='rtl']"
   end
 
   # Test the export page