Skip to content

Commit e3122df

Browse files
author
Kevin Paulisse
committed
Implement an extra escape
1 parent 6caa0be commit e3122df

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

spec/octocatalog-diff/tests/catalog/puppetmaster_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@
101101
it 'should post the correct facts to HTTParty' do
102102
answer = JSON.parse(File.read(OctocatalogDiff::Spec.fixture_path('facts/facts_esc.json')))
103103
answer.delete('_timestamp')
104-
result = JSON.parse(@post_data['facts'])['values']
104+
# An extra 'unescape' is here because the facts are double escaped.
105+
# See https://docs.puppet.com/puppet/latest/http_api/http_catalog.html#parameters
106+
# and https://github.com/puppetlabs/puppet/pull/1818
107+
result = JSON.parse(CGI.unescape(@post_data['facts']))['values']
105108
expect(result).to eq(answer)
106109
end
107110

0 commit comments

Comments
 (0)