Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validates uniqueness of email #590

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Arunthogadiya
Copy link

Corresponding Issue

#589


describe "uniqueness of email" do
let!(:existing_user) { create(:user, email: "[email protected]") }
it "validates the uniqueness of email" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -96,4 +96,12 @@
expect(user.acronyms).to eq "AS"
end
end

describe "uniqueness of email" do
let!(:existing_user) { create(:user, email: "[email protected]") }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -96,4 +96,12 @@
expect(user.acronyms).to eq "AS"
end
end

describe "uniqueness of email" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -74,4 +76,8 @@ def color
def acronyms
first_name[0] + last_name[0]
end

def unique_email_address?
return false if User.where(email: self.email).any?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/RedundantSelf: Redundant self detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants