From 8d318b7b222348bea9726d5c37904fdb026b06e3 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 20 Jan 2025 07:15:02 +0300 Subject: [PATCH] Display 'no active blocks' on accounts block page --- app/views/accounts/blocks/index.html.erb | 2 ++ config/locales/en.yml | 1 + test/controllers/accounts/blocks_controller_test.rb | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/app/views/accounts/blocks/index.html.erb b/app/views/accounts/blocks/index.html.erb index ea88046401..cf7458fb38 100644 --- a/app/views/accounts/blocks/index.html.erb +++ b/app/views/accounts/blocks/index.html.erb @@ -1,3 +1,5 @@ <% content_for :heading do %>

<%= t ".title" %>

<% end %> + +

<%= t ".no_active_blocks" %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 8dfb091195..e5d102feba 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -279,6 +279,7 @@ en: blocks: index: title: Blocks on Me + no_active_blocks: There are no active blocks on your account. deletions: show: title: Delete My Account diff --git a/test/controllers/accounts/blocks_controller_test.rb b/test/controllers/accounts/blocks_controller_test.rb index 43c28154cb..6088da383e 100644 --- a/test/controllers/accounts/blocks_controller_test.rb +++ b/test/controllers/accounts/blocks_controller_test.rb @@ -22,6 +22,9 @@ def test_index_not_blocked get account_blocks_path assert_response :success + assert_dom "#content > .content-body" do + assert_dom "p", :text => /no active blocks/ + end end def test_index_with_inactive_block @@ -31,6 +34,9 @@ def test_index_with_inactive_block get account_blocks_path assert_response :success + assert_dom "#content > .content-body" do + assert_dom "p", :text => /no active blocks/ + end end def test_index_with_unseen_block