Sha256: 957f9e6d7055e4227e7015fd2d5a7cd16067b361dc0218d3108bfe900d793a11

Contents?: true

Size: 670 Bytes

Versions: 9

Compression:

Stored size: 670 Bytes

Contents

require 'rails_helper'

module ApiUserAuth
  RSpec.describe AuthUser, type: :model do
    context 'AuthUserHelper' do
      context '#create_by_params' do

        it 'Valid' do
          expect(AuthUser.count).to eq(0)
          AuthUser.create_by_params(
              email: 'user@mail.com',
              password: '123456'
          )
          expect(AuthUser.count).to eq(1)
        end

        it 'Invalid' do
          expect(AuthUser.count).to eq(0)
          expect { AuthUser.create_by_params(email: '', password: '') }.
            to raise_error(Exceptions::WrongParams)
          expect(AuthUser.count).to eq(0)
        end

      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
api_user_auth-0.1.9 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.8 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.7 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.6 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.5 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.4 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.2 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.1 spec/models/api_user_auth/auth_user_spec.rb
api_user_auth-0.1.0 spec/models/api_user_auth/auth_user_spec.rb