lib/heroku/api/mock/releases.rb in heroku-api-0.1.1 vs lib/heroku/api/mock/releases.rb in heroku-api-0.1.2
- old
+ new
@@ -7,21 +7,21 @@
request_params, mock_data = parse_stub_params(params)
app, _ = request_params[:captures][:path]
with_mock_app(mock_data, app) do |app_data|
if get_mock_app_addon(mock_data, app, 'releases:basic')
{
- :body => Heroku::API::Mock.json_gzip(mock_data[:releases][app][-2..-1]),
+ :body => Heroku::API::OkJson.encode(mock_data[:releases][app][-2..-1]),
:status => 200
}
elsif get_mock_app_addon(mock_data, app, 'releases:advanced')
{
- :body => Heroku::API::Mock.json_gzip(mock_data[:releases][app]),
+ :body => Heroku::API::OkJson.encode(mock_data[:releases][app]),
:status => 200
}
else
{
- :body => Heroku::API::Mock.json_gzip({'error' => 'Please install the Release Management add-on to access release history'}),
+ :body => Heroku::API::OkJson.encode({'error' => 'Please install the Release Management add-on to access release history'}),
:status => 422
}
end
end
end
@@ -37,22 +37,22 @@
elsif get_mock_app_addon(mock_data, app, 'releases:advanced')
mock_data[:releases][app]
end
if release_data = releases.detect {|release| release['name'] == release_name}
{
- :body => Heroku::API::Mock.json_gzip(release_data),
+ :body => Heroku::API::OkJson.encode(release_data),
:status => 200
}
else
{
:body => 'Record not found.',
:status => 404
}
end
else
{
- :body => Heroku::API::Mock.json_gzip({'error' => 'Please install the Release Management add-on to access release history'}),
+ :body => Heroku::API::OkJson.encode({'error' => 'Please install the Release Management add-on to access release history'}),
:status => 422
}
end
end
end
@@ -93,27 +93,27 @@
'pstable' => { 'web' => '' },
'user' => 'email@example.com'
}
{
- :body => Heroku::API::Mock.gzip(release_data['name']),
+ :body => release_data['name'],
:status => 200
}
else
{
- :body => Heroku::API::Mock.json_gzip({'error' => 'Cannot rollback to a release that had a different set of addons installed'}),
+ :body => Heroku::API::OkJson.encode({'error' => 'Cannot rollback to a release that had a different set of addons installed'}),
:status => 422
}
end
else
{
- :body => Heroku::API::Mock.gzip('Record not found.'),
+ :body => 'Record not found.',
:status => 404
}
end
else
{
- :body => Heroku::API::Mock.json_gzip({'error' => 'Please install the Release Management add-on to access release history'}),
+ :body => Heroku::API::OkJson.encode({'error' => 'Please install the Release Management add-on to access release history'}),
:status => 422
}
end
end
end