Skip to content

Commit

Permalink
Merge 2847e93 into deeb826
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayRys committed Oct 13, 2019
2 parents deeb826 + 2847e93 commit e06e6bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#### Fixes

* Your contribution here.
* [#1917](https://github.com/ruby-grape/grape/pull/1917): Update access to rack constant - [@NikolayRys](https://github.com/NikolayRys).
* [#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).
* [#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).
* [#1898](https://github.com/ruby-grape/grape/pull/1898): Refactor `ValidatorFactory` to improve memory allocation - [@Bhacaz](https://github.com/Bhacaz).
Expand Down
8 changes: 7 additions & 1 deletion spec/grape/middleware/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ def to_xml
context 'no content responses' do
let(:no_content_response) { ->(status) { [status, {}, ['']] } }

Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.each do |status|
STATUSES_WITHOUT_BODY = if Rack::RELEASE >= '2.1.0'
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.keys
else
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY
end

STATUSES_WITHOUT_BODY.each do |status|
it "does not modify a #{status} response" do
expected_response = no_content_response[status]
allow(app).to receive(:call).and_return(expected_response)
Expand Down

0 comments on commit e06e6bb

Please sign in to comment.