X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7ccd11ebf3c8e119a04119a2e89ce6a879560578..9153fd3559bea49d29b44a27e6fb4123dd103c25:/test/controllers/site_controller_test.rb diff --git a/test/controllers/site_controller_test.rb b/test/controllers/site_controller_test.rb index a2ea86f6f..91fb83b67 100644 --- a/test/controllers/site_controller_test.rb +++ b/test/controllers/site_controller_test.rb @@ -4,6 +4,8 @@ class SiteControllerTest < ActionController::TestCase ## # setup oauth keys def setup + super + Settings.id_key = create(:client_application).key Settings.potlatch2_key = create(:client_application).key @@ -168,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) }