|
38 | 38 | it { should contain_file(conf_file).without_content(%r{username: }) } |
39 | 39 | it { should contain_file(conf_file).without_content(%r{password: }) } |
40 | 40 | it { should contain_file(conf_file).without_content(%r{timeout: 1}) } |
| 41 | + it { should contain_file(conf_file).without_content(%r{data: }) } |
41 | 42 | it { should contain_file(conf_file).without_content(%{threshold: }) } |
42 | 43 | it { should contain_file(conf_file).without_content(%r{window: }) } |
43 | 44 | it { should contain_file(conf_file).without_content(%r{content_match: }) } |
|
61 | 62 | username: 'foouser', |
62 | 63 | password: 'barpassword', |
63 | 64 | timeout: 123, |
| 65 | + method: 'post', |
| 66 | + data: 'key=value', |
64 | 67 | threshold: 456, |
65 | 68 | window: 789, |
66 | 69 | content_match: 'foomatch', |
|
82 | 85 | it { should contain_file(conf_file).with_content(%r{username: foouser}) } |
83 | 86 | it { should contain_file(conf_file).with_content(%r{password: barpassword}) } |
84 | 87 | it { should contain_file(conf_file).with_content(%r{timeout: 123}) } |
| 88 | + it { should contain_file(conf_file).with_content(%r{method: post}) } |
| 89 | + it { should contain_file(conf_file).with_content(%r{data: key=value}) } |
85 | 90 | it { should contain_file(conf_file).with_content(%r{threshold: 456}) } |
86 | 91 | it { should contain_file(conf_file).with_content(%r{window: 789}) } |
87 | 92 | it { should contain_file(conf_file).with_content(%r{content_match: 'foomatch'}) } |
|
98 | 103 | it { should contain_file(conf_file).with_content(%r{ca_certs: /dev/null}) } |
99 | 104 | end |
100 | 105 |
|
| 106 | + context 'with json post data' do |
| 107 | + let(:params) {{ |
| 108 | + sitename: 'foo.bar.baz', |
| 109 | + url: 'http://foo.bar.baz:4096', |
| 110 | + method: 'post', |
| 111 | + data: ['key: value'], |
| 112 | + headers: ['Content-Type: application/json'], |
| 113 | + }} |
| 114 | + it { should contain_file(conf_file).with_content(%r{method: post}) } |
| 115 | + it { should contain_file(conf_file).with_content(/data:\s+key:\s+value/) } |
| 116 | + it { should contain_file(conf_file).with_content(/headers:\s+Content-Type:\s+application\/json/) } |
| 117 | + end |
| 118 | + |
101 | 119 | context 'with headers parameter array' do |
102 | 120 | let(:params) {{ |
103 | 121 | sitename: 'foo.bar.baz', |
|
0 commit comments