Permalink
Browse files

update clearance to 0.16.2

  • Loading branch information...
1 parent 2eeb78d commit 89f157592c5d640bf3df5ee818ad47ef1b34e83d @qrush qrush committed May 24, 2012
View
2 Gemfile
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem 'rails', '~> 3.2.2'
gem 'airbrake'
-gem 'clearance', '~> 0.13.2'
+gem 'clearance', '~> 0.16.2'
gem 'dynamic_form'
gem 'excon'
gem 'fog'
View
4 Gemfile.lock
@@ -51,7 +51,7 @@ GEM
xpath (~> 0.1.4)
childprocess (0.3.2)
ffi (~> 1.0.6)
- clearance (0.13.2)
+ clearance (0.16.2)
diesel (~> 0.1.5)
rails (>= 3.0)
coderay (1.0.6)
@@ -236,7 +236,7 @@ DEPENDENCIES
airbrake
capistrano-ext
capybara
- clearance (~> 0.13.2)
+ clearance (~> 0.16.2)
cucumber-rails
daemons
database_cleaner
View
2 app/controllers/api/v1/api_keys_controller.rb
@@ -4,7 +4,7 @@ class Api::V1::ApiKeysController < Api::BaseController
def show
authenticate_or_request_with_http_basic do |username, password|
- @_current_user = User.authenticate(username, password)
+ self.current_user = User.authenticate(username, password)
if current_user
respond_to do |format|
format.any(:all) { render :text => current_user.api_key }
View
2 app/controllers/application_controller.rb
@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery :only => [:create, :update, :destroy]
ssl_required :if => :signed_in?
-protected
+ protected
def authenticate_with_api_key
api_key = request.headers["Authorization"] || params[:api_key]
View
15 features/support/paths.rb
@@ -23,19 +23,8 @@ def path_to(page_name)
edit_profile_path
when /"([^\"]+)" profile page/
profile_path(User.find_by_email!($1))
-
- # Add more mappings here.
- when /the sign up page/i
- sign_up_path
- when /the sign in page/i
- sign_in_path
- when /the password reset request page/i
- new_password_path
- # Here is an example that pulls values out of the Regexp:
- #
- # when /^(.*)'s profile page$/i
- # user_profile_path(User.find_by_login($1))
-
+ when /"([^"]+)" rubygem page/
+ rubygem_path(Rubygem.find_by_name!($1))
else
begin
page_name =~ /^the (.*) page$/
View
2 features/yank.feature
@@ -32,7 +32,7 @@ Feature: Delete Gems
| name: RGem | 1.2.3 |
When I yank the gem "RGem" version "1.2.3" with my API key
And I go to the dashboard
- And I follow "RGem"
+ And I go to the "RGem" rubygem page
Then I should see "This gem has been yanked"
Given I am signed up as "new@owner.com"
View
3 test/functional/api/v1/rubygems_controller_test.rb
@@ -167,7 +167,6 @@ def self.should_respond_to(format)
post :create
end
should respond_with :success
- should assign_to(:_current_user) { @user }
should "register new gem" do
assert_equal 1, Rubygem.count
assert_equal @user, Rubygem.last.ownerships.first.user
@@ -184,7 +183,6 @@ def self.should_respond_to(format)
post :create
end
should respond_with :success
- should assign_to(:_current_user) { @user }
should "register new version" do
assert_equal @user, Rubygem.last.ownerships.first.user
assert_equal 1, Rubygem.last.ownerships.count
@@ -243,7 +241,6 @@ def self.should_respond_to(format)
post :create
end
should respond_with 403
- should assign_to(:_current_user) { @user }
should "not allow new version to be saved" do
assert_equal 1, @rubygem.ownerships.size
assert_equal @other_user, @rubygem.ownerships.first.user
View
12 test/test_helper.rb
@@ -1,8 +1,6 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
-require 'clearance/testing'
-require 'capybara/rails'
class ActiveSupport::TestCase
self.use_transactional_fixtures = true
@@ -35,6 +33,16 @@ def assert_changed(object, attribute, &block)
end
end
+# why isn't clearance doing this for us!?
+class ActionController::TestCase
+ setup do
+ @request.env[:clearance] = Clearance::Session.new(@request.env)
+ end
+end
+
+require 'clearance/testing'
+require 'capybara/rails'
+
def regenerate_index
FileUtils.rm_rf(
%w[server/cache/*
View
BIN vendor/cache/clearance-0.13.2.gem
Binary file not shown.
View
BIN vendor/cache/clearance-0.16.2.gem
Binary file not shown.

0 comments on commit 89f1575

Please sign in to comment.