Skip to content

Commit

Permalink
fix some tests, fix hide button
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Apr 15, 2024
1 parent 2829d7a commit 24e448f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% else %>
<%= cell("decidim/flag_modal", proposal, modal_id: "flagModal#{proposal.id}") %>
<button type="button" class="action-icon icon--small action-icon--show-proposal"
data-open="<%= current_user.present? ? "flagModal#{proposal.id}" : "loginModal" %>"
data-dialog-open="<%= current_user.present? ? "flagModal#{proposal.id}" : "loginModal" %>"
title="<%= t("report", scope: "decidim.proposals.admin.proposals.show") %>"
aria-controls="<%= current_user.present? ? "flagModal#{proposal.id}" : "loginModal" %>"
aria-haspopup="true"
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/admin/proposals_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ module Admin
context "when the user is not in the organization" do
let(:user) { create(:user, :confirmed, :admin) }

it_behaves_like "hide failure", "You are not authorized to perform this action"
it_behaves_like "hide failure", "You are not authorized to perform this action."
end

context "when the proposal is not in the organization" do
let(:user) { create(:user, :confirmed, :admin) }
let(:organization) { user.organization }

it_behaves_like "hide failure", "You are not authorized to perform this action"
it_behaves_like "hide failure", "You are not authorized to perform this action."
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def proposal_path(_options)

put :withdraw, params: params.merge(id: proposal.id)

expect(flash[:alert]).to eq("You are not authorized to perform this action")
expect(flash[:alert]).to eq("You are not authorized to perform this action.")
expect(response).to have_http_status(:found)
proposal.reload
expect(proposal.withdrawn?).to be false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module Proposals
describe "notification_title" do
it "is generated correctly" do
expect(subject.notification_title)
.to eq("The proposal <a href=\"#{resource_path}\">A nice proposal</a> has been added to #{participatory_space_title} by #{author.name} <a href=\"/profiles/#{author.nickname}\">@#{author.nickname}</a>")
.to eq("The proposal <a href=\"#{resource_path}\">A nice proposal</a> has been added to#{participatory_space_title} by #{author.name} <a href=\"/profiles/#{author.nickname}\">@#{author.nickname}</a>.")
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/system/admin/assign_valuators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@
it "has permission to access assigned" do
visit Decidim::EngineRouter.admin_proxy(component).proposal_path(proposal)
expect(page).to have_content(proposal.title["en"])
expect(page).to have_no_content("You are not authorized to perform this action")
expect(page).to have_no_content("You are not authorized to perform this action.")
end

it "has no permission to access" do
visit Decidim::EngineRouter.admin_proxy(component).proposal_path(another_proposal)
expect(page).to have_no_content(another_proposal.title["en"])
expect(page).to have_content("You are not authorized to perform this action")
expect(page).to have_content("You are not authorized to perform this action.")
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
click_link_or_button("button#js-submit-unassign-proposals-from-valuator")
end

expect(page).to have_content("You are not authorized to perform this action")
expect(page).to have_content("You are not authorized to perform this action.")
end
end

Expand Down

0 comments on commit 24e448f

Please sign in to comment.