[deploy] Show reactable username for reactable_type == User (#7527)
* Show reactable username for reactable_type == User * Add test for GET /internal/reports vomit reaction on user
This commit is contained in:
parent
527c98fa01
commit
ae4ba673c4
2 changed files with 12 additions and 1 deletions
|
|
@ -33,7 +33,7 @@
|
|||
</span>
|
||||
<span>
|
||||
<strong><%= reaction.reactable_type %>:</strong>
|
||||
<a href="<%= reaction.reactable.path %>"><%= reaction.reactable.title %></a>
|
||||
<a href="<%= reaction.reactable.path %>"><%= reaction.reactable_type == "User" ? reaction.reactable.username : reaction.reactable.title %></a>
|
||||
<% if reaction.reactable_type == "User" && reaction.reactable.banned %>
|
||||
<span class="badge badge-danger">Suspended</span>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ require "rails_helper"
|
|||
RSpec.describe "/internal/reports", type: :request do
|
||||
let(:feedback_message) { create(:feedback_message, :abuse_report) }
|
||||
let(:user) { create(:user) }
|
||||
let(:trusted_user) { create(:user, :trusted) }
|
||||
let(:admin) { create(:user, :super_admin) }
|
||||
|
||||
describe "GET /internal/reports" do
|
||||
|
|
@ -15,6 +16,16 @@ RSpec.describe "/internal/reports", type: :request do
|
|||
expect(response.status).to eq 200
|
||||
end
|
||||
end
|
||||
|
||||
context "when there is a vomit reaction on a user" do
|
||||
it "renders with status 200" do
|
||||
trusted_user
|
||||
create(:reaction, category: "vomit", reactable: user, user: trusted_user)
|
||||
sign_in admin
|
||||
get internal_reports_path
|
||||
expect(response.status).to eq 200
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /save_status" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue