From 45a3a42e038143b3aabb734207efd66f59650f86 Mon Sep 17 00:00:00 2001 From: Patrick Oscity Date: Wed, 11 Sep 2024 22:26:17 +0200 Subject: [PATCH] Fix specs by matching header names case-insensitively --- spec/features/swagger_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/features/swagger_spec.rb b/spec/features/swagger_spec.rb index ff2d3b3..34cbfc7 100644 --- a/spec/features/swagger_spec.rb +++ b/spec/features/swagger_spec.rb @@ -51,7 +51,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: '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 @@ -59,9 +59,9 @@ 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 @@ -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 @@ -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 @@ -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