<% set_title(changeset_index_title(params, current_user))
@heading = if params[:display_name]
- t("changesets.index.title_user_link_html", :user_link => link_to(params[:display_name], user_path(:display_name => params[:display_name])))
+ t("changesets.index.title_user_link_html", :user_link => link_to(params[:display_name], user_path(params[:display_name])))
else
@title
end %>
<%= t("users.show.my messages") %>
<span class='badge count-number'><%= number_with_delimiter(current_user.new_messages.size) %></span>
<% end %>
- <%= link_to t("users.show.my profile"), user_path(current_user), :class => "dropdown-item" %>
+ <%= link_to t("users.show.my profile"), current_user, :class => "dropdown-item" %>
<%= link_to t("users.show.my settings"), edit_account_path, :class => "dropdown-item" %>
<%= link_to t("users.show.my_preferences"), preferences_path, :class => "dropdown-item" %>
<div class="dropdown-divider"></div>
<% content_for :heading do %>
<h1><%= t ".heading", :user => @user.display_name %></h1>
<p><%= t ".subheading_html",
- :user => link_to(@user.display_name, user_path(@user)),
+ :user => link_to(@user.display_name, @user),
:submitted => tag.span(t(".subheading_submitted"), :class => "px-2 py-1 bg-primary bg-opacity-25"),
:commented => tag.span(t(".subheading_commented"), :class => "px-2 py-1 bg-white") %></p>
<% end %>
<h1><%= t ".title" %></h1>
<% end %>
-<p><%= t(".request_access_html", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, user_path(current_user))) %></p>
+<p><%= t(".request_access_html", :app_name => link_to(@token.client_application.name, @token.client_application.url), :user => link_to(current_user.display_name, current_user)) %></p>
<%= bootstrap_form_tag do |f| %>
<%= f.hidden_field :oauth_token, :value => @token.token %>
</fieldset>
<%= f.primary t(".save") %>
- <%= link_to t(".cancel"), user_path(current_user), :class => "btn btn-link" %>
+ <%= link_to t(".cancel"), current_user, :class => "btn btn-link" %>
<% end %>
<p>
<b><%= t ".user" %></b>
- <%= link_to(@redaction.user.display_name, user_path(@redaction.user)) %>
+ <%= link_to @redaction.user.display_name, @redaction.user %>
</p>
<div class="richtext text-break">
<b><%= t ".description" %></b>
<tr>
<td>
<%= user_thumbnail_tiny user %>
- <%= link_to user.display_name, user_path(user) %>
+ <%= link_to user.display_name, user %>
</td>
<td class="text-nowrap text-end">
<%= link_to t(".table.tbody.unmute"), user_mute_path(user), :method => :delete, :class => "btn btn-sm btn-primary" %>
<p>
<% if user.creation_ip %>
<%= t "users.index.summary_html",
- :name => link_to(user.display_name, user_path(user)),
+ :name => link_to(user.display_name, user),
:ip_address => link_to(user.creation_ip, :ip => user.creation_ip),
:date => l(user.created_at, :format => :friendly) %>
<% else %>
<%= t "users.index.summary_no_ip_html",
- :name => link_to(user.display_name, user_path(user)),
+ :name => link_to(user.display_name, user),
:date => l(user.created_at, :format => :friendly) %>
<% end %>
</p>
assert_response :success
assert_template "history"
assert_template :layout => "map"
- assert_select "h2", :text => "Changesets by #{user.display_name}", :count => 1
+ assert_select "h2", :text => "Changesets by #{user.display_name}", :count => 1 do
+ assert_select "a[href=?]", user_path(user)
+ end
assert_select "link[rel='alternate'][type='application/atom+xml']", :count => 1 do
assert_select "[href=?]", "http://www.example.com/user/#{ERB::Util.url_encode(user.display_name)}/history/feed"
end
get user_notes_path(first_user)
assert_response :success
+ assert_select ".content-heading a[href='#{user_path first_user}']", :text => first_user.display_name
assert_select "table.note_list tbody tr", :count => 1
get user_notes_path(second_user)
assert_response :success
+ assert_select ".content-heading a[href='#{user_path second_user}']", :text => second_user.display_name
assert_select "table.note_list tbody tr", :count => 1
get user_notes_path("non-existent")
end
end
+ def test_show
+ redaction = create(:redaction, :title => "tested-redaction")
+
+ get redaction_path(redaction)
+ assert_response :success
+ assert_dom "h1", :text => /tested-redaction/
+ assert_dom "a[href='#{user_path redaction.user}']", :text => redaction.user.display_name
+ end
+
def test_new
get new_redaction_path
assert_redirected_to login_path(:referer => new_redaction_path)
def test_index
user = create(:user)
- user.mutes.create(:subject => create(:user))
+ muted_user = create(:user)
+ user.mutes.create(:subject => muted_user)
session_for(user)
get user_mutes_path
assert_match "You have muted 1 User", @response.body
+ assert_dom "tr a[href='#{user_path muted_user}']", :text => muted_user.display_name
end
def test_create