Permalink
Browse files

Added a feature, and link to download .gem from gem's version page

  • Loading branch information...
1 parent 0ba2445 commit ab0e2850802b3fb2869ca99cb5dc13f0c1cbe1c6 @andhapp andhapp committed Dec 19, 2009
@@ -70,4 +70,8 @@ def unsubscribe_link(gem)
:style => gem.subscribers.find_by_id(current_user.try(:id)) ? 'display:block' : 'display:none'
}
end
+
+ def download_link(version)
+ link_to "Download", "/gems/#{version.to_index[0]}-#{version}.gem", :id => :download
+ end
end
View
@@ -2,7 +2,7 @@ class Hostess < Sinatra::Default
cattr_writer :local
def self.local
- @@local ||= false
+ @@local ||= true
end
def serve(redirect = false)
@@ -11,6 +11,7 @@
<%= link_to "Edit", edit_rubygem_path(@rubygem), :id => "edit" if @rubygem.owned_by?(current_user) %>
<%= subscribe_link(@rubygem) %>
<%= unsubscribe_link(@rubygem) %>
+ <%= download_link(@latest_version) %>
</div>
<div id="markup">
View
@@ -53,3 +53,29 @@ Feature: Download Gems
And I visit the gem page for "crysknife" version "1.0.0-java"
Then I should see "5 total downloads"
And I should see "2 for this version"
+
+ Scenario: Download a .gem file for a platform gem
+ Given I am signed up and confirmed as "email@person.com/password"
+ And I have a gem "andhapp" with version "1.1.1"
+ And I have a gem "andhapp" with version "1.1.0"
+ And I have an api key for "email@person.com/password"
+ And I push the gem "andhapp-1.1.1.gem" with my api key
+ And I push the gem "andhapp-1.1.0.gem" with my api key
+ And the system processes jobs
+
+ When I visit the gem page for "andhapp" version "1.1.1"
+ Then I should see "0 total downloads"
+
+ When I visit the gem page for "andhapp" version "1.1.1"
+ Then I follow "Download"
+ And the system processes jobs
+ And I visit the gem page for "andhapp"
+ Then I should see "1 total downloads"
+ And I should see "1 for this version"
+
+ When I visit the gem page for "andhapp" version "1.1.0"
+ Then I follow "Download"
+ And the system processes jobs
+ And I visit the gem page for "andhapp"
+ Then I should see "2 total downloads"
+ And I should see "1 for this version"
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -409,6 +409,10 @@ body {
background: url('/images/unsubscribe.png') no-repeat;
}
+.main .info #admin #download {
+ background: url('/images/download.png') no-repeat;
+}
+
.main .info #markup h2 {
font-size: 1.5em;
margin: 0 36px;

0 comments on commit ab0e285

Please sign in to comment.