diff --git a/app/models/miq_request.rb b/app/models/miq_request.rb index 46137841d1e..9e2a96fa93b 100644 --- a/app/models/miq_request.rb +++ b/app/models/miq_request.rb @@ -34,13 +34,13 @@ class MiqRequest < ApplicationRecord virtual_column :v_approved_by_email, :type => :string, :uses => {:miq_approvals => :stamper} virtual_column :stamped_on, :type => :datetime, :uses => :miq_approvals virtual_column :v_allowed_tags, :type => :string, :uses => :workflow - virtual_column :v_class, :type => :string, :uses => :workflow + virtual_column :v_workflow_class, :type => :string, :uses => :workflow virtual_column :request_type_display, :type => :string virtual_column :resource_type, :type => :string virtual_column :state, :type => :string delegate :allowed_tags, :to => :workflow, :prefix => :v - delegate :class, :to => :workflow, :prefix => :v + delegate :class, :to => :workflow, :prefix => :v_workflow virtual_has_one :workflow diff --git a/spec/requests/api/requests_spec.rb b/spec/requests/api/requests_spec.rb index 2014193ee63..ca03dcb181f 100644 --- a/spec/requests/api/requests_spec.rb +++ b/spec/requests/api/requests_spec.rb @@ -246,17 +246,17 @@ request.add_tag(t.name, t.children.first.name) api_basic_authorize action_identifier(:requests, :read, :resource_actions, :get) - run_get requests_url(request.id), :attributes => "workflow,v_allowed_tags,v_class" + run_get requests_url(request.id), :attributes => "workflow,v_allowed_tags,v_workflow_class" - expected_workflow = a_hash_including("id" => request.id, "workflow" => a_hash_including("values")) - expected_tags = a_hash_including("id" => request.id, "v_allowed_tags" => [a_hash_including("children")]) - expected_class = a_hash_including( - "id" => request.id, - "v_class" => {"instance_logger" => a_hash_including("klass" => request.workflow.class.to_s)}) + expected_response = a_hash_including( + "id" => request.id, + "workflow" => a_hash_including("values"), + "v_allowed_tags" => [a_hash_including("children")], + "v_workflow_class" => a_hash_including( + "instance_logger" => a_hash_including("klass" => request.workflow.class.to_s)) + ) - expect(response.parsed_body).to match(expected_workflow) - expect(response.parsed_body).to match(expected_tags) - expect(response.parsed_body).to match(expected_class) + expect(response.parsed_body).to match(expected_response) expect(response).to have_http_status(:ok) end end