Skip to content

Commit

Permalink
Display past blocks button on accounts block page
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Jan 20, 2025
1 parent 8d318b7 commit b1bcebd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/views/accounts/blocks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
<% end %>

<p><%= t ".no_active_blocks" %></p>

<% if current_user.blocks.exists? %>
<div class="mb-3">
<%= link_to t(".review_button"), user_received_blocks_path(current_user), :class => "btn btn-outline-primary" %>
</div>
<% end %>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ en:
index:
title: Blocks on Me
no_active_blocks: There are no active blocks on your account.
review_button: Review past blocks
deletions:
show:
title: Delete My Account
Expand Down
4 changes: 4 additions & 0 deletions test/controllers/accounts/blocks_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_index_not_blocked
assert_response :success
assert_dom "#content > .content-body" do
assert_dom "p", :text => /no active blocks/
assert_dom "a", :text => "Review past blocks", :count => 0
end
end

Expand All @@ -36,6 +37,9 @@ def test_index_with_inactive_block
assert_response :success
assert_dom "#content > .content-body" do
assert_dom "p", :text => /no active blocks/
assert_dom "a", :text => "Review past blocks" do
assert_dom "> @href", user_received_blocks_path(user)
end
end
end

Expand Down

0 comments on commit b1bcebd

Please sign in to comment.