Skip to content

Commit

Permalink
Fix tests by pinning rack-test to < 2.1 (#2311)
Browse files Browse the repository at this point in the history
* Pin rack-test to < 2.1

* Fix Rubocop violation

* Update CHANGELOG
  • Loading branch information
duffn authored Mar 20, 2023
1 parent 7cbf0b9 commit cdb8316
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#2302](https://github.com/ruby-grape/grape/pull/2302): Rack < 3 and update rack-test - [@ericproulx](https://github.com/ericproulx).
* [#2303](https://github.com/ruby-grape/grape/pull/2302): Rack >= 1.3.0 - [@ericproulx](https://github.com/ericproulx).
* [#2301](https://github.com/ruby-grape/grape/pull/2301): Revisit GH workflows - [@ericproulx](https://github.com/ericproulx).
* [#2311](https://github.com/ruby-grape/grape/pull/2311): Fix tests by pinning rack-test to < 2.1 - [@duffn](https://github.com/duffn).
* Your contribution here.

#### Fixes
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/multi_json.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/multi_xml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_1_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_2_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_3_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ group :test do
gem 'maruku'
gem 'mime-types'
gem 'rack-jsonp', require: 'rack/jsonp'
gem 'rack-test'
gem 'rack-test', '< 2.1'
gem 'rspec', '~> 3.11.0'
gem 'ruby-grape-danger', '~> 0.2.0', require: false
gem 'simplecov', '~> 0.21.2'
Expand Down
12 changes: 6 additions & 6 deletions spec/grape/validations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1071,12 +1071,12 @@ def validate_param!(attr_name, params)
}
# debugger
get '/multi_level', data
expect(last_response.body.split(', ')).to match_array([
'top[3][top_id] is empty',
'top[2][middle_1][0][middle_1_id] is empty',
'top[1][middle_1][1][middle_2][0][middle_2_id] is empty',
'top[0][middle_1][1][middle_2][1][bottom][0][bottom_id] is empty'
])
expect(last_response.body.split(', ')).to contain_exactly(
'top[3][top_id] is empty',
'top[2][middle_1][0][middle_1_id] is empty',
'top[1][middle_1][1][middle_2][0][middle_2_id] is empty',
'top[0][middle_1][1][middle_2][1][bottom][0][bottom_id] is empty'
)
expect(last_response.status).to eq(400)
end
end
Expand Down

0 comments on commit cdb8316

Please sign in to comment.