Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Update documentation to link to docs.gitlab.com instead of the GitHub mirror for GitLab CE. (@connorshea)
- Add method `share_project_with_group` (@danhalligan)
- Allow to retrieve `ssh_keys` for a specific user(@dirker)
- Allow issues to use NAMESPACE/REPO identifier (@brodock)

### 3.7.0 (16/08/2016)

Expand Down
2 changes: 1 addition & 1 deletion lib/gitlab/client/issues.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Issues
# @option options [Integer] :per_page The number of results per page.
# @return [Array<Gitlab::ObjectifiedHash>]
def issues(project=nil, options={})
if project.to_i.zero?
if project.to_s.empty? && project.to_i.zero?
get("/issues", query: options)
else
get("/projects/#{project}/issues", query: options)
Expand Down
16 changes: 16 additions & 0 deletions spec/gitlab/client/issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
end
end

context 'with literal project ID passed' do
before do
stub_get("/projects/gitlab-org%2Fgitlab-ce/issues", "project_issues")
@issues = Gitlab.issues('gitlab-org%2Fgitlab-ce')
end

it "should get the correct resource" do
expect(a_get("/projects/gitlab-org%2Fgitlab-ce/issues")).to have_been_made
end

it "should return a paginated response of project's issues" do
expect(@issues).to be_a Gitlab::PaginatedResponse
expect(@issues.first.project_id).to eq(3)
end
end

context "without project ID passed" do
before do
stub_get("/issues", "issues")
Expand Down