Skip to content

Commit

Permalink
show yanked version downloads in api
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Apr 4, 2019
1 parent 5bd59e0 commit 7a927d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/downloads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index
def show
full_name = params[:id]
version = Version.find_by(full_name: full_name)
if version && !version.yanked?
if version
data = {
total_downloads: GemDownload.count_for_rubygem(version.rubygem_id),
version_downloads: GemDownload.count_for_version(version.id)
Expand Down
8 changes: 1 addition & 7 deletions test/functional/api/v1/downloads_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,7 @@ def self.should_respond_to(format, to_meth = :to_s)
get_show(@version)
end

should "return a 404" do
assert_response :not_found
end

should "say gem could not be found" do
assert_equal "This rubygem could not be found.", @response.body
end
should respond_with :success
end

context "On GET to all" do
Expand Down

0 comments on commit 7a927d7

Please sign in to comment.