Skip to content

Commit

Permalink
Fix specs by matching header names case-insensitively
Browse files Browse the repository at this point in the history
  • Loading branch information
padde committed Sep 11, 2024
1 parent 64040fe commit 45a3a42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/features/swagger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i
expect(page).to have_css 'span.hljs-string', text: 'Test Value'
end

it 'supports multiple headers' do
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'X-Test-Header'
expect(page).to have_css 'span.hljs-attr', text: /X-Test-Header/i
expect(page).to have_css 'span.hljs-string', text: 'Test Value'
expect(page).to have_css 'span.hljs-attr', text: 'X-Another-Header'
expect(page).to have_css 'span.hljs-attr', text: /X-Another-Header/i
expect(page).to have_css 'span.hljs-string', text: 'Another Value'
end
end
Expand Down Expand Up @@ -108,7 +108,7 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
expect(page).to have_css 'span.hljs-string', text: "Basic #{Base64.encode64('username:password').strip}"
end
end
Expand All @@ -127,7 +127,7 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
expect(page).to have_css 'span.hljs-string', text: 'Bearer token'
end
end
Expand All @@ -146,7 +146,7 @@
find_by_id('endpointListTogger_headers', visible: true).click
first('span[class="http_method"] a', visible: true).click
click_button 'Try it out!'
expect(page).to have_css 'span.hljs-attr', text: 'Authorization'
expect(page).to have_css 'span.hljs-attr', text: /Authorization/i
expect(page).to have_css 'span.hljs-string', text: 'Token token'
end
end
Expand Down

0 comments on commit 45a3a42

Please sign in to comment.