Fix link in error page when a user has public edits disabled
This commit is contained in:
parent
aab9473f69
commit
9153fd3559
2 changed files with 9 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
||||||
<p><%= t "layouts.osm_read_only" %></p>
|
<p><%= t "layouts.osm_read_only" %></p>
|
||||||
<% elsif !current_user.data_public? %>
|
<% elsif !current_user.data_public? %>
|
||||||
<p><%= t ".not_public" %></p>
|
<p><%= t ".not_public" %></p>
|
||||||
<p><%= raw t ".not_public_description", :user_page => (link_to t(".user_page_link"), :controller => "user", :action => "account", :display_name => current_user.display_name, :anchor => "public") %></p>
|
<p><%= raw t ".not_public_description", :user_page => (link_to t(".user_page_link"), user_path(current_user, :anchor => "public")) %></p>
|
||||||
<p><%= raw t "site.edit.anon_edits", :link => link_to(t(".anon_edits_link_text"), t(".anon_edits_link")) %></p>
|
<p><%= raw t "site.edit.anon_edits", :link => link_to(t(".anon_edits_link_text"), t(".anon_edits_link")) %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render :partial => preferred_editor %>
|
<%= render :partial => preferred_editor %>
|
||||||
|
|
|
@ -170,6 +170,14 @@ class SiteControllerTest < ActionController::TestCase
|
||||||
assert_redirected_to :controller => :users, :action => :login, :referer => "/edit"
|
assert_redirected_to :controller => :users, :action => :login, :referer => "/edit"
|
||||||
end
|
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
|
# Test the right editor gets used when the user hasn't set a preference
|
||||||
def test_edit_without_preference
|
def test_edit_without_preference
|
||||||
get :edit, :session => { :user => create(:user) }
|
get :edit, :session => { :user => create(:user) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue