Skip to content

Commit f8b52e3

Browse files
authored
Merge pull request #1917 from NikolayRys/test_fixes
Update access to rack constant
2 parents 87c88e4 + 5b5847f commit f8b52e3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#### Fixes
1212

1313
* Your contribution here.
14+
* [#1917](https://github.com/ruby-grape/grape/pull/1917): Update access to rack constant - [@NikolayRys](https://github.com/NikolayRys).
1415
* [#1916](https://github.com/ruby-grape/grape/pull/1916): Drop old appraisals - [@NikolayRys](https://github.com/NikolayRys).
1516
* [#1911](https://github.com/ruby-grape/grape/pull/1911): Make sure `Grape::Valiations::AtLeastOneOfValidator` properly treats nested params in errors - [@dnesteryuk](https://github.com/dnesteryuk).
1617
* [#1893](https://github.com/ruby-grape/grape/pull/1893): Allows `Grape::API` to behave like a Rack::app in some instances where it was misbehaving - [@myxoh](https://github.com/myxoh).

spec/grape/middleware/formatter_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,13 @@ def to_xml
213213
context 'no content responses' do
214214
let(:no_content_response) { ->(status) { [status, {}, ['']] } }
215215

216-
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.each do |status|
216+
STATUSES_WITHOUT_BODY = if Gem::Version.new(Rack.release) >= Gem::Version.new('2.1.0')
217+
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.keys
218+
else
219+
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY
220+
end
221+
222+
STATUSES_WITHOUT_BODY.each do |status|
217223
it "does not modify a #{status} response" do
218224
expected_response = no_content_response[status]
219225
allow(app).to receive(:call).and_return(expected_response)

0 commit comments

Comments
 (0)