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

- old
+ new

@@ -15,32 +15,32 @@ mock_data[:domains].delete(app) mock_data[:maintenance_mode].delete(app) mock_data[:ps].delete(app) mock_data[:releases].delete(app) { - :body => Heroku::API::OkJson.encode({}), + :body => MultiJson.dump({}), :status => 200 } end end # stub GET /apps/ Excon.stub(:expects => 200, :method => :get, :path => '/apps') do |params| request_params, mock_data = parse_stub_params(params) { - :body => Heroku::API::OkJson.encode(mock_data[:apps]), + :body => MultiJson.dump(mock_data[:apps]), :status => 200 } end # stub GET /apps/:app Excon.stub(:expects => 200, :method => :get, :path => %r{^/apps/([^/]+)$} ) do |params| request_params, mock_data = parse_stub_params(params) app, _ = request_params[:captures][:path] with_mock_app(mock_data, app) do |app_data| { - :body => Heroku::API::OkJson.encode(app_data), + :body => MultiJson.dump(app_data), :status => 200 } end end @@ -50,11 +50,11 @@ app, _ = request_params[:captures][:path].first with_mock_app(mock_data, app) do maintenance = mock_data[:maintenance_mode].include?(app) { - :body => Heroku::API::OkJson.encode('maintenance' => maintenance), + :body => MultiJson.dump('maintenance' => maintenance), :status => 200 } end end @@ -63,11 +63,11 @@ request_params, mock_data = parse_stub_params(params) app = request_params[:query].has_key?('app[name]') && request_params[:query]['app[name]'] || "generated-name-#{rand(999)}" if get_mock_app(mock_data, app) { - :body => Heroku::API::OkJson.encode('error' => 'Name is already taken'), + :body => MultiJson.dump('error' => 'Name is already taken'), :status => 422 } else stack = request_params[:query].has_key?('app[stack]') && request_params[:query]['app[stack]'] || 'bamboo-mri-1.9.2' app_data = { @@ -128,11 +128,11 @@ mock_data[:ps][app].first['command'] = 'thin -p $PORT -e $RACK_ENV -R $HEROKU_RACK start' mock_data[:ps][app].first['type'] = 'Dyno' end { - :body => Heroku::API::OkJson.encode(app_data), + :body => MultiJson.dump(app_data), :status => 202 } end end @@ -173,16 +173,16 @@ app_data['owner_email'] = email end end if email && !collaborator { - :body => Heroku::API::OkJson.encode('error' => 'Only existing collaborators can receive ownership for an app'), + :body => MultiJson.dump('error' => 'Only existing collaborators can receive ownership for an app'), :status => 422 } else { - :body => Heroku::API::OkJson.encode('name' => app_data['name']), + :body => MultiJson.dump('name' => app_data['name']), :status => 200 } end end end @@ -192,10 +192,10 @@ request_params, mock_data = parse_stub_params(params) app, _ = request_params[:captures][:path] with_mock_app(mock_data, app) do |app_data| { - :body => Heroku::API::OkJson.encode({}), + :body => MultiJson.dump({}), :status => 201 } end end