lib/heroku/api/mock/features.rb in heroku-api-0.2.6 vs lib/heroku/api/mock/features.rb in heroku-api-0.2.7
- old
+ new
@@ -14,24 +14,24 @@
# feature exists
case feature_data['kind']
when 'app'
mock_data[:features][:app][app].delete(feature_data)
{
- :body => Heroku::API::OkJson.encode(feature_data.merge('enabled' => false)),
+ :body => Heroku::API.json_encode(feature_data.merge('enabled' => false)),
:status => 200
}
when 'user'
mock_data[:features][:user].delete(feature_data.merge('enabled' => false))
{
- :body => Heroku::API::OkJson.encode(feature_data),
+ :body => Heroku::API.json_encode(feature_data),
:status => 200
}
end
else
# feature does not exist
{
- :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
+ :body => Heroku::API.json_encode({'error' => "Feature not found."}),
:status => 404
}
end
else
{
@@ -54,17 +54,17 @@
Excon.stub(:expects => 200, :method => :get, :path => %r{^/features/([^/]+)}) do |params|
request_params, mock_data = parse_stub_params(params)
feature, _ = request_params[:captures][:path]
if feature_data = get_mock_feature(mock_data, feature)
{
- :body => Heroku::API::OkJson.encode(feature_data),
+ :body => Heroku::API.json_encode(feature_data),
:status => 200
}
else
# feature does not exist
{
- :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
+ :body => Heroku::API.json_encode({'error' => "Feature not found."}),
:status => 404
}
end
end
@@ -80,11 +80,11 @@
# feature exists
case feature_data['kind']
when 'app'
mock_data[:features][:app][app] << feature_data
{
- :body => Heroku::API::OkJson.encode(feature_data),
+ :body => Heroku::API.json_encode(feature_data),
:status => 200
}
when 'user'
mock_data[:features][:user] << feature_data
{
@@ -93,10 +93,10 @@
}
end
else
# feature does not exist
{
- :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}),
+ :body => Heroku::API.json_encode({'error' => "Feature not found."}),
:status => 404
}
end
else
# app not found