Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
laurajaime committed Oct 21, 2024
1 parent 1e28416 commit 40d162d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/system/admin/manage_reporting_proposals_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def edit_component_path(component)
Decidim::EngineRouter.admin_proxy(component.participatory_space).edit_component_path(component.id)
end

def component_path
Decidim::EngineRouter.admin_proxy(component.participatory_space).components_path(component.id)
end

before do
switch_to_host(organization.host)
login_as user, scope: :user
Expand Down Expand Up @@ -62,4 +66,20 @@ def edit_component_path(component)
expect(page).to have_unchecked_field("component_settings_proposal_photo_editing_enabled")
end
end

context "when managing proposals permissions" do
let!(:component) { create(:proposal_component, participatory_space: participatory_process) }

before do
visit component_path
within ".component-#{component.id}" do
click_on "Permissions"
end
end

it "show permissions" do
expect(page).to have_content("Edit permissions")
expect(page).to have_content("Endorse")
end
end
end

0 comments on commit 40d162d

Please sign in to comment.