-
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.
- Loading branch information
1 parent
1d6bace
commit 78cbdc0
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...concerns/decidim/privacy/admin/create_participatory_space_private_user_extensions_spec.rb
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,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 |