diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index 2c67bb11e5..ea61685052 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -1851,10 +1851,10 @@ def self.call(object, env) subject.routes.map { |route| route.route_params }.should eq [{ - "group1" => { required: true, type: "Array"}, + "group1" => { required: true, type: "Array" }, "group1[param1]" => { required: false, desc: "group1 param1 desc" }, "group1[param2]" => { required: true, desc: "group1 param2 desc" }, - "group2" => { required: true, type: "Array"}, + "group2" => { required: true, type: "Array" }, "group2[param1]" => { required: false, desc: "group2 param1 desc" }, "group2[param2]" => { required: true, desc: "group2 param2 desc" } }] diff --git a/spec/grape/validations_spec.rb b/spec/grape/validations_spec.rb index f52b5b1cde..12824ceccc 100644 --- a/spec/grape/validations_spec.rb +++ b/spec/grape/validations_spec.rb @@ -272,7 +272,7 @@ def app last_response.status.should == 400 last_response.body.should == 'children is invalid, children[name] is missing, children[parents] is missing, children[parents] is invalid, children[parents][name] is missing' - get '/within_array', children: { :name => 'foo' } + get '/within_array', children: { name: 'foo' } last_response.status.should == 400 last_response.body.should == 'children is invalid, children[parents] is missing' @@ -327,11 +327,11 @@ def app last_response.status.should == 400 last_response.body.should == 'planets is invalid, planets[name] is missing' - get '/req', planets: { :name => 'Jupiter' } + get '/req', planets: { name: 'Jupiter' } last_response.status.should == 400 last_response.body.should == 'planets is invalid' - get '/req', planets: [{ :name => 'Venus' }, { :name => 'Mars' }] + get '/req', planets: [{ name: 'Venus' }, { name: 'Mars' }] last_response.status.should == 200 put_with_json '/req', planets: [] @@ -343,11 +343,11 @@ def app last_response.status.should == 400 last_response.body.should == 'moons is invalid, moons[name] is missing' - get '/opt', name: "Jupiter", moons: { :name => 'Ganymede' } + get '/opt', name: "Jupiter", moons: { name: 'Ganymede' } last_response.status.should == 400 last_response.body.should == 'moons is invalid' - get '/opt', name: "Jupiter", moons: [{ :name => 'Io' }, { :name => 'Callisto' }] + get '/opt', name: "Jupiter", moons: [{ name: 'Io' }, { name: 'Callisto' }] last_response.status.should == 200 put_with_json '/opt', name: "Venus" @@ -362,11 +362,11 @@ def app last_response.status.should == 400 last_response.body.should == 'stars is invalid, stars[name] is missing' - get '/grp', stars: { :name => 'Sun' } + get '/grp', stars: { name: 'Sun' } last_response.status.should == 400 last_response.body.should == 'stars is invalid' - get '/grp', stars: [{ :name => 'Sun' }] + get '/grp', stars: [{ name: 'Sun' }] last_response.status.should == 200 put_with_json '/grp', stars: [] @@ -509,11 +509,11 @@ def app last_response.status.should == 400 last_response.body.should == 'items[required_subitems] is missing' - get '/nested_optional_group', items: [{ key: 'foo', required_subitems: [{ value: 'bar' }]}] + get '/nested_optional_group', items: [{ key: 'foo', required_subitems: [{ value: 'bar' }] }] last_response.status.should == 200 last_response.body.should == 'nested optional group works' - get '/nested_optional_group', items: [{ key: 'foo', required_subitems: [{ value: 'bar' }], optional_subitems: [{ not_value: 'baz' }]}] + get '/nested_optional_group', items: [{ key: 'foo', required_subitems: [{ value: 'bar' }], optional_subitems: [{ not_value: 'baz' }] }] last_response.status.should == 400 last_response.body.should == 'items[optional_subitems][value] is missing' end