File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments