-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix issue #6847
- Loading branch information
Showing
3 changed files
with
57 additions
and
28 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 |
---|---|---|
|
@@ -305,6 +305,13 @@ | |
alice.email = "somebody@anywhere" | ||
expect(alice).not_to be_valid | ||
end | ||
|
||
it "resets a matching unconfirmed_email on save" do | ||
eve.update_attribute :unconfirmed_email, "[email protected]" | ||
alice.update_attribute :email, "[email protected]" | ||
eve.reload | ||
expect(eve.unconfirmed_email).to eql(nil) | ||
end | ||
end | ||
|
||
describe "of unconfirmed_email" do | ||
|
@@ -316,11 +323,16 @@ | |
end | ||
|
||
it "does NOT require a unique unconfirmed_email address" do | ||
eve.update_attribute :unconfirmed_email, "new@email.com" | ||
alice.unconfirmed_email = "new@email.com" | ||
eve.update_attribute :unconfirmed_email, "new@example.com" | ||
alice.unconfirmed_email = "new@example.com" | ||
expect(alice).to be_valid | ||
end | ||
|
||
it "requires an unconfirmed_email address which is not another user's email address" do | ||
alice.unconfirmed_email = eve.email | ||
expect(alice).not_to be_valid | ||
end | ||
|
||
it "requires a valid unconfirmed_email address" do | ||
alice.unconfirmed_email = "somebody@anywhere" | ||
expect(alice).not_to be_valid | ||
|