Sha256: e538eb409d6f8263b79d0d660aa207ba8d17a452735e98e1271ad5509f7d80d0
Contents?: true
Size: 1.23 KB
Versions: 8
Compression:
Stored size: 1.23 KB
Contents
class Ey::Core::Client class Real def update_auto_scaling_policy(params = {}) id = params.delete("id") request( :method => :put, :path => "/auto_scaling_policies/#{id}", :body => { "auto_scaling_policy" => params.fetch("auto_scaling_policy") }, ) end end class Mock def update_auto_scaling_policy(params = {}) resource_id = params.delete("id") now = Time.now resource = find(:auto_scaling_policies, resource_id) .merge(params["auto_scaling_policy"]) .merge("updated_at" => now) resource.merge!(params) request = { "id" => self.uuid, "type" => "update_auto_scaling_policy", "successful" => true, "created_at" => now - 5, "updated_at" => now, "started_at" => now - 3, "finished_at" => now, "message" => nil, "read_channel" => nil, "resource" => [:auto_scaling_policies, resource_id, resource], "resource_url" => url_for("/auto_scaling_policies/#{resource_id}") } self.data[:requests][request["id"]] = request response( body: { "request" => request }, status: 200 ) end end end
Version data entries
8 entries across 8 versions & 2 rubygems