Sha256: addada6043d96f292308bd10b6be56ce57fde0504c0a2ec149f2241f65994739

Contents?: true

Size: 668 Bytes

Versions: 9

Compression:

Stored size: 668 Bytes

Contents

require 'rails_helper'

RSpec.describe Exposition::User, type: :model do
  it { should validate_presence_of(:email) }
  it { should validate_presence_of(:name) }
  it { should validate_presence_of(:password) }
  it { should validate_length_of(:name).is_at_most(50) }
  it { should validate_length_of(:email).is_at_most(244) }
  it { should validate_length_of(:password).is_at_least(6) }
  it { should validate_uniqueness_of(:email).case_insensitive }
  it { should allow_value('a@a.com', '12@12.c').for(:email) }
  it { should_not allow_value('a@a', '1', 'a.a').for(:email) }
  it { should have_db_index(:email).unique(true) }
  it { should have_secure_password }
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
exposition-0.0.5.7.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.6.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.5.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.4.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.2.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.1.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.5.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.4.pre.alpha spec/models/exposition/user_spec.rb
exposition-0.0.3.pre.alpha spec/models/exposition/user_spec.rb