Extract component for visible to valuators toggling

This commit is contained in:
Javi Martín
2024-10-06 18:04:44 +02:00
parent 958c13061f
commit 00d7299e9e
6 changed files with 34 additions and 20 deletions

View File

@@ -1,9 +0,0 @@
require "rails_helper"
describe Admin::BudgetInvestments::RowComponent, :admin do
it "uses a JSON request to update visible to valuators" do
render_inline Admin::BudgetInvestments::RowComponent.new(create(:budget_investment))
expect(page).to have_css "form[action$='json'] input[name$='[visible_to_valuators]']"
end
end

View File

@@ -0,0 +1,9 @@
require "rails_helper"
describe Admin::BudgetInvestments::ToggleVisibleToValuatorsComponent, :admin do
it "uses a JSON request to update visible to valuators" do
render_inline Admin::BudgetInvestments::ToggleVisibleToValuatorsComponent.new(create(:budget_investment))
expect(page).to have_css "form[action$='json'] input[name$='[visible_to_valuators]']"
end
end