Skip to content

Commit

Permalink
Add integration tests for mettings on private transparent assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
entantoencuanto committed Sep 7, 2021
1 parent 07f4d38 commit baf5af8
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions decidim-meetings/spec/system/live_meeting_access_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,62 @@ def visit_meeting
end
end
end

context "and the meeting belongs to an assembly which is a transparent private space" do
let(:assembly) { create(:assembly, :private, :transparent, organization: organization) }
let(:participatory_space) { assembly }
let(:admin) { create :user, :confirmed, :admin, organization: organization }
let(:private_user) { create :user, :confirmed, organization: organization }
let!(:assembly_private_user) { create :assembly_private_user, user: private_user, privatable_to: assembly }

context "and user is not signed in" do
it "doesn't show the meeting link embedded" do
visit_meeting

expect(page).to have_no_content("This meeting is happening right now")
expect(page).to have_no_css("iframe")
end
end

context "and user is signed in" do
before do
login_as user, scope: :user
end

it "doesn't show the meeting link embedded" do
visit_meeting

expect(page).to have_no_content("This meeting is happening right now")
expect(page).to have_no_css("iframe")
end
end

context "and private user is signed in" do
before do
login_as private_user, scope: :user
end

it "shows the meeting link embedded" do
visit_meeting

expect(page).to have_content("This meeting is happening right now")
expect(page).to have_css("iframe")
end
end

context "and admin user is signed in" do
before do
login_as admin, scope: :user
end

it "shows the meeting link embedded" do
visit_meeting

expect(page).to have_content("This meeting is happening right now")
expect(page).to have_css("iframe")
end
end
end
end
end

Expand Down

0 comments on commit baf5af8

Please sign in to comment.