Skip to content

Commit

Permalink
Unify can not comment as a moderator specs
Browse files Browse the repository at this point in the history
  • Loading branch information
taitus committed Mar 25, 2024
1 parent ac740f3 commit 79d00e7
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 68 deletions.
6 changes: 0 additions & 6 deletions spec/system/comments/budget_investments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
end
end
end

scenario "can not comment as a moderator", :admin do
visit budget_investment_path(investment.budget, investment)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
Expand Down
8 changes: 0 additions & 8 deletions spec/system/comments/debates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@
expect(page).to have_button "Publish comment", disabled: false
end

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
visit debate_path(debate)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
8 changes: 0 additions & 8 deletions spec/system/comments/legislation_annotations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
expect(page).to have_button "Publish comment", disabled: false
end

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
visit polymorphic_path(annotation)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
8 changes: 0 additions & 8 deletions spec/system/comments/legislation_questions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
expect(page).to have_button "Publish answer", disabled: false
end

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
visit legislation_process_question_path(question.process, question)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
8 changes: 0 additions & 8 deletions spec/system/comments/polls_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
let(:user) { create(:user) }
let(:poll) { create(:poll, author: create(:user)) }

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
visit poll_path(poll)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
8 changes: 0 additions & 8 deletions spec/system/comments/proposals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@

it_behaves_like "flaggable", :proposal_comment

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
visit proposal_path(proposal)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
22 changes: 0 additions & 22 deletions spec/system/comments/topics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@

it_behaves_like "flaggable", :topic_with_community_comment

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
community = proposal.community
topic = create(:topic, community: community)

visit community_topic_path(community, topic)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down Expand Up @@ -118,17 +107,6 @@
let(:user) { create(:user) }
let(:investment) { create(:budget_investment) }

describe "Administrators" do
scenario "can not comment as a moderator", :admin do
community = investment.community
topic = create(:topic, community: community)

visit community_topic_path(community, topic)

expect(page).not_to have_content "Comment as moderator"
end
end

describe "Voting comments" do
let(:verified) { create(:user, verified_at: Time.current) }
let(:unverified) { create(:user) }
Expand Down
6 changes: 6 additions & 0 deletions spec/system/comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,12 @@
expect(page).not_to have_css "#js-comment-form-comment_#{comment.id}"
end
end

scenario "can not comment as a moderator", :admin do
visit polymorphic_path(resource)

expect(page).not_to have_content "Comment as moderator"
end
end

scenario "Errors on create" do
Expand Down

0 comments on commit 79d00e7

Please sign in to comment.