Skip to content

Commit 45a3a42

Browse files
committed
Fix specs by matching header names case-insensitively
1 parent 64040fe commit 45a3a42

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/features/swagger_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@
5151
find_by_id('endpointListTogger_headers', visible: true).click
5252
first('span[class="http_method"] a', visible: true).click
5353
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
5555
expect(page).to have_css 'span.hljs-string', text: 'Test Value'
5656
end
5757

5858
it 'supports multiple headers' do
5959
find_by_id('endpointListTogger_headers', visible: true).click
6060
first('span[class="http_method"] a', visible: true).click
6161
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
6363
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
6565
expect(page).to have_css 'span.hljs-string', text: 'Another Value'
6666
end
6767
end
@@ -108,7 +108,7 @@
108108
find_by_id('endpointListTogger_headers', visible: true).click
109109
first('span[class="http_method"] a', visible: true).click
110110
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
112112
expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}"
113113
end
114114
end
@@ -127,7 +127,7 @@
127127
find_by_id('endpointListTogger_headers', visible: true).click
128128
first('span[class="http_method"] a', visible: true).click
129129
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
131131
expect(page).to have_css 'span.hljs-string', text: 'Bearer token'
132132
end
133133
end
@@ -146,7 +146,7 @@
146146
find_by_id('endpointListTogger_headers', visible: true).click
147147
first('span[class="http_method"] a', visible: true).click
148148
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
150150
expect(page).to have_css 'span.hljs-string', text: 'Token token'
151151
end
152152
end

0 commit comments

Comments
 (0)