Skip to content

Commit 780e8a5

Browse files
committed
Fixed #68
1 parent 129d93b commit 780e8a5

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

lib/entitlements/data/groups/calculated/text.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def parsed_data
294294
result[key]["&="] ||= []
295295

296296
# Semicolon predicates
297-
if key == "description"
297+
if key == "description" || key.start_with?("metadata_")
298298
result[key][operator] << { key: val }
299299
else
300300
result[key][operator] << parsed_predicate(val)

spec/unit/entitlements/data/groups/calculated/text_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@
183183
expect(subject.metadata).to eq("kittens" => "awesome", "puppies" => "young dogs")
184184
end
185185

186-
it "raises an error if expiration is given to metadata" do
187-
filename = fixture("ldap-config/metadata/expiration.txt")
188-
message = "In #{filename}, the key metadata_kittens cannot have additional setting(s) \"expiration\"!"
189-
expect { described_class.new(filename: filename) }.to raise_error(message)
186+
it "does not raise an error when metadata values contain semicolons" do
187+
filename = fixture("ldap-config/metadata/semicolon.txt")
188+
expect { described_class.new(filename: filename) }.not_to raise_error
189+
subject = described_class.new(filename: filename)
190+
expect(subject.metadata).to eq("kittens" => "awesome", "justification" => "Need access; for project work")
190191
end
191192
end
192193

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description = Lots of metadata here
2+
username = BlackManx
3+
username = RAGAMUFFIn
4+
metadata_kittens = awesome
5+
metadata_justification = Need access; for project work

0 commit comments

Comments
 (0)