Skip to content

Commit d9844d7

Browse files
committed
[*] Tests - Fix specs
1 parent b901b20 commit d9844d7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

spec/services/forest_liana/apimap_sorter_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ module ForestLiana
4242
id: 'animals',
4343
attributes: {
4444
fields: [
45-
{ 'is-sortable': false, field: 'id', 'is-filterable': false, type: 'Number' },
45+
{ is_sortable: false, field: 'id', is_filterable: false, type: 'Number' },
4646
{ type: 'Date', field: 'createdAt' },
4747
{ field: 'updatedAt', type: 'Date' },
4848
],
4949
name: 'animals',
5050
integration: 'close.io',
51-
'is-virtual': true,
51+
is_virtual: true,
5252
}
5353
}],
5454
'included': [{
@@ -66,16 +66,16 @@ module ForestLiana
6666
attributes: {
6767
name: 'import',
6868
fields: [{
69-
isRequired: true,
69+
is_required: true,
7070
type: 'Boolean',
7171
field: 'Save',
7272
description: 'save the import file if true.',
73-
defaultValue: 'true'
73+
default_value: 'true'
7474
}, {
7575
type: 'File',
7676
field: 'File'
7777
}],
78-
'http-method': nil
78+
http_method: nil
7979
}
8080
}, {
8181
attributes: {
@@ -95,7 +95,7 @@ module ForestLiana
9595
download: nil,
9696
endpoint: nil,
9797
redirect: nil,
98-
'http-method': nil
98+
'http_method': nil
9999
}
100100
}]
101101
}
@@ -120,7 +120,7 @@ module ForestLiana
120120
end
121121

122122
it 'should sort the data collections attributes values' do
123-
expect(apimap_sorted['data'][0]['attributes'].keys).to eq(['name', 'integration', 'is-virtual', 'fields'])
123+
expect(apimap_sorted['data'][0]['attributes'].keys).to eq(['name', 'integration', 'is_virtual', 'fields'])
124124
expect(apimap_sorted['data'][1]['attributes'].keys).to eq(['name', 'fields'])
125125
expect(apimap_sorted['data'][2]['attributes'].keys).to eq(['name', 'fields'])
126126
end
@@ -132,7 +132,7 @@ module ForestLiana
132132
end
133133

134134
it 'should sort the data collections attributes fields values' do
135-
expect(apimap_sorted['data'][0]['attributes']['fields'][1].keys).to eq(['field', 'type', 'is-filterable', 'is-sortable'])
135+
expect(apimap_sorted['data'][0]['attributes']['fields'][1].keys).to eq(['field', 'type', 'is_filterable', 'is_sortable'])
136136
end
137137

138138
it 'should sort the included actions and segments objects' do
@@ -148,8 +148,8 @@ module ForestLiana
148148
end
149149

150150
it 'should sort the included actions and segments objects attributes values' do
151-
expect(apimap_sorted['included'][0]['attributes'].keys).to eq(['name', 'download', 'endpoint', 'global', 'http-method', 'redirect'])
152-
expect(apimap_sorted['included'][1]['attributes'].keys).to eq(['name', 'http-method', 'fields'])
151+
expect(apimap_sorted['included'][0]['attributes'].keys).to eq(['name', 'endpoint', 'http_method', 'redirect', 'download'])
152+
expect(apimap_sorted['included'][1]['attributes'].keys).to eq(['name', 'http_method', 'fields'])
153153
expect(apimap_sorted['included'][2]['attributes'].keys).to eq(['name'])
154154
expect(apimap_sorted['included'][3]['attributes'].keys).to eq(['name'])
155155
end
@@ -159,7 +159,7 @@ module ForestLiana
159159
end
160160

161161
it 'should sort the included action fields values' do
162-
expect(apimap_sorted['included'][1]['attributes']['fields'][1].keys).to eq(['field', 'type', 'defaultValue', 'description', 'isRequired'])
162+
expect(apimap_sorted['included'][1]['attributes']['fields'][1].keys).to eq(['field', 'type', 'default_value', 'is_required', 'description'])
163163
end
164164

165165
it 'should sort the meta values' do

0 commit comments

Comments
 (0)