Skip to content

Commit

Permalink
Merge pull request #1263 from jrafanie/rails7_fixes
Browse files Browse the repository at this point in the history
 Rails7 fixes
  • Loading branch information
kbrock authored Jul 23, 2024
2 parents 1072557 + 3ebce41 commit 20fd786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions spec/requests/requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,12 @@
request.add_tag(t.name, t.children.first.name)

api_basic_authorize action_identifier(:requests, :read, :resource_actions, :get)
get api_request_url(nil, request), :params => { :attributes => "workflow,v_allowed_tags,v_workflow_class" }
get api_request_url(nil, request), :params => {:attributes => "workflow,v_allowed_tags"}

expected_response = a_hash_including(
"id" => request.id.to_s,
"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))
"id" => request.id.to_s,
"workflow" => a_hash_including("values"),
"v_allowed_tags" => [a_hash_including("children")]
)

expect(response.parsed_body).to match(expected_response)
Expand Down Expand Up @@ -314,11 +312,10 @@
:source_type => vm_template.class.name)

api_basic_authorize action_identifier(:requests, :read, :resource_actions, :get)
get api_request_url(nil, request), :params => { :attributes => "workflow,v_allowed_tags,v_workflow_class" }
get api_request_url(nil, request), :params => {:attributes => "workflow,v_allowed_tags"}

expected_response = a_hash_including(
"id" => request.id.to_s,
"v_workflow_class" => {}
"id" => request.id.to_s
)

expect(response.parsed_body).to match(expected_response)
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/servers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
server = FactoryBot.create(:miq_server, :status => 'started')

expect { post(api_server_url(nil, server), :params => gen_request(:delete)) }.to change(MiqServer, :count).by(0)
expect_single_action_result(:success => false, :message => 'Failed to destroy the record')
expect_single_action_result(:success => false, :message => 'Failed to destroy')
end

it "can delete a server with DELETE if the server is deletable" do
Expand Down

0 comments on commit 20fd786

Please sign in to comment.