Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Sep 10, 2024
1 parent 1d6bace commit 78cbdc0
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require "spec_helper"

describe Decidim::Privacy::Admin::CreateParticipatorySpacePrivateUserExtensions do
subject { Decidim::Admin::CreateParticipatorySpacePrivateUser.new(form, current_user, privatable_to, via_csv:) }

let!(:via_csv) { false }
let!(:privatable_to) { create(:participatory_process) }
let!(:email) { "[email protected]" }
let!(:name) { "Weird Guy" }
let!(:user) { create(:user, email: "[email protected]", organization: privatable_to.organization) }
let!(:current_user) { create(:user, email: "[email protected]", organization: privatable_to.organization) }
let!(:form) do
double(
invalid?: invalid,
delete_current_private_participants?: delete,
email:,
current_user:,
name:
)
end
let(:delete) { false }
let(:invalid) { false }

it "finds private users" do
expect(subject.send(:existing_user)).to eq(user)
end
end

0 comments on commit 78cbdc0

Please sign in to comment.