Sha256: 44aaa66ec600992a4033ac0827e8c8ab4706d352161f90c4385eb49e44b03f65

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe User, type: :model do
  subject (:user) { User.new(email: 'mb@geemail.com', password: 'iwantabigmac1') }
  it 'is valid' do
    expect(user).to be_valid
  end

  describe '#associations' do
    it { is_expected.to respond_to(:email) }
    it { is_expected.to respond_to(:encrypted_password) }
  end

  describe 'validations' do
    describe '#email' do
      subject(:user) { User.new(password: 'iwantabigmac1') }

      it 'is required' do
        expect(user).to be_invalid
      end
    end

    describe '#password' do
      subject(:user) { User.new(email: 'mb@geemail.com')}

      it 'is required' do
        expect(user).to be_invalid
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-2fa-0.2.1 spec/models/user_spec.rb
devise-2fa-0.2.0 spec/models/user_spec.rb