- | <%= link_to "#{content_block.name} (#{content_block.locale})", edit_admin_site_customization_content_block_path(content_block) %> |
+ <%= "#{content_block.name} (#{content_block.locale})" %> |
<%= raw content_block.body %> |
- <%= render Admin::TableActionsComponent.new(content_block, actions: [:destroy]) %>
+ <%= render Admin::TableActionsComponent.new(content_block) %>
|
<% end %>
<% @headings_content_blocks.each do |content_block| %>
- | <%= link_to "#{content_block.name} (#{content_block.locale})", admin_site_customization_edit_heading_content_block_path(content_block) %> |
+ <%= "#{content_block.name} (#{content_block.locale})" %> |
<%= raw content_block.body %> |
<%= render Admin::TableActionsComponent.new(
content_block,
- actions: [:destroy],
+ edit_path: admin_site_customization_edit_heading_content_block_path(content_block),
destroy_path: admin_site_customization_delete_heading_content_block_path(content_block)
) %>
|
diff --git a/spec/system/admin/site_customization/content_blocks_spec.rb b/spec/system/admin/site_customization/content_blocks_spec.rb
index abbefc138..012fc28ee 100644
--- a/spec/system/admin/site_customization/content_blocks_spec.rb
+++ b/spec/system/admin/site_customization/content_blocks_spec.rb
@@ -2,13 +2,19 @@ require "rails_helper"
describe "Admin custom content blocks", :admin do
scenario "Index" do
- block = create(:site_customization_content_block)
- heading_block = create(:heading_content_block)
+ block = create(:site_customization_content_block, name: "top_links")
+ heading_block = create(:heading_content_block, heading: create(:budget_heading, name: "Reforestation"))
visit admin_site_customization_content_blocks_path
- expect(page).to have_content(block.name)
+ within "tr", text: "top_links" do
+ expect(page).to have_link "Edit"
+ end
+
+ within "tr", text: "Reforestation" do
+ expect(page).to have_link "Edit"
+ end
+
expect(page).to have_content(block.body)
- expect(page).to have_content(heading_block.heading.name)
expect(page).to have_content(heading_block.body)
end
@@ -73,7 +79,7 @@ describe "Admin custom content blocks", :admin do
click_link "Custom content blocks"
end
- click_link "top_links (en)"
+ within("tr", text: "top_links (en)") { click_link "Edit" }
fill_in "site_customization_content_block_body", with: "Some other custom content"
click_button "Update Custom content block"