-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Showing
3 changed files
with
11 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ class InvitationsControllerTest < ActionDispatch::IntegrationTest | |
assert_equal I18n.t("invitations.create.success"), flash[:notice] | ||
end | ||
|
||
test "non-admin cannot create admin invitation" do | ||
test "non-admin cannot create invitations" do | ||
sign_in users(:family_member) | ||
|
||
assert_difference("Invitation.count") do | ||
assert_no_difference("Invitation.count") do | ||
post invitations_url, params: { | ||
invitation: { | ||
email: "[email protected]", | ||
|
@@ -43,8 +43,8 @@ class InvitationsControllerTest < ActionDispatch::IntegrationTest | |
} | ||
end | ||
|
||
invitation = Invitation.last | ||
assert_equal "member", invitation.role # Role should be downgraded to member | ||
assert_redirected_to settings_profile_path | ||
assert_equal I18n.t("invitations.create.failure"), flash[:alert] | ||
end | ||
|
||
test "admin can create admin invitation" do | ||
|