Skip to content

Commit

Permalink
Fix email db seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvc committed Oct 27, 2020
1 parent e259244 commit 77cd657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions models/fixtures/email_address.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-
id: 1
uid: 1
email: user11@example.com
email: user1-1@example.com
is_activated: false

-
id: 2
uid: 1
email: user12@example.com
email: user1-2@example.com
is_activated: false

-
Expand All @@ -19,7 +19,7 @@
-
id: 4
uid: 2
email: user21@example.com
email: user2-1@example.com
is_activated: false

-
Expand Down
12 changes: 6 additions & 6 deletions models/user_mail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestIsEmailUsed(t *testing.T) {

isExist, _ := IsEmailUsed("")
assert.True(t, isExist)
isExist, _ = IsEmailUsed("user11@example.com")
isExist, _ = IsEmailUsed("user1-1@example.com")
assert.True(t, isExist)
isExist, _ = IsEmailUsed("user1234567890@example.com")
assert.False(t, isExist)
Expand Down Expand Up @@ -84,12 +84,12 @@ func TestDeleteEmailAddress(t *testing.T) {
assert.NoError(t, DeleteEmailAddress(&EmailAddress{
UID: int64(1),
ID: int64(1),
Email: "user11@example.com",
Email: "user1-1@example.com",
}))

assert.NoError(t, DeleteEmailAddress(&EmailAddress{
UID: int64(1),
Email: "user12@example.com",
Email: "user1-2@example.com",
}))

// Email address does not exist
Expand All @@ -112,7 +112,7 @@ func TestDeleteEmailAddresses(t *testing.T) {
}
emails[1] = &EmailAddress{
UID: int64(2),
Email: "user21@example.com",
Email: "user2-1@example.com",
}
assert.NoError(t, DeleteEmailAddresses(emails))

Expand All @@ -132,7 +132,7 @@ func TestMakeEmailPrimary(t *testing.T) {
assert.Equal(t, ErrEmailNotExist.Error(), err.Error())

email = &EmailAddress{
Email: "user11@example.com",
Email: "user1-1@example.com",
}
err = MakeEmailPrimary(email)
assert.Error(t, err)
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestActivate(t *testing.T) {
email := &EmailAddress{
ID: int64(1),
UID: int64(1),
Email: "user11@example.com",
Email: "user1-1@example.com",
}
assert.NoError(t, email.Activate())

Expand Down

0 comments on commit 77cd657

Please sign in to comment.