Skip to content

Commit

Permalink
fix: Rails 7.1 compatiblity in specs
Browse files Browse the repository at this point in the history
Rails 7.1 returns headers in lower case that broke the tests. This fix
always converts headers to downcase.
  • Loading branch information
jgraichen committed Apr 18, 2024
1 parent 892855b commit c44098d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/responders/paginate_responder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,21 @@
describe 'headers' do
subject do
action.call
response.headers.to_h
response.headers.to_h.transform_keys(&:downcase)
end

it { is_expected.to include 'X-Total-Pages' => '14' }
it { is_expected.to include 'X-Total-Count' => '676' }
it { is_expected.to include 'X-Per-Page' => '50' }
it { is_expected.to include 'X-Current-Page' => '1' }
it { is_expected.to include 'x-total-pages' => '14' }
it { is_expected.to include 'x-total-count' => '676' }
it { is_expected.to include 'x-per-page' => '50' }
it { is_expected.to include 'x-current-page' => '1' }

context 'when method is HEAD' do
let(:method) { :head }

it { is_expected.to include 'X-Total-Pages' => '14' }
it { is_expected.to include 'X-Total-Count' => '676' }
it { is_expected.to include 'X-Per-Page' => '50' }
it { is_expected.to include 'X-Current-Page' => '1' }
it { is_expected.to include 'x-total-pages' => '14' }
it { is_expected.to include 'x-total-count' => '676' }
it { is_expected.to include 'x-per-page' => '50' }
it { is_expected.to include 'x-current-page' => '1' }
end
end
end

0 comments on commit c44098d

Please sign in to comment.