|
51 | 51 | find_by_id('endpointListTogger_headers', visible: true).click
|
52 | 52 | first('span[class="http_method"] a', visible: true).click
|
53 | 53 | click_button 'Try it out!'
|
54 |
| - expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' |
| 54 | + expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i |
55 | 55 | expect(page).to have_css 'span.hljs-string', text: 'Test Value'
|
56 | 56 | end
|
57 | 57 |
|
58 | 58 | it 'supports multiple headers' do
|
59 | 59 | find_by_id('endpointListTogger_headers', visible: true).click
|
60 | 60 | first('span[class="http_method"] a', visible: true).click
|
61 | 61 | click_button 'Try it out!'
|
62 |
| - expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header' |
| 62 | + expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i |
63 | 63 | expect(page).to have_css 'span.hljs-string', text: 'Test Value'
|
64 |
| - expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header' |
| 64 | + expect(page).to have_css 'span.hljs-attr', text: /X-Another-Header/i |
65 | 65 | expect(page).to have_css 'span.hljs-string', text: 'Another Value'
|
66 | 66 | end
|
67 | 67 | end
|
|
108 | 108 | find_by_id('endpointListTogger_headers', visible: true).click
|
109 | 109 | first('span[class="http_method"] a', visible: true).click
|
110 | 110 | click_button 'Try it out!'
|
111 |
| - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' |
| 111 | + expect(page).to have_css 'span.hljs-attr', text: /Authorization/i |
112 | 112 | expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}"
|
113 | 113 | end
|
114 | 114 | end
|
|
127 | 127 | find_by_id('endpointListTogger_headers', visible: true).click
|
128 | 128 | first('span[class="http_method"] a', visible: true).click
|
129 | 129 | click_button 'Try it out!'
|
130 |
| - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' |
| 130 | + expect(page).to have_css 'span.hljs-attr', text: /Authorization/i |
131 | 131 | expect(page).to have_css 'span.hljs-string', text: 'Bearer token'
|
132 | 132 | end
|
133 | 133 | end
|
|
146 | 146 | find_by_id('endpointListTogger_headers', visible: true).click
|
147 | 147 | first('span[class="http_method"] a', visible: true).click
|
148 | 148 | click_button 'Try it out!'
|
149 |
| - expect(page).to have_css 'span.hljs-attr', text: 'Authorization' |
| 149 | + expect(page).to have_css 'span.hljs-attr', text: /Authorization/i |
150 | 150 | expect(page).to have_css 'span.hljs-string', text: 'Token token'
|
151 | 151 | end
|
152 | 152 | end
|
|
171 | 171 |
|
172 | 172 | describe '#before_filter' do
|
173 | 173 | before do
|
174 |
| - allow(ActiveSupport::Deprecation).to receive(:warn) |
| 174 | + allow(GrapeSwaggerRails.deprecator).to receive(:warn) |
175 | 175 | end
|
176 | 176 |
|
177 | 177 | it 'throws deprecation warning' do
|
178 | 178 | GrapeSwaggerRails.options.before_filter { true }
|
179 | 179 |
|
180 |
| - expect(ActiveSupport::Deprecation).to have_received(:warn).with('This option is deprecated ' \ |
181 |
| - 'and going to be removed in 1.0.0. Please use `before_action` instead') |
| 180 | + expect(GrapeSwaggerRails.deprecator).to have_received(:warn).with( |
| 181 | + 'This option is deprecated and going to be removed in 1.0.0. ' \ |
| 182 | + 'Please use `before_action` instead' |
| 183 | + ) |
182 | 184 | end
|
183 | 185 | end
|
184 | 186 |
|
|
0 commit comments