Skip to content

Commit

Permalink
Update tests to expect new API format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesremuscat committed Mar 12, 2024
1 parent 2a12fef commit 3e9f5b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/requests/api/v1/devices_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def send_request
expect(parsed_device["name"]).to eq attributes[:device][:name]
expect(parsed_device["status"]).to eq attributes[:device][:status]
expect(parsed_device["cost"]).to eq "#{'%.2f' % attributes[:device][:cost]}"
parsed_details = parsed_device # ['details'] after revertion of 6b8d3e9
parsed_details = parsed_device['details']
expect(parsed_details["mtu"]).to eq attributes[:device][:details][:mtu]
end
end
Expand Down Expand Up @@ -381,7 +381,7 @@ def send_request
parsed_device = JSON.parse(response.body)
expect(parsed_device["name"]).to eq attributes[:device][:name]
expect(parsed_device["status"]).to eq attributes[:device][:status]
parsed_details = parsed_device # ['details'] after revertion of 6b8d3e9
parsed_details = parsed_device['details']
expect(parsed_details["bootable"]).to eq attributes[:device][:details][:bootable]
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/api/v1/nodes_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def send_request
expect(parsed_device["template"]["id"]).to eq valid_attributes[:template_id]
expect(parsed_device["cost"]).to eq "#{'%.2f' % valid_attributes[:device][:cost]}"

parsed_details = parsed_device #["details"]
parsed_details = parsed_device["details"]
expect(parsed_details["mtu"]).to eq valid_attributes[:device][:details][:mtu]
expect(parsed_details["dns_domain"]).to eq valid_attributes[:device][:details][:dns_domain]
end
Expand Down Expand Up @@ -246,7 +246,7 @@ def send_request
expect(parsed_device["template"]["id"]).to eq valid_attributes[:template_id]
expect(parsed_device["cost"]).to eq "#{'%.2f' % valid_attributes[:device][:cost]}"

parsed_details = parsed_device #["details"]
parsed_details = parsed_device["details"]
expect(parsed_details["bootable"]).to eq valid_attributes[:device][:details][:bootable]
expect(parsed_details["size"]).to eq valid_attributes[:device][:details][:size]
end
Expand Down

0 comments on commit 3e9f5b5

Please sign in to comment.