This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added confirm email of foreign users for admin's
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
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
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 |
---|---|---|
|
@@ -258,6 +258,27 @@ def prevent_destroying | |
page.should have_content "Account exists since #{I18n.localize(@admin.created_at)}" | ||
end | ||
|
||
it "should be possible to set email-confirmed for any user" do | ||
@user_to_test = User.create(name: "Testerle", email: "[email protected]") | ||
@user_to_test.email_confirmed_at.should be_nil | ||
visit users_path | ||
page.should have_link "Confirm: [email protected]" | ||
click_link "Confirm: [email protected]" | ||
@user_to_test.reload.email_confirmed_at.should_not be_nil | ||
page.should have_content "Your e-mail is confirmed now" | ||
end | ||
|
||
it "should not be possible to confirm foreign emails if not admin" do | ||
@hacker = test_user 'Hacker', 'notsecret', 'Hacker' | ||
@user_to_test = User.create(name: "Testerle", email: "[email protected]") | ||
@user_to_test.email_confirmed_at.should be_nil | ||
visit signout_path | ||
sign_in_user name: 'Hacker', password: 'notsecret' | ||
visit confirm_email_user_path(@user_to_test._id, 'admin') | ||
@user_to_test.reload.email_confirmed_at.should be_nil | ||
page.should have_content "Token not found" | ||
end | ||
|
||
it "finds users using the search-form without JS" do | ||
test_user 'Hidden user', 'secret' | ||
visit users_path | ||
|
@@ -283,6 +304,7 @@ def prevent_destroying | |
assert page.all( '.user-location div' ).count == 0, "Should not show Google-map while search" | ||
end | ||
|
||
|
||
end | ||
|
||
end |