main
1# frozen_string_literal: true
2
3require 'spec_helper'
4
5RSpec.describe Del::User do
6 describe '.map_from' do
7 subject { described_class }
8 let(:attributes) { { 'jid' => SecureRandom.uuid } }
9
10 it 'returns a new user' do
11 result = subject.map_from(attributes)
12 expect(result).to be_instance_of(described_class)
13 expect(result.jid).to eql(attributes['jid'])
14 expect(result.attributes).to eql(attributes)
15 end
16
17 specify { expect(subject.map_from(nil)).to be_nil }
18 end
19end