]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/site_controller_test.rb
Fix link in error page when a user has public edits disabled
[rails.git] / test / controllers / site_controller_test.rb
index c7826062ba52ba7aca177f3b4412df75c5135510..91fb83b670ecfba59dd22ab12fe6e28a819b94ab 100644 (file)
@@ -170,6 +170,14 @@ class SiteControllerTest < ActionController::TestCase
     assert_redirected_to :controller => :users, :action => :login, :referer => "/edit"
   end
 
+  # Test the error when trying to edit without public edits
+  def test_edit_non_public
+    get :edit, :session => { :user => create(:user, :data_public => false) }
+    assert_response :success
+    assert_template "edit"
+    assert_select "a[href='https://wiki.openstreetmap.org/wiki/Disabling_anonymous_edits']"
+  end
+
   # Test the right editor gets used when the user hasn't set a preference
   def test_edit_without_preference
     get :edit, :session => { :user => create(:user) }