Skip to content

Commit 47ae087

Browse files
committed
Change issues api to use new request methods.
1 parent 6fc5abc commit 47ae087

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

lib/github_api/issues.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def list(params={})
8888
# _merge_mime_type(:issue, params)
8989
_validate_params_values(VALID_ISSUE_PARAM_VALUES, params)
9090

91-
response = get("/issues", params)
91+
response = get_request("/issues", params)
9292
return response unless block_given?
9393
response.each { |el| yield el }
9494
end
@@ -133,7 +133,7 @@ def list_repo(user_name=nil, repo_name=nil, params={})
133133
# _merge_mime_type(:issue, params)
134134
_validate_params_values(VALID_ISSUE_PARAM_VALUES, params)
135135

136-
response = get("/repos/#{user}/#{repo}/issues", params)
136+
response = get_request("/repos/#{user}/#{repo}/issues", params)
137137
return response unless block_given?
138138
response.each { |el| yield el }
139139
end
@@ -153,7 +153,7 @@ def find(user_name, repo_name, issue_id, params={})
153153
_normalize_params_keys(params)
154154
# _merge_mime_type(:issue, params)
155155

156-
get("/repos/#{user}/#{repo}/issues/#{issue_id}", params)
156+
get_request("/repos/#{user}/#{repo}/issues/#{issue_id}", params)
157157
end
158158

159159
# Create an issue
@@ -185,7 +185,7 @@ def create(user_name, repo_name, params={})
185185
_filter_params_keys(VALID_ISSUE_PARAM_NAMES, params)
186186
_validate_inputs(%w[ title ], params)
187187

188-
post("/repos/#{user}/#{repo}/issues", params)
188+
post_request("/repos/#{user}/#{repo}/issues", params)
189189
end
190190

191191
# Edit an issue
@@ -219,7 +219,7 @@ def edit(user_name, repo_name, issue_id, params={})
219219
# _merge_mime_type(:issue, params)
220220
_filter_params_keys(VALID_ISSUE_PARAM_NAMES, params)
221221

222-
patch("/repos/#{user}/#{repo}/issues/#{issue_id}", params)
222+
patch_request("/repos/#{user}/#{repo}/issues/#{issue_id}", params)
223223
end
224224

225225
end # Issues

spec/github/issues_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
let(:repo) { 'github' }
1010
let(:issue_id) { 1347 }
1111

12-
after { github.user, github.repo, github.oauth_token = nil, nil, nil }
12+
after { reset_authentication_for github }
1313

1414
context 'access to apis' do
1515
it { subject.comments.should be_a Github::Issues::Comments }
@@ -19,6 +19,8 @@
1919
end
2020

2121
context '#list' do
22+
it { github.issues.should respond_to(:all) }
23+
2224
context "resource found" do
2325
before do
2426
stub_get("/issues").

0 commit comments

Comments
 (0)