Skip to content

Commit 8e81081

Browse files
committed
Create base_spec.rb
1 parent fe8c9b0 commit 8e81081

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

spec/base_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# frozen_string_literal: true
2+
3+
describe '#map_hash_elements_to_self' do
4+
context 'hash is nil' do
5+
it 'doesnt raise errors' do
6+
expect { @contact = MessageBird::Contact.new(nil) }.not_to raise_error
7+
end
8+
end
9+
10+
context 'hash is a contact' do
11+
before(:all) do
12+
@contact = MessageBird::Contact.new(
13+
'id' => '03dfc27855c3475b953d6200a1b7eaf7',
14+
'msisdn' => '+31600000000',
15+
'firstName' => 'John',
16+
'lastName' => 'Doe'
17+
)
18+
end
19+
20+
it 'contains an id' do
21+
expect(@contact.id).to be('03dfc27855c3475b953d6200a1b7eaf7')
22+
end
23+
24+
it 'contains a msisdn' do
25+
expect(@contact.msisdn).to be('+31600000000')
26+
end
27+
28+
it 'contains a first name' do
29+
expect(@contact.first_name).to be('John')
30+
end
31+
32+
it 'contains a last name' do
33+
expect(@contact.last_name).to be('Doe')
34+
end
35+
end
36+
end

0 commit comments

Comments
 (0)