]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/site_controller_test.rb
Use list-inline to achieve spacing between elements on a line
[rails.git] / test / controllers / site_controller_test.rb
index 77b07db7d53c9cc281113aa642f8fb01845235f9..6f6e7dcfa886c9af85a713029d104a51437c6f60 100644 (file)
@@ -7,14 +7,12 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
     super
 
     Settings.id_key = create(:client_application).key
-    Settings.potlatch2_key = create(:client_application).key
   end
 
   ##
   # clear oauth keys
   def teardown
     Settings.id_key = nil
-    Settings.potlatch2_key = nil
   end
 
   ##
@@ -180,7 +178,7 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
     get edit_path
 
     assert_response :redirect
-    assert_redirected_to :controller => :users, :action => :login, :referer => "/edit"
+    assert_redirected_to login_path(:referer => "/edit")
   end
 
   # Test the error when trying to edit without public edits
@@ -275,8 +273,8 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_template "edit"
-    assert_equal 1.0, assigns(:lat)
-    assert_equal 1.0, assigns(:lon)
+    assert_in_delta(1.0, assigns(:lat))
+    assert_in_delta(1.0, assigns(:lon))
     assert_equal 18, assigns(:zoom)
   end
 
@@ -312,8 +310,8 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
     get edit_path(:way => way.id)
     assert_response :success
     assert_template "edit"
-    assert_equal 3.0, assigns(:lat)
-    assert_equal 3.0, assigns(:lon)
+    assert_in_delta(3.0, assigns(:lat))
+    assert_in_delta(3.0, assigns(:lon))
     assert_equal 17, assigns(:zoom)
   end
 
@@ -349,8 +347,8 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
     get edit_path(:note => note.id)
     assert_response :success
     assert_template "edit"
-    assert_equal 1.0, assigns(:lat)
-    assert_equal 1.0, assigns(:lon)
+    assert_in_delta(1.0, assigns(:lat))
+    assert_in_delta(1.0, assigns(:lon))
     assert_equal 17, assigns(:zoom)
   end
 
@@ -386,8 +384,8 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
     get edit_path(:gpx => gpx.id)
     assert_response :success
     assert_template "edit"
-    assert_equal 1.0, assigns(:lat)
-    assert_equal 1.0, assigns(:lon)
+    assert_in_delta(1.0, assigns(:lat))
+    assert_in_delta(1.0, assigns(:lon))
     assert_equal 16, assigns(:zoom)
   end
 
@@ -454,7 +452,7 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
   def test_welcome
     get welcome_path
     assert_response :redirect
-    assert_redirected_to :controller => :users, :action => :login, :referer => "/welcome"
+    assert_redirected_to login_path(:referer => "/welcome")
 
     session_for(create(:user))
     get welcome_path