-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix admin edit bug with official proposals
- Loading branch information
1 parent
78cbdc0
commit 67904c5
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
require "decidim/privacy/test/rspec_support/component" | ||
|
||
describe "Proposals" do | ||
include ComponentTestHelper | ||
|
||
let!(:organization) { create(:organization) } | ||
let!(:participatory_process) { create(:participatory_process, :with_steps, organization:) } | ||
let!(:user) { create(:user, :admin, :confirmed, organization:) } | ||
let!(:proposal) { create(:proposal, :official, :published, component:) } | ||
|
||
before do | ||
switch_to_host(organization.host) | ||
login_as user, scope: :user | ||
visit decidim_admin.root_path | ||
end | ||
|
||
context "when trying to edit an official proposal" do | ||
let!(:component) { create(:proposal_component, :with_creation_enabled, participatory_space: participatory_process) } | ||
|
||
it "lets the admin user to edit" do | ||
click_on "Processes" | ||
click_on participatory_process.title["en"] | ||
click_on "Proposals" | ||
expect(page).to have_content(proposal.title["en"]) | ||
within("a.action-icon--edit-proposal") do | ||
expect(page).to have_css('svg[aria-label="Edit proposal"]') | ||
end | ||
end | ||
end | ||
end |