Permalink
Browse files

All cukes passing!

* Gemfiling database_cleaner
* Catch format.any(:all) for api/v1/owners#show
* Switch to new mailer api for email reset, confirmation
* Whitelist more attributes for User
* Move some forgotten views to use short_info
* html_safe the footer links
* Lots of form deprecation whiners silenced
* Upgrade to latest cucumber
* Hack webrat so it works on Rails 3
* Move cucumber specific setup into its own support file
* Fix a few steps that expected regexps for 'I should see'
* Removed hoptoad_notifier task, yagni
* DJ's API to start a worker changed, fixed it
* Check the last email in the Deliveries, not the first
  • Loading branch information...
1 parent fbd96ca commit d1085ba57343879168fb251554f641a93d6c2759 @qrush qrush committed Jul 21, 2010
View
@@ -27,6 +27,7 @@ group :test do
gem "cucumber-rails", "0.3.2"
gem "factory_girl_rails", "1.0"
+ gem "database_cleaner", "0.5.2"
gem "fakeweb", "1.2.6"
gem "nokogiri", "1.4.1"
gem "rack-test", "0.5.4", :require => "rack/test"
View
@@ -8,22 +8,22 @@ dependencies:
group:
- :test
version: = 1.2.6
- rails:
- group:
- - :default
- version: = 3.0.0.beta4
- gravtastic:
+ pg:
group:
- :default
- version: = 2.1.3
+ version: = 0.8.0
system_timer:
group:
- :default
version: = 1.0
- pg:
+ gravtastic:
group:
- :default
- version: = 0.8.0
+ version: = 2.1.3
+ rails:
+ group:
+ - :default
+ version: = 3.0.0.beta4
treetop:
group:
- :test
@@ -44,44 +44,48 @@ dependencies:
group:
- :default
version: = 1.1.0
- cucumber-rails:
+ database_cleaner:
group:
- :test
- version: = 0.3.2
- will_paginate:
+ version: = 0.5.2
+ rest-client:
group:
- :default
- version: = 2.3.11
+ version: = 1.0.3
+ require:
+ - rest_client
+ json:
+ group:
+ - :default
+ version: = 1.2.0
sinatra:
group:
- :default
version: = 1.0
- json:
+ will_paginate:
group:
- :default
- version: = 1.2.0
- rest-client:
+ version: = 2.3.11
+ cucumber-rails:
group:
- - :default
- version: = 1.0.3
- require:
- - rest_client
+ - :test
+ version: = 0.3.2
webrat:
group:
- :test
version: = 0.5.3
- gchartrb:
- group:
- - :default
- version: = 0.8
- require:
- - google_chart
rack-maintenance:
group:
- :default
version: = 0.3.0
require:
- rack/maintenance
+ gchartrb:
+ group:
+ - :default
+ version: = 0.8
+ require:
+ - google_chart
redgreen:
group:
- :test
@@ -92,36 +96,36 @@ dependencies:
version: = 0.5.4
require:
- rack/test
- clearance:
- group:
- - :default
- version: = 0.9.0.rc5
hoptoad_notifier:
group:
- :default
version: = 2.2.0
- redis:
+ clearance:
group:
- :default
- version: = 2.0.1
+ version: = 0.9.0.rc5
aws-s3:
group:
- :default
version: = 0.6.2
require:
- aws/s3
+ redis:
+ group:
+ - :default
+ version: = 2.0.1
webmock:
group:
- :test
version: = 0.7.3
- xml-simple:
- group:
- - :default
- version: = 1.0.12
factory_girl_rails:
group:
- :test
version: = 1.0
+ xml-simple:
+ group:
+ - :default
+ version: = 1.0.12
nokogiri:
group:
- :test
@@ -199,6 +203,8 @@ specs:
version: 0.3.2
- daemons:
version: 1.1.0
+- database_cleaner:
+ version: 0.5.2
- delayed_job:
version: 2.1.0.pre
source: 0
@@ -244,7 +250,7 @@ specs:
version: 0.5.3
- will_paginate:
version: 2.3.11
-hash: 150b641f21af34ede62d593d4200bce738ab72ee
+hash: 7fb30ea9ae84dd1506b0ac2eb9ec57ec8894c21a
sources:
- Git:
uri: git://github.com/pvdb/delayed_job.git
@@ -9,7 +9,7 @@ class Api::V1::OwnersController < ApplicationController
def show
respond_to do |format|
- format.json { render :json => @rubygem.owners }
+ format.any(:json, :all) { render :json => @rubygem.owners }
format.yaml { render :text => @rubygem.owners.to_yaml }
end
end
@@ -13,9 +13,9 @@ def create
redirect_back_or(url_after_create)
else
if @user.email_reset
- Mailer.deliver_email_reset(@user)
+ Mailer.email_reset(@user).deliver
else
- ClearanceMailer.deliver_confirmation(@user)
+ ClearanceMailer.confirmation(@user).deliver
end
flash_notice_after_create
redirect_to(new_session_url)
View
@@ -1,4 +1,3 @@
-require 'sinatra'
class Hostess < Sinatra::Base
cattr_writer :local
View
@@ -2,7 +2,7 @@ class User < ActiveRecord::Base
include Clearance::User
is_gravtastic
- attr_accessible :handle
+ attr_accessible :handle, :password_confirmation, :password, :email
has_many :rubygems, :through => :ownerships,
:order => "name ASC",
@@ -18,7 +18,7 @@
<% end -%>
</strong>
<%= time_ago_in_words(version.created_at) %> ago</div>
- <%= short_info(version.info) %>
+ <%= short_info(version) %>
</a>
</li>
<% end %>
@@ -57,7 +57,7 @@
<div class="downloads">
<strong><%= gem.downloads %></strong> downloads
</div>
- <%= link_to gem, gem, :title => gem.versions.latest.try(:summary) %>
+ <%= link_to gem, gem, :title => short_info(gem.versions.most_recent) %>
</li>
<% end %>
</ol>
@@ -78,8 +78,8 @@
<%= link_to "Code", "http://github.com/rubygems/gemcutter" %>
<%= link_to "Discuss", "http://groups.google.com/group/gemcutter" %>
<%= link_to "Stats", statistics_url %>
- <%= link_to "designed by #{image_tag('thoughtbot.png')}", "http://thoughtbot.com", :title => "Designed by Thoughtbot", :id => "thoughtbot" %>
- <%= link_to "supported by #{image_tag('rubycentral.png')}", "http://rubycentral.org", :title => "Supported by Ruby Central", :id => "rubycentral" %>
+ <%= link_to "designed by #{image_tag('thoughtbot.png')}".html_safe, "http://thoughtbot.com", :title => "Designed by Thoughtbot", :id => "thoughtbot" %>
+ <%= link_to "supported by #{image_tag('rubycentral.png')}".html_safe, "http://rubycentral.org", :title => "Supported by Ruby Central", :id => "rubycentral" %>
</div>
</div>
</div>
@@ -1,8 +1,8 @@
<% @title = "reset password" %>
-<% form_for(:user,
- :url => user_password_path(@user, :token => @user.confirmation_token),
- :html => { :method => :put }) do |form| %>
+<%= form_for(:user,
+ :url => user_password_path(@user, :token => @user.confirmation_token),
+ :html => { :method => :put }) do |form| %>
<%= error_messages_for :user %>
<div class="password_field">
<%= form.label :password %>
@@ -4,7 +4,7 @@
We will email you a link to change your password.
</p>
-<% form_for :password, :url => passwords_path do |form| %>
+<%= form_for :password, :url => passwords_path do |form| %>
<div class="text_field">
<%= form.label :email, "Email address" %>
<%= form.text_field :email, :size => '25' %>
@@ -5,7 +5,7 @@
</div>
<%= link_to "Forgot Password?", new_password_url %>
</div>
-<% form_for :session, :url => session_path do |form| %>
+<%= form_for :session, :url => session_path do |form| %>
<div class="text_field">
<%= form.label :who, "Email or Handle" %>
<%= form.text_field :who, :size => 25 %>
@@ -5,7 +5,7 @@
</div>
<%= link_to "Already have an account?", sign_in_path %>
</div>
-<% form_for @user do |form| %>
+<%= form_for @user do |form| %>
<%= render :partial => '/users/form', :object => form %>
<%= form.submit 'Sign up', :disable_with => 'Please wait...' %>
<% end %>
View
@@ -11,5 +11,6 @@ class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.active_record.include_root_in_json = false
+ config.middleware.use "Hostess"
end
end
View
@@ -0,0 +1,8 @@
+<%
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
+%>
+default: <%= std_opts %> features
+wip: --tags @wip:3 --wip features
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
View
@@ -1,3 +0,0 @@
-default: features -t ~wip -f progress
-wip: features -t wip -f progress
-all: features -f progress
View
@@ -72,7 +72,7 @@ Feature: Search
When I go to the homepage
And I fill in "query" with "rgem"
And I press "Search"
- Then I should not see "RGem \(1.0.0\)"
+ Then I should not see "RGem (1.0.0)"
Scenario: The most recent version of a gem is yanked
Given I am signed up and confirmed as "email@person.com/password"
@@ -85,7 +85,5 @@ Feature: Search
When I go to the homepage
And I fill in "query" with "rgem"
And I press "Search"
- And I should see "RGem \(1.2.1\)"
- And I should not see "RGem \(1.2.2\)"
-
-
+ And I should see "RGem (1.2.1)"
+ And I should not see "RGem (1.2.2)"
@@ -56,7 +56,7 @@
Then /^a confirmation message should be sent to "(.*)"$/ do |email|
user = User.find_by_email(email)
- sent = ActionMailer::Base.deliveries.first
+ sent = ActionMailer::Base.deliveries.last
assert_equal [user.email], sent.to
assert_match /confirm/i, sent.subject
assert !user.confirmation_token.blank?
@@ -71,7 +71,7 @@
Then /^a password reset message should be sent to "(.*)"$/ do |email|
user = User.find_by_email(email)
- sent = ActionMailer::Base.deliveries.first
+ sent = ActionMailer::Base.deliveries.last
assert_equal [user.email], sent.to
assert_match /password/i, sent.subject
assert !user.confirmation_token.blank?
@@ -1,3 +1,3 @@
When 'the system processes jobs' do
- Delayed::Job.work_off
+ Delayed::Worker.new(:quiet => true).work_off
end
@@ -19,3 +19,7 @@
"#{row['name']} (#{row['downloads']})"
end
end
+
+Then /^I should see the version "([^\"]*)" featured$/ do |version_number|
+ assert_select("h3", :text => version_number)
+end
Oops, something went wrong.

0 comments on commit d1085ba

Please sign in to comment.