spec/support/versioned_helpers.rb in grape-0.5.0 vs spec/support/versioned_helpers.rb in grape-0.6.0
- old
+ new
@@ -23,11 +23,14 @@
{} # no-op
when :param
{} # no-op
when :header
{
- 'HTTP_ACCEPT' => "application/vnd.#{options[:vendor]}-#{options[:version]}+#{options[:format]}"
+ 'HTTP_ACCEPT' => [
+ "application/vnd.#{options[:vendor]}-#{options[:version]}",
+ options[:format]
+ ].compact.join("+")
}
when :accept_version_header
{
'HTTP_ACCEPT_VERSION' => "#{options[:version]}"
}
@@ -39,10 +42,10 @@
def versioned_get(path, version_name, version_options = {})
path = versioned_path(version_options.merge(:version => version_name, :path => path))
headers = versioned_headers(version_options.merge(:version => version_name))
params = {}
if version_options[:using] == :param
- params = { version_options[:parameter] => version_name }
+ params = { version_options[:parameter] => version_name }
end
get path, params, headers
end