Skip to content

Commit b2697d8

Browse files
committed
Was not properly testing body, and was not passing state
1 parent bc4564b commit b2697d8

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/github_api/client/repos/deployments.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Client::Repos::Deployments < API
1313
]
1414

1515
VALID_STATUS_OPTIONS = %w[
16+
state
1617
target_url
1718
description
1819
]

spec/github/client/repos/deployments/create_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
before {
17-
stub_post(request_path).with(params).
17+
stub_post(request_path).with(:body => params).
1818
to_return(:body => body, :status => status,
1919
:headers => {:content_type => "application/json; charset=utf-8"})
2020
}
@@ -33,7 +33,7 @@
3333

3434
it "should create resource successfully" do
3535
subject.create user, repo, params
36-
a_post(request_path).with(params).should have_been_made
36+
a_post(request_path).with(:body => params).should have_been_made
3737
end
3838

3939
it "should return the resource" do

spec/github/client/repos/deployments/create_status_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
before {
17-
stub_post(request_path).with(params).
17+
stub_post(request_path).with(:body => params).
1818
to_return(:body => body, :status => status,
1919
:headers => {:content_type => "application/json; charset=utf-8"})
2020
}
@@ -33,7 +33,7 @@
3333

3434
it "should create resource successfully" do
3535
subject.create_status user, repo, id, params
36-
a_post(request_path).with(params).should have_been_made
36+
a_post(request_path).with(:body => params).should have_been_made
3737
end
3838

3939
it "should return the resource" do

0 commit comments

Comments
 (0)