Skip to content

Instantly share code, notes, and snippets.

@kenzotakahashi
Created July 30, 2016 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzotakahashi/d6e1d8fed12f09064f9d62f6fc01c12f to your computer and use it in GitHub Desktop.
Save kenzotakahashi/d6e1d8fed12f09064f9d62f6fc01c12f to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe User, type: :model do
describe ".is_gmail_user?" do
context "given a gmail address" do
it "returns true" do
user1 = User.new({email: 'kenzotakahashi@gmail.com'})
expect(user1.is_gmail_user?).to eql(true)
end
end
context "given a non-gmail address" do
it "returns false" do
user1 = User.new({email: 'kenzo@itandi.co.jp'})
expect(user1.is_gmail_user?).to eql(false)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment