forest_liana 9.4.0 → 9.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 855ec9302b2f8b3c54c16efb2919b9324c22feecaa132a02075914478ae3b040
4
- data.tar.gz: eb8275f28303c3b76a95460854037be8f619a8fa74541a91dd80128fb3e49457
3
+ metadata.gz: 30304717828c9052079569a8d955913fb634760dded796df1135fe826831e62b
4
+ data.tar.gz: 57ce0d28c56e813ea44eab5a8ac7f98e50bc4733b43fd48a2fa3828f4eabe65e
5
5
  SHA512:
6
- metadata.gz: 7e140338ed979e85df67414887d3fc986b0eb58abe88649dcdc140b565f43b5e72f788d3952213e3c82ff5057b23b5c63bd3543be7279f534f77893efc3b1179
7
- data.tar.gz: ec56a023d16948a3a21736b43ae89f3ab0cf5a9bec456b2a34d90299ceefdf9b0e0d9809d938e40f88e8bae30d7ce96cc63f8334ab0124bd95943d730e3aa999
6
+ metadata.gz: abe0a8db51a9015fa7f73ed62b815c5f7e282cb720169395358d9055c05bd36320268c65951504873bb1767630d5ebf5266725a67563b350f43fe014555f90d8
7
+ data.tar.gz: d2969b08d6810fa39985663f879099b224c41c65d7282cbb0b81813c205b5857c6400c82e744d55eb2d55f0e882670eeb2435e5eb649790498bc25fe984b743f
@@ -29,8 +29,9 @@ module ForestLiana
29
29
  end
30
30
 
31
31
  if context_variable_key.start_with?(USER_VALUE_TAG_PREFIX)
32
+ tag_key = context_variable_key[USER_VALUE_TAG_PREFIX.length..]
32
33
  user['tags'].each do |tag|
33
- return tag[context_variable_key[USER_VALUE_TAG_PREFIX.length..]] if tag.key?(context_variable_key[USER_VALUE_TAG_PREFIX.length..])
34
+ return tag['value'] if tag['key'] == tag_key
34
35
  end
35
36
  end
36
37
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.4.0"
2
+ VERSION = "9.4.2"
3
3
  end
@@ -10,7 +10,7 @@ module ForestLiana
10
10
  'lastName' => 'Doe',
11
11
  'fullName' => 'John Doe',
12
12
  'email' => 'john.doe@domain.com',
13
- 'tags' => [{ 'planet' => 'Death Star' }],
13
+ 'tags' => [{'key' => 'planet', 'value' => 'Death Star' }],
14
14
  'roleId' => 1,
15
15
  'permissionLevel' => 'admin'
16
16
  }
@@ -87,7 +87,7 @@ module ForestLiana
87
87
  { key: 'id', expected_value: user['id'] },
88
88
  { key: 'permissionLevel', expected_value: user['permissionLevel'] },
89
89
  { key: 'roleId', expected_value: user['roleId'] },
90
- { key: 'tags.planet', expected_value: user['tags'][0]['planet'] },
90
+ { key: 'tags.planet', expected_value: user['tags'][0]['value'] },
91
91
  { key: 'team.id', expected_value: team['id'] },
92
92
  { key: 'team.name', expected_value: team['name'] }
93
93
  ].each do |value|
@@ -35,9 +35,24 @@ module ForestLiana
35
35
  it 'returns the corresponding value from the key provided of the user data' do
36
36
  context_variables = described_class.new(team, user, request_context_variables)
37
37
  expect(context_variables.get_value('currentUser.first_name')).to eq('John')
38
- expect(context_variables.get_value('currentUser.tags.key')).to eq('tag1')
38
+ expect(context_variables.get_value('currentUser.tags.tag1')).to eq('value1')
39
39
  expect(context_variables.get_value('currentUser.team.id')).to eq(1)
40
40
  end
41
+
42
+ it 'returns nil when the user key does not exist' do
43
+ context_variables = described_class.new(team, user, request_context_variables)
44
+ expect(context_variables.get_value('currentUser.non_existent_key')).to eq(nil)
45
+ end
46
+
47
+ it 'returns nil when the tag key does not exist' do
48
+ context_variables = described_class.new(team, user, request_context_variables)
49
+ expect(context_variables.get_value('currentUser.tags.non_existent_tag')).to eq(nil)
50
+ end
51
+
52
+ it 'returns nil when the request context variable key does not exist' do
53
+ context_variables = described_class.new(team, user, request_context_variables)
54
+ expect(context_variables.get_value('non_existent_key')).to eq(nil)
55
+ end
41
56
  end
42
57
  end
43
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.4.0
4
+ version: 9.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2024-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 6.1.7.9
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: 6.1.7.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: forestadmin-jsonapi-serializers
29
29
  requirement: !ruby/object:Gem::Requirement