Skip to content

Commit

Permalink
Tidy up test
Browse files Browse the repository at this point in the history
  • Loading branch information
timothysmith0609 committed Jan 24, 2019
1 parent 4f1bb39 commit 9a9f80b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/test_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,18 @@ def test_json_patch_service
stub_request(:patch, expected_url)
.to_return(body: open_test_file('service_patch.json'), status: 200)

patch = {
metadata: {
annotations: {
key: 'value'
}
}
}
patch = [
{ "op" => "replace", "path" => "/metadata/annotations/key1", "value" => "value" },
{ "op" => "add", "path" => "/metadata/annotations/key2", "value" => "value" }
]

client = Kubeclient::Client.new('http://localhost:8080/api/', 'v1')
service = client.json_patch_service(name, patch, 'development')
assert_kind_of(RecursiveOpenStruct, service)

assert_requested(:patch, expected_url, times: 1) do |req|
data = JSON.parse(req.body)
data['metadata']['annotations']['key'] == 'value'
data == patch
end
end

Expand Down

0 comments on commit 9a9f80b

Please sign in to comment.