forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fix to adding admin user as private user to a private process wit…
…h case-insensitive input
- Loading branch information
1 parent
1fb220b
commit 3cc2dd8
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -114,6 +114,21 @@ module Decidim::Admin | |
end | ||
end | ||
|
||
context "when email is input with case-insensitive letters" do | ||
let!(:admin) { create(:user, :admin, email: "[email protected]", organization: privatable_to.organization) } | ||
let!(:email) { "[email protected]" } | ||
|
||
it "still finds the user" do | ||
expect { subject.call }.to broadcast(:ok) | ||
|
||
participatory_space_private_users = Decidim::ParticipatorySpacePrivateUser.where(user: admin) | ||
participatory_space_admin = Decidim::User.where(email: "[email protected]") | ||
|
||
expect(participatory_space_private_users.count).to eq 1 | ||
expect(participatory_space_admin.first.admin?).to be true | ||
end | ||
end | ||
|
||
context "when the user has not accepted the invitation" do | ||
before do | ||
user.invite! | ||
|