lib/heroku/api/mock/features.rb in heroku-api-0.3.15 vs lib/heroku/api/mock/features.rb in heroku-api-0.3.16

- 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 => MultiJson.dump(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 => MultiJson.dump(feature_data), :status => 200 } end else # feature does not exist { - :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}), + :body => MultiJson.dump({'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 => MultiJson.dump(feature_data), :status => 200 } else # feature does not exist { - :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}), + :body => MultiJson.dump({'error' => "Feature not found."}), :status => 404 } end end @@ -85,11 +85,11 @@ else mock_data[:features][:app][app] << feature_data 201 end { - :body => Heroku::API::OkJson.encode(feature_data), + :body => MultiJson.dump(feature_data), :status => status } when 'user' status = if mock_data[:features][:user].include(feature_data) 200 @@ -103,10 +103,10 @@ } end else # feature does not exist { - :body => Heroku::API::OkJson.encode({'error' => "Feature not found."}), + :body => MultiJson.dump({'error' => "Feature not found."}), :status => 404 } end else # app not found