diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/.specification b/vendor/gems/thoughtbot-clearance-0.7.0/.specification
new file mode 100644
index 0000000..236e31f
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/.specification
@@ -0,0 +1,145 @@
+--- !ruby/object:Gem::Specification
+name: thoughtbot-clearance
+version: !ruby/object:Gem::Version
+ version: 0.7.0
+platform: ruby
+authors:
+- Dan Croak
+- Mike Burns
+- Jason Morrison
+- Joe Ferris
+- Eugene Bolshakov
+- Nick Quaranto
+- Josh Nichols
+- Mike Breen
+- "Marcel G\xC3\xB6rner"
+- Bence Nagy
+- Ben Mabey
+- Eloy Duran
+- Tim Pope
+- Mihai Anca
+- Mark Cornick
+- Shay Arnett
+autorequire:
+bindir: bin
+cert_chain: []
+
+date: 2009-08-04 00:00:00 -04:00
+default_executable:
+dependencies: []
+
+description: Rails authentication with email & password.
+email: support@thoughtbot.com
+executables: []
+
+extensions: []
+
+extra_rdoc_files: []
+
+files:
+- CHANGELOG.textile
+- LICENSE
+- Rakefile
+- README.textile
+- TODO.textile
+- app/controllers
+- app/controllers/clearance
+- app/controllers/clearance/confirmations_controller.rb
+- app/controllers/clearance/passwords_controller.rb
+- app/controllers/clearance/sessions_controller.rb
+- app/controllers/clearance/users_controller.rb
+- app/models
+- app/models/clearance_mailer.rb
+- app/views
+- app/views/clearance_mailer
+- app/views/clearance_mailer/change_password.html.erb
+- app/views/clearance_mailer/confirmation.html.erb
+- app/views/passwords
+- app/views/passwords/edit.html.erb
+- app/views/passwords/new.html.erb
+- app/views/sessions
+- app/views/sessions/new.html.erb
+- app/views/users
+- app/views/users/_form.html.erb
+- app/views/users/new.html.erb
+- config/clearance_routes.rb
+- generators/clearance
+- generators/clearance/clearance_generator.rb
+- generators/clearance/lib
+- generators/clearance/lib/insert_commands.rb
+- generators/clearance/lib/rake_commands.rb
+- generators/clearance/templates
+- generators/clearance/templates/factories.rb
+- generators/clearance/templates/migrations
+- generators/clearance/templates/migrations/create_users.rb
+- generators/clearance/templates/migrations/update_users.rb
+- generators/clearance/templates/README
+- generators/clearance/templates/user.rb
+- generators/clearance/USAGE
+- generators/clearance_features
+- generators/clearance_features/clearance_features_generator.rb
+- generators/clearance_features/templates
+- generators/clearance_features/templates/features
+- generators/clearance_features/templates/features/password_reset.feature
+- generators/clearance_features/templates/features/sign_in.feature
+- generators/clearance_features/templates/features/sign_out.feature
+- generators/clearance_features/templates/features/sign_up.feature
+- generators/clearance_features/templates/features/step_definitions
+- generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
+- generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
+- generators/clearance_features/templates/features/support
+- generators/clearance_features/templates/features/support/paths.rb
+- generators/clearance_features/USAGE
+- generators/clearance_views
+- generators/clearance_views/clearance_views_generator.rb
+- generators/clearance_views/templates
+- generators/clearance_views/templates/formtastic
+- generators/clearance_views/templates/formtastic/passwords
+- generators/clearance_views/templates/formtastic/passwords/edit.html.erb
+- generators/clearance_views/templates/formtastic/passwords/new.html.erb
+- generators/clearance_views/templates/formtastic/sessions
+- generators/clearance_views/templates/formtastic/sessions/new.html.erb
+- generators/clearance_views/templates/formtastic/users
+- generators/clearance_views/templates/formtastic/users/_inputs.html.erb
+- generators/clearance_views/templates/formtastic/users/new.html.erb
+- generators/clearance_views/USAGE
+- lib/clearance
+- lib/clearance/authentication.rb
+- lib/clearance/extensions
+- lib/clearance/extensions/errors.rb
+- lib/clearance/extensions/rescue.rb
+- lib/clearance/extensions/routes.rb
+- lib/clearance/user.rb
+- lib/clearance.rb
+- shoulda_macros/clearance.rb
+- rails/init.rb
+has_rdoc: true
+homepage: http://github.com/thoughtbot/clearance
+licenses: []
+
+post_install_message:
+rdoc_options: []
+
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: "0"
+ version:
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: "0"
+ version:
+requirements: []
+
+rubyforge_project:
+rubygems_version: 1.3.4
+signing_key:
+specification_version: 3
+summary: Rails authentication with email & password.
+test_files: []
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/CHANGELOG.textile b/vendor/gems/thoughtbot-clearance-0.7.0/CHANGELOG.textile
new file mode 100644
index 0000000..c493128
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/CHANGELOG.textile
@@ -0,0 +1,176 @@
+h2. 0.7.0 (08/04/2009)
+
+* Redirect signed in user who clicks confirmation link again. (Dan Croak)
+* Redirect signed out user who clicks confirmation link again. (Dan Croak)
+* Added signed_out? convenience method for controllers, helpers, views. (Dan
+Croak)
+* Added clearance_views generator. By default, creates formtastic views which
+pass all tests and features. (Dan Croak)
+
+h2. 0.6.9 (07/04/2009)
+
+* Added timestamps to create users migration. (Dan Croak)
+* Ready for Ruby 1.9. (Jason Morrison, Nick Quaranto)
+
+h2. 0.6.8 (06/24/2009)
+
+* Added defined? checks for various Rails constants such as ActionController
+for easier unit testing of Clearance extensions... particularly ActiveRecord
+extensions... particularly strong_password. (Dan Croak)
+
+h2. 0.6.7 (06/13/2009)
+
+* [#30] Added sign_up, sign_in, sign_out named routes. (Dan Croak)
+* [#22] Minimizing Reek smell: Duplication in redirect_back_or. (Dan Croak)
+* Deprecated sign_user_in. Told developers to use sign_in instead. (Dan
+Croak)
+* [#16] flash_success_after_create, flash_notice_after_create, flash_failure_after_create, flash_sucess_after_update, flash_success_after_destroy, etc. (Dan Croak)
+* [#17] bug. added #create to forbidden before_filters on confirmations controller. (Dan Croak)
+* [#24] should_be_signed_in_as shouldn't look in the session. (Dan Croak)
+* README improvements. (Dan Croak)
+* Move routes loading to separate file. (Joshua Clayton)
+
+h2. 0.6.6 (05/18/2009)
+
+* [#14] replaced class_eval in Clearance::User with modules. This was needed
+in a thoughtbot client app so we could write our own validations. (Dan Croak)
+
+h2. 0.6.5 (05/17/2009)
+
+* [#6] Make Clearance i18n aware. (Timur Vafin, Marcel Goerner, Eugene Bolshakov, Dan Croak)
+
+h2. 0.6.4 (05/12/2009)
+
+* Moved issue tracking to Github from Lighthouse. (Dan Croak)
+* [#7] asking higher-level questions of controllers in webrat steps, such as signed_in? instead of what's in the session. same for accessors. (Dan Croak)
+* [#11] replacing sign_in_as & sign_out shoulda macros with a stubbing (requires no dependency) approach. this will avoid dealing with the internals of current_user, such as session & cookies. added sign_in macro which signs in an email confirmed user from clearance's factories. (Dan Croak)
+* [#13] move private methods on sessions controller into Clearance::Authentication module (Dan Croak)
+* [#9] audited flash keys. (Dan Croak)
+
+h2. 0.6.3 (04/23/2009)
+
+* Scoping ClearanceMailer properly within controllers so it works in production environments. (Nick Quaranto)
+
+h2. 0.6.2 (04/22/2009)
+
+* Insert Clearance::User into User model if it exists. (Nick Quaranto)
+* World(NavigationHelpers) Cucumber 3.0 style. (Shay Arnett & Mark Cornick)
+
+h2. 0.6.1 (04/21/2009)
+* Scope operators are necessary to keep Rails happy. Reverting the original
+revert so they're back in the library now for constants referenced inside of
+the gem. (Nick Quaranto)
+
+h2. 0.6.0 (04/21/2009)
+
+* Converted Clearance to a Rails engine. (Dan Croak & Joe Ferris)
+* Include Clearance::User in User model in app. (Dan Croak & Joe Ferris)
+* Include Clearance::Authentication in ApplicationController. (Dan Croak & Joe Ferris)
+* Namespace controllers under Clearance. (Dan Croak & Joe Ferris)
+* Routes move to engine, use namespaced controllers but publicly the same. (Dan Croak & Joe Ferris)
+* If you want to override a controller, subclass it like SessionsController <
+Clearance::SessionsController. This gives you access to usual hooks such as
+url_after_create. (Dan Croak & Joe Ferris)
+* Controllers, mailer, model, routes all unit tested inside engine. Use
+script/generate clearance_features to test integration of Clearance with your
+Rails app. No longer including modules in your app's test files. (Dan Croak & Joe Ferris)
+* Moved views to engine. (Joe Ferris)
+* Converted generated test/factories/clearance.rb to use inheritence for
+email_confirmed_user. (Dan Croak)
+* Corrected some spelling errors with methods (Nick Quaranto)
+* Converted "I should see error messages" to use a regex in the features (Nick
+Quaranto)
+* Loading clearance routes after rails routes via some monkeypatching (Nick
+Quaranto)
+* Made the clearance controllers unloadable to stop constant loading errors in
+development mode (Nick Quaranto)
+
+h2. 0.5.6 (4/11/2009)
+
+* [#57] Step definition changed for "User should see error messages" so
+features won't fail for certain validations. (Nick Quaranto)
+
+h2. 0.5.5 (3/23/2009)
+
+* Removing duplicate test to get rid of warning. (Nick Quaranto)
+
+h2. 0.5.4 (3/21/2009)
+
+* When users fail logging in, redirect them instead of rendering. (Matt
+Jankowski)
+
+h2. 0.5.3 (3/5/2009)
+
+* Clearance now works with (and requires) Shoulda 2.10.0. (Mark Cornick, Joe
+Ferris, Dan Croak)
+* Prefer flat over nested contexts in sessions_controller_test. (Joe Ferris,
+Dan Croak)
+
+h2. 0.5.2 (3/2/2009)
+
+* Fixed last remaining errors in Rails 2.3 tests. Now fully compatible. (Joe
+Ferris, Dan Croak)
+
+h2. 0.5.1 (2/27/2009)
+
+* [#46] A user with unconfirmed email who resets password now confirms email.
+(Marcel Görner)
+* Refactored user_from_cookie, user_from_session, User#authenticate to use
+more direct return code instead of ugly, harder to read ternary. (Dan Croak)
+* Switch order of cookies and sessions to take advantage of Rails 2.3's "Rack-based lazy-loaded sessions":http://is.gd/i23E. (Dan Croak)
+* Altered generator to interact with application_controller.rb instead of
+application.rb in Rails 2.3 apps. (Dan Croak)
+* [#42] Bug fix. Rack-based session change altered how to test remember me
+cookie. (Mihai Anca)
+
+h2. 0.5.0 (2/27/2009)
+
+* Fixed problem with Cucumber features. (Dan Croak)
+* Fixed mising HTTP fluency use case. (Dan Croak)
+* Refactored User#update_password to take just parameters it needs. (Dan
+Croak)
+* Refactored User unit tests to be more readable. (Dan Croak)
+
+h2. 0.4.9 (2/20/2009)
+
+* Protect passwords & confirmations actions with forbidden filters. (Dan Croak)
+* Return 403 Forbidden status code in those cases. (Tim Pope)
+* Test 403 Forbidden status code in Cucumber feature. (Dan Croak, Joe Ferris)
+* Raise custom ActionController::Forbidden error internally. (Joe Ferris, Mike Burns, Jason Morrison)
+* Test ActionController::Forbidden error is raised in functional test. (Joe Ferris, Mike Burns, Dan Croak)
+* [#45] Fixed bug that allowed anyone to edit another user's password (Marcel Görner)
+* Required Factory Girl >= 1.2.0. (Dan Croak)
+
+h2. 0.4.8 (2/16/2009)
+
+* Added support paths for Cucumber. (Ben Mabey)
+* Added documentation for the flash. (Ben Mabey)
+* Generators require "test_helper" instead of File.join. for rr compatibility. (Joe Ferris)
+* Removed interpolated email address from flash message to make i18n easier. (Bence Nagy)
+* Standardized flash messages that refer to email delivery. (Dan Croak)
+
+h2. 0.4.7 (2/12/2009)
+
+* Removed Clearance::Test::TestHelper so there is one less setup step. (Dan Croak)
+* All test helpers now in shoulda_macros. (Dan Croak)
+
+h2. 0.4.6 (2/11/2009)
+
+* Made the modules behave like mixins again. (hat-tip Eloy Duran)
+* Created Actions and PrivateMethods modules on controllers for future RDoc reasons. (Dan Croak, Joe Ferris)
+
+h2. 0.4.5 (2/9/2009)
+
+* [#43] Removed email downcasing because local-part is case sensitive per RFC5321. (Dan Croak)
+* [#42] Removed dependency on Mocha. (Dan Croak)
+* Required Shoulda >= 2.9.1. (Dan Croak)
+* Added password reset feature to clearance_features generator. (Eugene Bolshakov, Dan Croak)
+* Removed unnecessary session[:salt]. (Dan Croak)
+* [#41] Only store location for session[:return_to] for GET requests. (Dan Croak)
+* Audited "sign up" naming convention. "Register" had slipped in a few places. (Dan Croak)
+* Switched to SHA1 encryption. Cypher doesn't matter much for email confirmation, password reset. Better to have shorter hashes in the emails for clients who line break on 72 chars. (Dan Croak)
+
+h2. 0.4.4 (2/2/2009)
+
+* Added a generator for Cucumber features. (Joe Ferris, Dan Croak)
+* Standarized naming for "Sign up," "Sign in," and "Sign out". (Dan Croak)
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/LICENSE b/vendor/gems/thoughtbot-clearance-0.7.0/LICENSE
new file mode 100644
index 0000000..5060183
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2008 thoughtbot, inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/README.textile b/vendor/gems/thoughtbot-clearance-0.7.0/README.textile
new file mode 100644
index 0000000..3aa3687
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/README.textile
@@ -0,0 +1,123 @@
+h1. Clearance
+
+Rails authentication with email & password.
+
+"We have clearance, Clarence.":http://www.youtube.com/v/mNRXJEE3Nz8
+
+h2. Wiki
+
+Most information regarding Clearance is on the "Github Wiki":http://wiki.github.com/thoughtbot/clearance.
+
+h2. Installation
+
+Clearance is a Rails engine. It works with versions of Rails greater than 2.3.
+
+In config/environment.rb:
+
+
+
+Make sure the development database exists and run the generator:
+
+@script/generate clearance@
+
+A number of files will be created and instructions will be printed.
+
+You may already have some of these files. Don't worry. You'll be asked if you want to overwrite them.
+
+Run the migration:
+
+@rake db:migrate@
+
+Define a HOST constant in your environment files.
+In config/environments/test.rb and config/environments/development.rb it can be:
+
+@HOST = "localhost"@
+
+In production.rb it must be the actual host your application is deployed to.
+The constant is used by mailers to generate URLs in emails.
+
+In config/environment.rb:
+
+@DO_NOT_REPLY = "donotreply@example.com"@
+
+Define root_url to *something* in your config/routes.rb:
+
+@map.root :controller => 'home'@
+
+h2. Cucumber Features
+
+As your app evolves, you want to know that authentication still works. Clearance's opinion is that you should test its integration with your app using "Cucumber":http://cukes.info/.
+
+In config/environments/test.rb:
+
+
+
+We don't vendor nokogiri due to its native extensions, so install it normally on your machine:
+
+@sudo gem install nokogiri@
+
+Run the Cucumber generator (if you haven't already) and Clearance's feature generator:
+
+
+
+All of the files generated should be new with the exception of the features/support/paths.rb file. If you have not modified your paths.rb then you will be okay to replace it with this one. If you need to keep your paths.rb file then add these locations in your paths.rb manually:
+
+
+def path_to(page_name)
+ case page_name
+ ...
+ when /the sign up page/i
+ new_user_path
+ when /the sign in page/i
+ new_session_path
+ when /the password reset request page/i
+ new_password_path
+ ...
+end
+
+
+h2. Authors
+
+Clearance was extracted out of "Hoptoad":http://hoptoadapp.com. We merged the authentication code from two of thoughtbot's clients' Rails apps and have since used it each time we need authentication. The following people have improved the library. Thank you!
+
+Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Nick Quaranto, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, Mark Cornick, Shay Arnett, Joshua Clayton & Mustafa Ekim.
+
+h2. Questions?
+
+Ask the "mailing list":http://groups.google.com/group/thoughtbot-clearance
+
+h2. Suggestions, Bugs, Refactoring?
+
+Fork away and create a "Github Issue":http://github.com/thoughtbot/clearance/issues. Please don't send pull requests.
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/Rakefile b/vendor/gems/thoughtbot-clearance-0.7.0/Rakefile
new file mode 100644
index 0000000..cacfe35
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/Rakefile
@@ -0,0 +1,103 @@
+# encoding: utf-8
+
+require 'rake'
+require 'rake/testtask'
+require 'cucumber/rake/task'
+
+namespace :test do
+ Rake::TestTask.new(:basic => ["generator:cleanup",
+ "generator:clearance",
+ "generator:clearance_features"]) do |task|
+ task.libs << "lib"
+ task.libs << "test"
+ task.pattern = "test/**/*_test.rb"
+ task.verbose = false
+ end
+
+ Rake::TestTask.new(:views => ["generator:clearance_views"]) do |task|
+ task.libs << "lib"
+ task.libs << "test"
+ task.pattern = "test/**/*_test.rb"
+ task.verbose = false
+ end
+
+ Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "--format progress"
+ t.feature_pattern = "test/rails_root/features/*.feature"
+ end
+
+ Cucumber::Rake::Task.new(:features_for_views) do |t|
+ t.cucumber_opts = "--format progress"
+ t.feature_pattern = "test/rails_root/features/*.feature"
+ end
+end
+
+generators = %w(clearance clearance_features clearance_views)
+
+namespace :generator do
+ desc "Cleans up the test app before running the generator"
+ task :cleanup do
+ generators.each do |generator|
+ FileList["generators/#{generator}/templates/**/*.*"].each do |each|
+ file = "test/rails_root/#{each.gsub("generators/#{generator}/templates/",'')}"
+ File.delete(file) if File.exists?(file)
+ end
+ end
+
+ FileList["test/rails_root/db/**/*"].each do |each|
+ FileUtils.rm_rf(each)
+ end
+
+ FileUtils.rm_rf("test/rails_root/vendor/plugins/clearance")
+ FileUtils.mkdir_p("test/rails_root/vendor/plugins")
+ clearance_root = File.expand_path(File.dirname(__FILE__))
+ system("ln -s #{clearance_root} test/rails_root/vendor/plugins/clearance")
+
+ FileUtils.rm_rf("test/rails_root/app/views/passwords")
+ FileUtils.rm_rf("test/rails_root/app/views/sessions")
+ FileUtils.rm_rf("test/rails_root/app/views/users")
+ end
+
+ desc "Run the clearance generator"
+ task :clearance do
+ system "cd test/rails_root && ./script/generate clearance && rake db:migrate db:test:prepare"
+ end
+
+ desc "Run the clearance features generator"
+ task :clearance_features do
+ system "cd test/rails_root && ./script/generate clearance_features"
+ end
+
+ desc "Run the clearance views generator"
+ task :clearance_views do
+ system "cd test/rails_root && ./script/generate clearance_views"
+ end
+end
+
+desc "Run the test suite"
+task :default => ['test:basic', 'test:features',
+ 'test:views', 'test:features_for_views']
+
+gem_spec = Gem::Specification.new do |gem_spec|
+ gem_spec.name = "clearance"
+ gem_spec.version = "0.7.0"
+ gem_spec.summary = "Rails authentication with email & password."
+ gem_spec.email = "support@thoughtbot.com"
+ gem_spec.homepage = "http://github.com/thoughtbot/clearance"
+ gem_spec.description = "Rails authentication with email & password."
+ gem_spec.authors = ["Dan Croak", "Mike Burns", "Jason Morrison",
+ "Joe Ferris", "Eugene Bolshakov", "Nick Quaranto",
+ "Josh Nichols", "Mike Breen", "Marcel Görner",
+ "Bence Nagy", "Ben Mabey", "Eloy Duran",
+ "Tim Pope", "Mihai Anca", "Mark Cornick",
+ "Shay Arnett"]
+ gem_spec.files = FileList["[A-Z]*", "{app,config,generators,lib,shoulda_macros,rails}/**/*"]
+end
+
+desc "Generate a gemspec file"
+task :gemspec do
+ File.open("#{gem_spec.name}.gemspec", 'w') do |f|
+ f.write gem_spec.to_yaml
+ end
+end
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/TODO.textile b/vendor/gems/thoughtbot-clearance-0.7.0/TODO.textile
new file mode 100644
index 0000000..9805aed
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/TODO.textile
@@ -0,0 +1,6 @@
+h1. To-do
+
+* Make insertion of Clearance::User into User model automatic from the generator.
+* Change generated README to include instruction about running the migration.
+* DO_NOT_REPLY, HOST refactoring.
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/confirmations_controller.rb b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/confirmations_controller.rb
new file mode 100644
index 0000000..983e506
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/confirmations_controller.rb
@@ -0,0 +1,73 @@
+class Clearance::ConfirmationsController < ApplicationController
+ unloadable
+
+ before_filter :redirect_signed_in_confirmed_user, :only => [:new, :create]
+ before_filter :redirect_signed_out_confirmed_user, :only => [:new, :create]
+ before_filter :forbid_missing_token, :only => [:new, :create]
+ before_filter :forbid_non_existent_user, :only => [:new, :create]
+
+ filter_parameter_logging :token
+
+ def new
+ create
+ end
+
+ def create
+ @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
+ @user.confirm_email!
+
+ sign_in(@user)
+ flash_success_after_create
+ redirect_to(url_after_create)
+ end
+
+ private
+
+ def redirect_signed_in_confirmed_user
+ user = ::User.find_by_id(params[:user_id])
+ if user && user.email_confirmed? && current_user == user
+ flash_success_after_create
+ redirect_to(url_after_create)
+ end
+ end
+
+ def redirect_signed_out_confirmed_user
+ user = ::User.find_by_id(params[:user_id])
+ if user && user.email_confirmed? && signed_out?
+ flash_already_confirmed
+ redirect_to(url_already_confirmed)
+ end
+ end
+
+ def forbid_missing_token
+ if params[:token].blank?
+ raise ActionController::Forbidden, "missing token"
+ end
+ end
+
+ def forbid_non_existent_user
+ unless ::User.find_by_id_and_token(params[:user_id], params[:token])
+ raise ActionController::Forbidden, "non-existent user"
+ end
+ end
+
+ def flash_success_after_create
+ flash[:success] = translate(:confirmed_email,
+ :scope => [:clearance, :controllers, :confirmations],
+ :default => "Confirmed email and signed in.")
+ end
+
+ def flash_already_confirmed
+ flash[:success] = translate(:already_confirmed_email,
+ :scope => [:clearance, :controllers, :confirmations],
+ :default => "Already confirmed email. Please sign in.")
+ end
+
+ def url_after_create
+ root_url
+ end
+
+ def url_already_confirmed
+ sign_in_url
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/passwords_controller.rb b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/passwords_controller.rb
new file mode 100644
index 0000000..6221ad3
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/passwords_controller.rb
@@ -0,0 +1,81 @@
+class Clearance::PasswordsController < ApplicationController
+ unloadable
+
+ before_filter :forbid_missing_token, :only => [:edit, :update]
+ before_filter :forbid_non_existent_user, :only => [:edit, :update]
+ filter_parameter_logging :password, :password_confirmation
+
+ def new
+ render :template => 'passwords/new'
+ end
+
+ def create
+ if user = ::User.find_by_email(params[:password][:email])
+ user.forgot_password!
+ ::ClearanceMailer.deliver_change_password user
+ flash_notice_after_create
+ redirect_to(url_after_create)
+ else
+ flash_failure_after_create
+ render :template => 'passwords/new'
+ end
+ end
+
+ def edit
+ @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
+ render :template => 'passwords/edit'
+ end
+
+ def update
+ @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
+
+ if @user.update_password(params[:user][:password],
+ params[:user][:password_confirmation])
+ @user.confirm_email!
+ sign_in(@user)
+ flash_success_after_update
+ redirect_to(url_after_update)
+ else
+ render :template => 'passwords/edit'
+ end
+ end
+
+ private
+
+ def forbid_missing_token
+ if params[:token].blank?
+ raise ActionController::Forbidden, "missing token"
+ end
+ end
+
+ def forbid_non_existent_user
+ unless ::User.find_by_id_and_token(params[:user_id], params[:token])
+ raise ActionController::Forbidden, "non-existent user"
+ end
+ end
+
+ def flash_notice_after_create
+ flash[:notice] = translate(:deliver_change_password,
+ :scope => [:clearance, :controllers, :passwords],
+ :default => "You will receive an email within the next few minutes. " <<
+ "It contains instructions for changing your password.")
+ end
+
+ def flash_failure_after_create
+ flash.now[:failure] = translate(:unknown_email,
+ :scope => [:clearance, :controllers, :passwords],
+ :default => "Unknown email.")
+ end
+
+ def url_after_create
+ new_session_url
+ end
+
+ def flash_success_after_update
+ flash[:success] = translate(:signed_in, :default => "Signed in.")
+ end
+
+ def url_after_update
+ root_url
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/sessions_controller.rb b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/sessions_controller.rb
new file mode 100644
index 0000000..2ea0440
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/sessions_controller.rb
@@ -0,0 +1,67 @@
+class Clearance::SessionsController < ApplicationController
+ unloadable
+
+ protect_from_forgery :except => :create
+ filter_parameter_logging :password
+
+ def new
+ render :template => 'sessions/new'
+ end
+
+ def create
+ @user = ::User.authenticate(params[:session][:email],
+ params[:session][:password])
+ if @user.nil?
+ flash_failure_after_create
+ render :template => 'sessions/new', :status => :unauthorized
+ else
+ if @user.email_confirmed?
+ sign_in(@user)
+ remember(@user) if remember?
+ flash_success_after_create
+ redirect_back_or(url_after_create)
+ else
+ ::ClearanceMailer.deliver_confirmation(@user)
+ flash_notice_after_create
+ redirect_to(new_session_url)
+ end
+ end
+ end
+
+ def destroy
+ forget(current_user)
+ flash_success_after_destroy
+ redirect_to(url_after_destroy)
+ end
+
+ private
+
+ def flash_failure_after_create
+ flash.now[:failure] = translate(:bad_email_or_password,
+ :scope => [:clearance, :controllers, :sessions],
+ :default => "Bad email or password.")
+ end
+
+ def flash_success_after_create
+ flash[:success] = translate(:signed_in, :default => "Signed in.")
+ end
+
+ def flash_notice_after_create
+ flash[:notice] = translate(:unconfirmed_email,
+ :scope => [:clearance, :controllers, :sessions],
+ :default => "User has not confirmed email. " <<
+ "Confirmation email will be resent.")
+ end
+
+ def url_after_create
+ root_url
+ end
+
+ def flash_success_after_destroy
+ flash[:success] = translate(:signed_out, :default => "Signed out.")
+ end
+
+ def url_after_destroy
+ new_session_url
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/users_controller.rb b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/users_controller.rb
new file mode 100644
index 0000000..6b8659e
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/controllers/clearance/users_controller.rb
@@ -0,0 +1,35 @@
+class Clearance::UsersController < ApplicationController
+ unloadable
+
+ before_filter :redirect_to_root, :only => [:new, :create], :if => :signed_in?
+ filter_parameter_logging :password
+
+ def new
+ @user = ::User.new(params[:user])
+ render :template => 'users/new'
+ end
+
+ def create
+ @user = ::User.new params[:user]
+ if @user.save
+ ::ClearanceMailer.deliver_confirmation @user
+ flash_notice_after_create
+ redirect_to(url_after_create)
+ else
+ render :template => 'users/new'
+ end
+ end
+
+ private
+
+ def flash_notice_after_create
+ flash[:notice] = translate(:deliver_confirmation,
+ :scope => [:clearance, :controllers, :users],
+ :default => "You will receive an email within the next few minutes. " <<
+ "It contains instructions for confirming your account.")
+ end
+
+ def url_after_create
+ new_session_url
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/models/clearance_mailer.rb b/vendor/gems/thoughtbot-clearance-0.7.0/app/models/clearance_mailer.rb
new file mode 100644
index 0000000..90f5f16
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/models/clearance_mailer.rb
@@ -0,0 +1,23 @@
+class ClearanceMailer < ActionMailer::Base
+
+ default_url_options[:host] = HOST
+
+ def change_password(user)
+ from DO_NOT_REPLY
+ recipients user.email
+ subject I18n.t(:change_password,
+ :scope => [:clearance, :models, :clearance_mailer],
+ :default => "Change your password")
+ body :user => user
+ end
+
+ def confirmation(user)
+ from DO_NOT_REPLY
+ recipients user.email
+ subject I18n.t(:confirmation,
+ :scope => [:clearance, :models, :clearance_mailer],
+ :default => "Account confirmation")
+ body :user => user
+ end
+
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/change_password.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/change_password.html.erb
new file mode 100644
index 0000000..246324d
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/change_password.html.erb
@@ -0,0 +1,7 @@
+Someone, hopefully you, has requested that we send you a link to change your password.
+
+Here's the link:
+
+<%= edit_user_password_url(@user, :token => @user.token, :escape => false) %>
+
+If you didn't request this, ignore this email. Don't worry. Your password hasn't been changed.
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/confirmation.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/confirmation.html.erb
new file mode 100644
index 0000000..83d3de4
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/clearance_mailer/confirmation.html.erb
@@ -0,0 +1,2 @@
+
+<%= new_user_confirmation_url :user_id => @user, :token => @user.token, :encode => false %>
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/passwords/edit.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/passwords/edit.html.erb
new file mode 100644
index 0000000..c8637f5
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/passwords/edit.html.erb
@@ -0,0 +1,23 @@
+
Change your password
+
+
+ Your password has been reset. Choose a new password below.
+
+<% end %>
\ No newline at end of file
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/sessions/new.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/sessions/new.html.erb
new file mode 100644
index 0000000..a1e5607
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/sessions/new.html.erb
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/_form.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/_form.html.erb
new file mode 100644
index 0000000..6a9b8e0
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/_form.html.erb
@@ -0,0 +1,13 @@
+<%= form.error_messages %>
+
\ No newline at end of file
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/new.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/new.html.erb
new file mode 100644
index 0000000..de2ebf7
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/app/views/users/new.html.erb
@@ -0,0 +1,6 @@
+
Sign up
+
+<% form_for @user do |form| %>
+ <%= render :partial => '/users/form', :object => form %>
+ <%= form.submit 'Sign up', :disable_with => 'Please wait...' %>
+<% end %>
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/config/clearance_routes.rb b/vendor/gems/thoughtbot-clearance-0.7.0/config/clearance_routes.rb
new file mode 100644
index 0000000..caeb5cc
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/config/clearance_routes.rb
@@ -0,0 +1,30 @@
+ActionController::Routing::Routes.draw do |map|
+ map.resources :passwords,
+ :controller => 'clearance/passwords',
+ :only => [:new, :create]
+
+ map.resource :session,
+ :controller => 'clearance/sessions',
+ :only => [:new, :create, :destroy]
+
+ map.resources :users, :controller => 'clearance/users' do |users|
+ users.resource :password,
+ :controller => 'clearance/passwords',
+ :only => [:create, :edit, :update]
+
+ users.resource :confirmation,
+ :controller => 'clearance/confirmations',
+ :only => [:new, :create]
+ end
+
+ map.sign_up 'sign_up',
+ :controller => 'clearance/users',
+ :action => 'new'
+ map.sign_in 'sign_in',
+ :controller => 'clearance/sessions',
+ :action => 'new'
+ map.sign_out 'sign_out',
+ :controller => 'clearance/sessions',
+ :action => 'destroy',
+ :method => :delete
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/USAGE b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/USAGE
new file mode 100644
index 0000000..3d9cabe
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/USAGE
@@ -0,0 +1 @@
+script/generate clearance
\ No newline at end of file
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/clearance_generator.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/clearance_generator.rb
new file mode 100644
index 0000000..d3704b7
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/clearance_generator.rb
@@ -0,0 +1,41 @@
+require File.expand_path(File.dirname(__FILE__) + "/lib/insert_commands.rb")
+require File.expand_path(File.dirname(__FILE__) + "/lib/rake_commands.rb")
+require 'factory_girl'
+
+class ClearanceGenerator < Rails::Generator::Base
+
+ def manifest
+ record do |m|
+ m.insert_into "app/controllers/application_controller.rb",
+ "include Clearance::Authentication"
+
+ user_model = "app/models/user.rb"
+ if File.exists?(user_model)
+ m.insert_into user_model, "include Clearance::User"
+ else
+ m.directory File.join("app", "models")
+ m.file "user.rb", user_model
+ end
+
+ m.directory File.join("test", "factories")
+ m.file "factories.rb", "test/factories/clearance.rb"
+
+ m.migration_template "migrations/#{migration_name}.rb",
+ 'db/migrate',
+ :migration_file_name => "clearance_#{migration_name}"
+
+ m.readme "README"
+ end
+ end
+
+ private
+
+ def migration_name
+ if ActiveRecord::Base.connection.table_exists?(:users)
+ 'update_users'
+ else
+ 'create_users'
+ end
+ end
+
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/insert_commands.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/insert_commands.rb
new file mode 100644
index 0000000..cc76c56
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/insert_commands.rb
@@ -0,0 +1,33 @@
+# Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
+
+Rails::Generator::Commands::Base.class_eval do
+ def file_contains?(relative_destination, line)
+ File.read(destination_path(relative_destination)).include?(line)
+ end
+end
+
+Rails::Generator::Commands::Create.class_eval do
+ def insert_into(file, line)
+ logger.insert "#{line} into #{file}"
+ unless options[:pretend] || file_contains?(file, line)
+ gsub_file file, /^(class|module) .+$/ do |match|
+ "#{match}\n #{line}"
+ end
+ end
+ end
+end
+
+Rails::Generator::Commands::Destroy.class_eval do
+ def insert_into(file, line)
+ logger.remove "#{line} from #{file}"
+ unless options[:pretend]
+ gsub_file file, "\n #{line}", ''
+ end
+ end
+end
+
+Rails::Generator::Commands::List.class_eval do
+ def insert_into(file, line)
+ logger.insert "#{line} into #{file}"
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/rake_commands.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/rake_commands.rb
new file mode 100644
index 0000000..a9fd417
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/lib/rake_commands.rb
@@ -0,0 +1,22 @@
+Rails::Generator::Commands::Create.class_eval do
+ def rake_db_migrate
+ logger.rake "db:migrate"
+ unless system("rake db:migrate")
+ logger.rake "db:migrate failed. Rolling back"
+ command(:destroy).invoke!
+ end
+ end
+end
+
+Rails::Generator::Commands::Destroy.class_eval do
+ def rake_db_migrate
+ logger.rake "db:rollback"
+ system "rake db:rollback"
+ end
+end
+
+Rails::Generator::Commands::List.class_eval do
+ def rake_db_migrate
+ logger.rake "db:migrate"
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/README b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/README
new file mode 100644
index 0000000..17850c8
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/README
@@ -0,0 +1,22 @@
+
+*******************************************************************************
+
+Ok, enough fancy automatic stuff. Time for some old school monkey copy-pasting.
+
+1. Define a HOST constant in your environments files.
+In config/environments/test.rb and config/environments/development.rb it can be:
+
+ HOST = "localhost"
+
+In production.rb it must be the actual host your application is deployed to.
+The constant is used by mailers to generate URLs in emails.
+
+2. In config/environment.rb:
+
+ DO_NOT_REPLY = "donotreply@example.com"
+
+3. Define root_url to *something* in your config/routes.rb:
+
+ map.root :controller => 'home'
+
+*******************************************************************************
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/factories.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/factories.rb
new file mode 100644
index 0000000..9bdd13a
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/factories.rb
@@ -0,0 +1,13 @@
+Factory.sequence :email do |n|
+ "user#{n}@example.com"
+end
+
+Factory.define :user do |user|
+ user.email { Factory.next :email }
+ user.password { "password" }
+ user.password_confirmation { "password" }
+end
+
+Factory.define :email_confirmed_user, :parent => :user do |user|
+ user.email_confirmed { true }
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/create_users.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/create_users.rb
new file mode 100644
index 0000000..22e921a
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/create_users.rb
@@ -0,0 +1,21 @@
+class ClearanceCreateUsers < ActiveRecord::Migration
+ def self.up
+ create_table(:users) do |t|
+ t.string :email
+ t.string :encrypted_password, :limit => 128
+ t.string :salt, :limit => 128
+ t.string :token, :limit => 128
+ t.datetime :token_expires_at
+ t.boolean :email_confirmed, :default => false, :null => false
+ t.timestamps
+ end
+
+ add_index :users, [:id, :token]
+ add_index :users, :email
+ add_index :users, :token
+ end
+
+ def self.down
+ drop_table :users
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/update_users.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/update_users.rb
new file mode 100644
index 0000000..4a329fa
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/migrations/update_users.rb
@@ -0,0 +1,41 @@
+class ClearanceUpdateUsers < ActiveRecord::Migration
+ def self.up
+<%
+ existing_columns = ActiveRecord::Base.connection.columns(:users).collect { |each| each.name }
+ columns = [
+ [:email, 't.string :email'],
+ [:encrypted_password, 't.string :encrypted_password, :limit => 128'],
+ [:salt, 't.string :salt, :limit => 128'],
+ [:token, 't.string :token, :limit => 128'],
+ [:token_expires_at, 't.datetime :token_expires_at'],
+ [:email_confirmed, 't.boolean :email_confirmed, :default => false, :null => false']
+ ].delete_if {|c| existing_columns.include?(c.first.to_s)}
+-%>
+ change_table(:users) do |t|
+<% columns.each do |c| -%>
+ <%= c.last %>
+<% end -%>
+ end
+
+<%
+ existing_indexes = ActiveRecord::Base.connection.indexes(:users)
+ index_names = existing_indexes.collect { |each| each.name }
+ new_indexes = [
+ [:index_users_on_id_and_token, 'add_index :users, [:id, :token]'],
+ [:index_users_on_email, 'add_index :users, :email'],
+ [:index_users_on_token, 'add_index :users, :token']
+ ].delete_if { |each| index_names.include?(each.first.to_s) }
+-%>
+<% new_indexes.each do |each| -%>
+ <%= each.last %>
+<% end -%>
+ end
+
+ def self.down
+ change_table(:users) do |t|
+<% unless columns.empty? -%>
+ t.remove <%= columns.collect { |each| ":#{each.first}" }.join(',') %>
+<% end -%>
+ end
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/user.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/user.rb
new file mode 100644
index 0000000..6d077a1
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance/templates/user.rb
@@ -0,0 +1,3 @@
+class User < ActiveRecord::Base
+ include Clearance::User
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/USAGE b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/USAGE
new file mode 100644
index 0000000..3758c0b
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/USAGE
@@ -0,0 +1 @@
+script/generate clearance_features
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/clearance_features_generator.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/clearance_features_generator.rb
new file mode 100644
index 0000000..477afd8
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/clearance_features_generator.rb
@@ -0,0 +1,20 @@
+class ClearanceFeaturesGenerator < Rails::Generator::Base
+
+ def manifest
+ record do |m|
+ m.directory File.join("features", "step_definitions")
+ m.directory File.join("features", "support")
+
+ ["features/step_definitions/clearance_steps.rb",
+ "features/step_definitions/factory_girl_steps.rb",
+ "features/support/paths.rb",
+ "features/sign_in.feature",
+ "features/sign_out.feature",
+ "features/sign_up.feature",
+ "features/password_reset.feature"].each do |file|
+ m.file file, file
+ end
+ end
+ end
+
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/password_reset.feature b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/password_reset.feature
new file mode 100644
index 0000000..51b77f7
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/password_reset.feature
@@ -0,0 +1,33 @@
+Feature: Password reset
+ In order to sign in even if user forgot their password
+ A user
+ Should be able to reset it
+
+ Scenario: User is not signed up
+ Given no user exists with an email of "email@person.com"
+ When I request password reset link to be sent to "email@person.com"
+ Then I should see "Unknown email"
+
+ Scenario: User is signed up and requests password reset
+ Given I signed up with "email@person.com/password"
+ When I request password reset link to be sent to "email@person.com"
+ Then I should see "instructions for changing your password"
+ And a password reset message should be sent to "email@person.com"
+
+ Scenario: User is signed up updated his password and types wrong confirmation
+ Given I signed up with "email@person.com/password"
+ When I follow the password reset link sent to "email@person.com"
+ And I update my password with "newpassword/wrongconfirmation"
+ Then I should see error messages
+ And I should be signed out
+
+ Scenario: User is signed up and updates his password
+ Given I signed up with "email@person.com/password"
+ When I follow the password reset link sent to "email@person.com"
+ And I update my password with "newpassword/newpassword"
+ Then I should be signed in
+ When I sign out
+ Then I should be signed out
+ And I sign in as "email@person.com/newpassword"
+ Then I should be signed in
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_in.feature b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_in.feature
new file mode 100644
index 0000000..4b44c39
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_in.feature
@@ -0,0 +1,42 @@
+Feature: Sign in
+ In order to get access to protected sections of the site
+ A user
+ Should be able to sign in
+
+ Scenario: User is not signed up
+ Given no user exists with an email of "email@person.com"
+ When I go to the sign in page
+ And I sign in as "email@person.com/password"
+ Then I should see "Bad email or password"
+ And I should be signed out
+
+ Scenario: User is not confirmed
+ Given I signed up with "email@person.com/password"
+ When I go to the sign in page
+ And I sign in as "email@person.com/password"
+ Then I should see "User has not confirmed email"
+ And I should be signed out
+
+ Scenario: User enters wrong password
+ Given I am signed up and confirmed as "email@person.com/password"
+ When I go to the sign in page
+ And I sign in as "email@person.com/wrongpassword"
+ Then I should see "Bad email or password"
+ And I should be signed out
+
+ Scenario: User signs in successfully
+ Given I am signed up and confirmed as "email@person.com/password"
+ When I go to the sign in page
+ And I sign in as "email@person.com/password"
+ Then I should see "Signed in"
+ And I should be signed in
+
+ Scenario: User signs in and checks "remember me"
+ Given I am signed up and confirmed as "email@person.com/password"
+ When I go to the sign in page
+ And I sign in with "remember me" as "email@person.com/password"
+ Then I should see "Signed in"
+ And I should be signed in
+ When I return next time
+ Then I should be signed in
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_out.feature b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_out.feature
new file mode 100644
index 0000000..2107226
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_out.feature
@@ -0,0 +1,23 @@
+Feature: Sign out
+ To protect my account from unauthorized access
+ A signed in user
+ Should be able to sign out
+
+ Scenario: User signs out
+ Given I am signed up and confirmed as "email@person.com/password"
+ When I sign in as "email@person.com/password"
+ Then I should be signed in
+ And I sign out
+ Then I should see "Signed out"
+ And I should be signed out
+
+ Scenario: User who was remembered signs out
+ Given I am signed up and confirmed as "email@person.com/password"
+ When I sign in with "remember me" as "email@person.com/password"
+ Then I should be signed in
+ And I sign out
+ Then I should see "Signed out"
+ And I should be signed out
+ When I return next time
+ Then I should be signed out
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_up.feature b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_up.feature
new file mode 100644
index 0000000..4bb565d
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/sign_up.feature
@@ -0,0 +1,45 @@
+Feature: Sign up
+ In order to get access to protected sections of the site
+ A user
+ Should be able to sign up
+
+ Scenario: User signs up with invalid data
+ When I go to the sign up page
+ And I fill in "Email" with "invalidemail"
+ And I fill in "Password" with "password"
+ And I fill in "Confirm password" with ""
+ And I press "Sign Up"
+ Then I should see error messages
+
+ Scenario: User signs up with valid data
+ When I go to the sign up page
+ And I fill in "Email" with "email@person.com"
+ And I fill in "Password" with "password"
+ And I fill in "Confirm password" with "password"
+ And I press "Sign Up"
+ Then I should see "instructions for confirming"
+ And a confirmation message should be sent to "email@person.com"
+
+ Scenario: User confirms his account
+ Given I signed up with "email@person.com/password"
+ When I follow the confirmation link sent to "email@person.com"
+ Then I should see "Confirmed email and signed in"
+ And I should be signed in
+
+ Scenario: Signed in user clicks confirmation link again
+ Given I signed up with "email@person.com/password"
+ When I follow the confirmation link sent to "email@person.com"
+ Then I should be signed in
+ When I follow the confirmation link sent to "email@person.com"
+ Then I should see "Confirmed email and signed in"
+ And I should be signed in
+
+ Scenario: Signed out user clicks confirmation link again
+ Given I signed up with "email@person.com/password"
+ When I follow the confirmation link sent to "email@person.com"
+ Then I should be signed in
+ When I sign out
+ And I follow the confirmation link sent to "email@person.com"
+ Then I should see "Already confirmed email. Please sign in."
+ And I should be signed out
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
new file mode 100644
index 0000000..52ac7f4
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
@@ -0,0 +1,110 @@
+# General
+
+Then /^I should see error messages$/ do
+ assert_match /error(s)? prohibited/m, response.body
+end
+
+# Database
+
+Given /^no user exists with an email of "(.*)"$/ do |email|
+ assert_nil User.find_by_email(email)
+end
+
+Given /^I signed up with "(.*)\/(.*)"$/ do |email, password|
+ user = Factory :user,
+ :email => email,
+ :password => password,
+ :password_confirmation => password
+end
+
+Given /^I am signed up and confirmed as "(.*)\/(.*)"$/ do |email, password|
+ user = Factory :email_confirmed_user,
+ :email => email,
+ :password => password,
+ :password_confirmation => password
+end
+
+# Session
+
+Then /^I should be signed in$/ do
+ assert controller.signed_in?
+end
+
+Then /^I should be signed out$/ do
+ assert ! controller.signed_in?
+end
+
+When /^session is cleared$/ do
+ request.reset_session
+ controller.instance_variable_set(:@_current_user, nil)
+end
+
+# Emails
+
+Then /^a confirmation message should be sent to "(.*)"$/ do |email|
+ user = User.find_by_email(email)
+ sent = ActionMailer::Base.deliveries.first
+ assert_equal [user.email], sent.to
+ assert_match /confirm/i, sent.subject
+ assert !user.token.blank?
+ assert_match /#{user.token}/, sent.body
+end
+
+When /^I follow the confirmation link sent to "(.*)"$/ do |email|
+ user = User.find_by_email(email)
+ visit new_user_confirmation_path(:user_id => user, :token => user.token)
+end
+
+Then /^a password reset message should be sent to "(.*)"$/ do |email|
+ user = User.find_by_email(email)
+ sent = ActionMailer::Base.deliveries.first
+ assert_equal [user.email], sent.to
+ assert_match /password/i, sent.subject
+ assert !user.token.blank?
+ assert_match /#{user.token}/, sent.body
+end
+
+When /^I follow the password reset link sent to "(.*)"$/ do |email|
+ user = User.find_by_email(email)
+ visit edit_user_password_path(:user_id => user, :token => user.token)
+end
+
+When /^I try to change the password of "(.*)" without token$/ do |email|
+ user = User.find_by_email(email)
+ visit edit_user_password_path(:user_id => user)
+end
+
+Then /^I should be forbidden$/ do
+ assert_response :forbidden
+end
+
+# Actions
+
+When /^I sign in( with "remember me")? as "(.*)\/(.*)"$/ do |remember, email, password|
+ When %{I go to the sign in page}
+ And %{I fill in "Email" with "#{email}"}
+ And %{I fill in "Password" with "#{password}"}
+ And %{I check "Remember me"} if remember
+ And %{I press "Sign In"}
+end
+
+When /^I sign out$/ do
+ visit '/session', :delete
+end
+
+When /^I request password reset link to be sent to "(.*)"$/ do |email|
+ When %{I go to the password reset request page}
+ And %{I fill in "Email address" with "#{email}"}
+ And %{I press "Reset password"}
+end
+
+When /^I update my password with "(.*)\/(.*)"$/ do |password, confirmation|
+ And %{I fill in "Choose password" with "#{password}"}
+ And %{I fill in "Confirm password" with "#{confirmation}"}
+ And %{I press "Save this password"}
+end
+
+When /^I return next time$/ do
+ When %{session is cleared}
+ And %{I go to the homepage}
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
new file mode 100644
index 0000000..6337f66
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
@@ -0,0 +1,5 @@
+Factory.factories.each do |name, factory|
+ Given /^an? #{name} exists with an? (.*) of "([^"]*)"$/ do |attr, value|
+ Factory(name, attr.gsub(' ', '_') => value)
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/support/paths.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/support/paths.rb
new file mode 100644
index 0000000..62ba3d5
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_features/templates/features/support/paths.rb
@@ -0,0 +1,22 @@
+module NavigationHelpers
+ def path_to(page_name)
+ case page_name
+
+ when /the homepage/i
+ root_path
+ when /the sign up page/i
+ new_user_path
+ when /the sign in page/i
+ new_session_path
+ when /the password reset request page/i
+ new_password_path
+
+ # Add more page name => path mappings here
+
+ else
+ raise "Can't find mapping from \"#{page_name}\" to a path."
+ end
+ end
+end
+
+World(NavigationHelpers)
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/USAGE b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/USAGE
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/USAGE
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/clearance_views_generator.rb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/clearance_views_generator.rb
new file mode 100644
index 0000000..6075ed8
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/clearance_views_generator.rb
@@ -0,0 +1,27 @@
+class ClearanceViewsGenerator < Rails::Generator::Base
+
+ def manifest
+ record do |m|
+ strategy = "formtastic"
+ template_strategy = "erb"
+
+ m.directory File.join("app", "views", "users")
+ m.file "#{strategy}/users/new.html.#{template_strategy}",
+ "app/views/users/new.html.#{template_strategy}"
+ m.file "#{strategy}/users/_inputs.html.#{template_strategy}",
+ "app/views/users/_inputs.html.#{template_strategy}"
+
+ m.directory File.join("app", "views", "sessions")
+ m.file "#{strategy}/sessions/new.html.#{template_strategy}",
+ "app/views/sessions/new.html.#{template_strategy}"
+
+ m.directory File.join("app", "views", "passwords")
+ m.file "#{strategy}/passwords/new.html.#{template_strategy}",
+ "app/views/passwords/new.html.#{template_strategy}"
+ m.file "#{strategy}/passwords/edit.html.#{template_strategy}",
+ "app/views/passwords/edit.html.#{template_strategy}"
+ end
+ end
+
+end
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/templates/formtastic/passwords/edit.html.erb b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/templates/formtastic/passwords/edit.html.erb
new file mode 100644
index 0000000..9cb7112
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/generators/clearance_views/templates/formtastic/passwords/edit.html.erb
@@ -0,0 +1,21 @@
+
Change your password
+
+
+ Your password has been reset. Choose a new password below.
+
+
+<% semantic_form_for @user do |form| %>
+ <%= form.error_messages %>
+ <%= render :partial => "/users/inputs", :locals => { :form => form } %>
+ <% form.buttons do %>
+ <%= form.commit_button "Sign up" %>
+ <% end %>
+<% end %>
+
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance.rb
new file mode 100644
index 0000000..260c4d6
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance.rb
@@ -0,0 +1,6 @@
+require 'clearance/extensions/errors'
+require 'clearance/extensions/rescue'
+require 'clearance/extensions/routes'
+
+require 'clearance/authentication'
+require 'clearance/user'
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/authentication.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/authentication.rb
new file mode 100644
index 0000000..303ffd6
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/authentication.rb
@@ -0,0 +1,102 @@
+module Clearance
+ module Authentication
+
+ def self.included(controller)
+ controller.send(:include, InstanceMethods)
+
+ controller.class_eval do
+ helper_method :current_user, :signed_in?, :signed_out?
+ hide_action :current_user, :signed_in?, :signed_out?
+ end
+ end
+
+ module InstanceMethods
+ def current_user
+ @_current_user ||= (user_from_cookie || user_from_session)
+ end
+
+ def signed_in?
+ ! current_user.nil?
+ end
+
+ def signed_out?
+ current_user.nil?
+ end
+
+ protected
+
+ def authenticate
+ deny_access unless signed_in?
+ end
+
+ def user_from_session
+ if session[:user_id]
+ return nil unless user = ::User.find_by_id(session[:user_id])
+ return user if user.email_confirmed?
+ end
+ end
+
+ def user_from_cookie
+ if token = cookies[:remember_token]
+ return nil unless user = ::User.find_by_token(token)
+ return user if user.remember?
+ end
+ end
+
+ def sign_user_in(user)
+ warn "[DEPRECATION] sign_user_in: unnecessary. use sign_in(user) instead."
+ sign_in(user)
+ end
+
+ def sign_in(user)
+ if user
+ session[:user_id] = user.id
+ end
+ end
+
+ def remember?
+ params[:session] && params[:session][:remember_me] == "1"
+ end
+
+ def remember(user)
+ user.remember_me!
+ cookies[:remember_token] = { :value => user.token,
+ :expires => user.token_expires_at }
+ end
+
+ def forget(user)
+ user.forget_me! if user
+ cookies.delete(:remember_token)
+ reset_session
+ end
+
+ def redirect_back_or(default)
+ redirect_to(return_to || default)
+ clear_return_to
+ end
+
+ def return_to
+ session[:return_to] || params[:return_to]
+ end
+
+ def clear_return_to
+ session[:return_to] = nil
+ end
+
+ def redirect_to_root
+ redirect_to(root_url)
+ end
+
+ def store_location
+ session[:return_to] = request.request_uri if request.get?
+ end
+
+ def deny_access(flash_message = nil, opts = {})
+ store_location
+ flash[:failure] = flash_message if flash_message
+ redirect_to(new_session_url)
+ end
+ end
+
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/errors.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/errors.rb
new file mode 100644
index 0000000..d6b19bf
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/errors.rb
@@ -0,0 +1,6 @@
+if defined?(ActionController)
+ module ActionController
+ class Forbidden < StandardError
+ end
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/rescue.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/rescue.rb
new file mode 100644
index 0000000..7afe4ad
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/rescue.rb
@@ -0,0 +1,3 @@
+if defined?(ActionController::Base)
+ ActionController::Base.rescue_responses.update('ActionController::Forbidden' => :forbidden)
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/routes.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/routes.rb
new file mode 100644
index 0000000..1a6c43b
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/extensions/routes.rb
@@ -0,0 +1,14 @@
+if defined?(ActionController::Routing::RouteSet)
+ class ActionController::Routing::RouteSet
+ def load_routes_with_clearance!
+ lib_path = File.dirname(__FILE__)
+ clearance_routes = File.join(lib_path, *%w[.. .. .. config clearance_routes.rb])
+ unless configuration_files.include?(clearance_routes)
+ add_configuration_file(clearance_routes)
+ end
+ load_routes_without_clearance!
+ end
+
+ alias_method_chain :load_routes!, :clearance
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/user.rb b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/user.rb
new file mode 100644
index 0000000..f6206e9
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/lib/clearance/user.rb
@@ -0,0 +1,143 @@
+require 'digest/sha1'
+
+module Clearance
+ module User
+
+ def self.included(model)
+ model.extend(ClassMethods)
+
+ model.send(:include, InstanceMethods)
+ model.send(:include, AttrAccessible)
+ model.send(:include, AttrAccessor)
+ model.send(:include, Validations)
+ model.send(:include, Callbacks)
+ end
+
+ module AttrAccessible
+ def self.included(model)
+ model.class_eval do
+ attr_accessible :email, :password, :password_confirmation
+ end
+ end
+ end
+
+ module AttrAccessor
+ def self.included(model)
+ model.class_eval do
+ attr_accessor :password, :password_confirmation
+ end
+ end
+ end
+
+ module Validations
+ def self.included(model)
+ model.class_eval do
+ validates_presence_of :email
+ validates_uniqueness_of :email, :case_sensitive => false
+ validates_format_of :email, :with => %r{.+@.+\..+}
+
+ validates_presence_of :password, :if => :password_required?
+ validates_confirmation_of :password, :if => :password_required?
+ end
+ end
+ end
+
+ module Callbacks
+ def self.included(model)
+ model.class_eval do
+ before_save :initialize_salt, :encrypt_password, :initialize_token
+ end
+ end
+ end
+
+ module InstanceMethods
+ def authenticated?(password)
+ encrypted_password == encrypt(password)
+ end
+
+ def encrypt(string)
+ generate_hash("--#{salt}--#{string}--")
+ end
+
+ def remember?
+ token_expires_at && Time.now.utc < token_expires_at
+ end
+
+ def remember_me!
+ remember_me_until! 2.weeks.from_now.utc
+ end
+
+ def forget_me!
+ clear_token
+ save(false)
+ end
+
+ def confirm_email!
+ self.email_confirmed = true
+ self.token = nil
+ save(false)
+ end
+
+ def forgot_password!
+ generate_token
+ save(false)
+ end
+
+ def update_password(new_password, new_password_confirmation)
+ self.password = new_password
+ self.password_confirmation = new_password_confirmation
+ clear_token if valid?
+ save
+ end
+
+ protected
+
+ def generate_hash(string)
+ Digest::SHA1.hexdigest(string)
+ end
+
+ def initialize_salt
+ if new_record?
+ self.salt = generate_hash("--#{Time.now.utc.to_s}--#{password}--")
+ end
+ end
+
+ def encrypt_password
+ return if password.blank?
+ self.encrypted_password = encrypt(password)
+ end
+
+ def generate_token
+ self.token = encrypt("--#{Time.now.utc.to_s}--#{password}--")
+ self.token_expires_at = nil
+ end
+
+ def clear_token
+ self.token = nil
+ self.token_expires_at = nil
+ end
+
+ def initialize_token
+ generate_token if new_record?
+ end
+
+ def password_required?
+ encrypted_password.blank? || !password.blank?
+ end
+
+ def remember_me_until!(time)
+ self.token_expires_at = time
+ self.token = encrypt("--#{token_expires_at}--#{password}--")
+ save(false)
+ end
+ end
+
+ module ClassMethods
+ def authenticate(email, password)
+ return nil unless user = find_by_email(email)
+ return user if user.authenticated?(password)
+ end
+ end
+
+ end
+end
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/rails/init.rb b/vendor/gems/thoughtbot-clearance-0.7.0/rails/init.rb
new file mode 100644
index 0000000..5ed1d1b
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/rails/init.rb
@@ -0,0 +1 @@
+require 'clearance'
\ No newline at end of file
diff --git a/vendor/gems/thoughtbot-clearance-0.7.0/shoulda_macros/clearance.rb b/vendor/gems/thoughtbot-clearance-0.7.0/shoulda_macros/clearance.rb
new file mode 100644
index 0000000..10bc99c
--- /dev/null
+++ b/vendor/gems/thoughtbot-clearance-0.7.0/shoulda_macros/clearance.rb
@@ -0,0 +1,268 @@
+module Clearance
+ module Shoulda
+
+ # STATE OF AUTHENTICATION
+
+ def should_be_signed_in_as(&block)
+ should "be signed in as #{block.bind(self).call}" do
+ user = block.bind(self).call
+ assert_not_nil user,
+ "please pass a User. try: should_be_signed_in_as { @user }"
+ assert_equal user, @controller.send(:current_user),
+ "#{user.inspect} is not the current_user, " <<
+ "which is #{@controller.send(:current_user).inspect}"
+ end
+ end
+
+ def should_be_signed_in_and_email_confirmed_as(&block)
+ warn "[DEPRECATION] should_be_signed_in_and_email_confirmed_as: questionable usefulness"
+ should_be_signed_in_as &block
+
+ should "have confirmed email" do
+ user = block.bind(self).call
+
+ assert_not_nil user
+ assert_equal user, assigns(:user)
+ assert assigns(:user).email_confirmed?
+ end
+ end
+
+ def should_not_be_signed_in
+ should "not be signed in" do
+ assert_nil session[:user_id]
+ end
+ end
+
+ def should_deny_access_on(http_method, action, opts = {})
+ warn "[DEPRECATION] should_deny_access_on: use a setup & should_deny_access(:flash => ?)"
+ flash_message = opts.delete(:flash)
+ context "on #{http_method} to #{action}" do
+ setup do
+ send(http_method, action, opts)
+ end
+
+ should_deny_access(:flash => flash_message)
+ end
+ end
+
+ def should_deny_access(opts = {})
+ if opts[:flash]
+ should_set_the_flash_to opts[:flash]
+ else
+ should_not_set_the_flash
+ end
+
+ should_redirect_to('new_session_url') { new_session_url }
+ end
+
+ # HTTP FLUENCY
+
+ def should_forbid(description, &block)
+ should "forbid #{description}" do
+ assert_raises ActionController::Forbidden do
+ instance_eval(&block)
+ end
+ end
+ end
+
+ # CONTEXTS
+
+ def signed_in_user_context(&blk)
+ warn "[DEPRECATION] signed_in_user_context: creates a Mystery Guest, causes Obscure Test"
+ context "A signed in user" do
+ setup do
+ @user = Factory(:user)
+ @user.confirm_email!
+ sign_in_as @user
+ end
+ merge_block(&blk)
+ end
+ end
+
+ def public_context(&blk)
+ warn "[DEPRECATION] public_context: common case is no-op. call sign_out otherwise"
+ context "The public" do
+ setup { sign_out }
+ merge_block(&blk)
+ end
+ end
+
+ # CREATING USERS
+
+ def should_create_user_successfully
+ warn "[DEPRECATION] should_create_user_successfully: not meant to be public, no longer used internally"
+ should_assign_to :user
+ should_change 'User.count', :by => 1
+
+ should "send the confirmation email" do
+ assert_sent_email do |email|
+ email.subject =~ /account confirmation/i
+ end
+ end
+
+ should_set_the_flash_to /confirm/i
+ should_redirect_to_url_after_create
+ end
+
+ # RENDERING
+
+ def should_render_nothing
+ should "render nothing" do
+ assert @response.body.blank?
+ end
+ end
+
+ # REDIRECTS
+
+ def should_redirect_to_url_after_create
+ should_redirect_to("the post-create url") do
+ @controller.send(:url_after_create)
+ end
+ end
+
+ def should_redirect_to_url_after_update
+ should_redirect_to("the post-update url") do
+ @controller.send(:url_after_update)
+ end
+ end
+
+ def should_redirect_to_url_after_destroy
+ should_redirect_to("the post-destroy url") do
+ @controller.send(:url_after_destroy)
+ end
+ end
+
+ def should_redirect_to_url_already_confirmed
+ should_redirect_to("the already confirmed url") do
+ @controller.send(:url_already_confirmed)
+ end
+ end
+
+ # VALIDATIONS
+
+ def should_validate_confirmation_of(attribute, opts = {})
+ warn "[DEPRECATION] should_validate_confirmation_of: not meant to be public, no longer used internally"
+ raise ArgumentError if opts[:factory].nil?
+
+ context "on save" do
+ should_validate_confirmation_is_not_blank opts[:factory], attribute
+ should_validate_confirmation_is_not_bad opts[:factory], attribute
+ end
+ end
+
+ def should_validate_confirmation_is_not_blank(factory, attribute, opts = {})
+ warn "[DEPRECATION] should_validate_confirmation_is_not_blank: not meant to be public, no longer used internally"
+ should "validate #{attribute}_confirmation is not blank" do
+ model = Factory.build(factory, blank_confirmation_options(attribute))
+ model.save
+ assert_confirmation_error(model, attribute,
+ "#{attribute}_confirmation cannot be blank")
+ end
+ end
+
+ def should_validate_confirmation_is_not_bad(factory, attribute, opts = {})
+ warn "[DEPRECATION] should_validate_confirmation_is_not_bad: not meant to be public, no longer used internally"
+ should "validate #{attribute}_confirmation is different than #{attribute}" do
+ model = Factory.build(factory, bad_confirmation_options(attribute))
+ model.save
+ assert_confirmation_error(model, attribute,
+ "#{attribute}_confirmation cannot be different than #{attribute}")
+ end
+ end
+
+ # FORMS
+
+ def should_display_a_password_update_form
+ warn "[DEPRECATION] should_display_a_password_update_form: not meant to be public, no longer used internally"
+ should "have a form for the user's token, password, and password confirm" do
+ update_path = ERB::Util.h(
+ user_password_path(@user, :token => @user.token)
+ )
+
+ assert_select 'form[action=?]', update_path do
+ assert_select 'input[name=_method][value=?]', 'put'
+ assert_select 'input[name=?]', 'user[password]'
+ assert_select 'input[name=?]', 'user[password_confirmation]'
+ end
+ end
+ end
+
+ def should_display_a_sign_up_form
+ warn "[DEPRECATION] should_display_a_sign_up_form: not meant to be public, no longer used internally"
+ should "display a form to sign up" do
+ assert_select "form[action=#{users_path}][method=post]",
+ true, "There must be a form to sign up" do
+ assert_select "input[type=text][name=?]",
+ "user[email]", true, "There must be an email field"
+ assert_select "input[type=password][name=?]",
+ "user[password]", true, "There must be a password field"
+ assert_select "input[type=password][name=?]",
+ "user[password_confirmation]", true, "There must be a password confirmation field"
+ assert_select "input[type=submit]", true,
+ "There must be a submit button"
+ end
+ end
+ end
+
+ def should_display_a_sign_in_form
+ warn "[DEPRECATION] should_display_a_sign_in_form: not meant to be public, no longer used internally"
+ should 'display a "sign in" form' do
+ assert_select "form[action=#{session_path}][method=post]",
+ true, "There must be a form to sign in" do
+ assert_select "input[type=text][name=?]",
+ "session[email]", true, "There must be an email field"
+ assert_select "input[type=password][name=?]",
+ "session[password]", true, "There must be a password field"
+ assert_select "input[type=checkbox][name=?]",
+ "session[remember_me]", true, "There must be a 'remember me' check box"
+ assert_select "input[type=submit]", true,
+ "There must be a submit button"
+ end
+ end
+ end
+ end
+end
+
+module Clearance
+ module Shoulda
+ module Helpers
+ def sign_in_as(user)
+ @controller.class_eval { attr_accessor :current_user }
+ @controller.current_user = user
+ return user
+ end
+
+ def sign_in
+ sign_in_as Factory(:email_confirmed_user)
+ end
+
+ def sign_out
+ @controller.class_eval { attr_accessor :current_user }
+ @controller.current_user = nil
+ end
+
+ def blank_confirmation_options(attribute)
+ warn "[DEPRECATION] blank_confirmation_options: not meant to be public, no longer used internally"
+ opts = { attribute => attribute.to_s }
+ opts.merge("#{attribute}_confirmation".to_sym => "")
+ end
+
+ def bad_confirmation_options(attribute)
+ warn "[DEPRECATION] bad_confirmation_options: not meant to be public, no longer used internally"
+ opts = { attribute => attribute.to_s }
+ opts.merge("#{attribute}_confirmation".to_sym => "not_#{attribute}")
+ end
+
+ def assert_confirmation_error(model, attribute, message = "confirmation error")
+ warn "[DEPRECATION] assert_confirmation_error: not meant to be public, no longer used internally"
+ assert model.errors.on(attribute).include?("doesn't match confirmation"),
+ message
+ end
+ end
+ end
+end
+
+class Test::Unit::TestCase
+ include Clearance::Shoulda::Helpers
+end
+Test::Unit::TestCase.extend(Clearance::Shoulda)
diff --git a/vendor/plugins/clearance/CHANGELOG.textile b/vendor/plugins/clearance/CHANGELOG.textile
deleted file mode 100644
index 3c27788..0000000
--- a/vendor/plugins/clearance/CHANGELOG.textile
+++ /dev/null
@@ -1,167 +0,0 @@
-h2. 0.6.9 (07/04/2009)
-
-* Added timestamps to create users migration. (Dan Croak)
-* Ready for Ruby 1.9. (Jason Morrison, Nick Quaranto)
-
-h2. 0.6.8 (06/24/2009)
-
-* Added defined? checks for various Rails constants such as ActionController
-for easier unit testing of Clearance extensions... particularly ActiveRecord
-extensions... particularly strong_password. (Dan Croak)
-
-h2. 0.6.7 (06/13/2009)
-
-* [#30] Added sign_up, sign_in, sign_out named routes. (Dan Croak)
-* [#22] Minimizing Reek smell: Duplication in redirect_back_or. (Dan Croak)
-* Deprecated sign_user_in. Told developers to use sign_in instead. (Dan
-Croak)
-* [#16] flash_success_after_create, flash_notice_after_create, flash_failure_after_create, flash_sucess_after_update, flash_success_after_destroy, etc. (Dan Croak)
-* [#17] bug. added #create to forbidden before_filters on confirmations controller. (Dan Croak)
-* [#24] should_be_signed_in_as shouldn't look in the session. (Dan Croak)
-* README improvements. (Dan Croak)
-* Move routes loading to separate file. (Joshua Clayton)
-
-h2. 0.6.6 (05/18/2009)
-
-* [#14] replaced class_eval in Clearance::User with modules. This was needed
-in a thoughtbot client app so we could write our own validations. (Dan Croak)
-
-h2. 0.6.5 (05/17/2009)
-
-* [#6] Make Clearance i18n aware. (Timur Vafin, Marcel Goerner, Eugene Bolshakov, Dan Croak)
-
-h2. 0.6.4 (05/12/2009)
-
-* Moved issue tracking to Github from Lighthouse. (Dan Croak)
-* [#7] asking higher-level questions of controllers in webrat steps, such as signed_in? instead of what's in the session. same for accessors. (Dan Croak)
-* [#11] replacing sign_in_as & sign_out shoulda macros with a stubbing (requires no dependency) approach. this will avoid dealing with the internals of current_user, such as session & cookies. added sign_in macro which signs in an email confirmed user from clearance's factories. (Dan Croak)
-* [#13] move private methods on sessions controller into Clearance::Authentication module (Dan Croak)
-* [#9] audited flash keys. (Dan Croak)
-
-h2. 0.6.3 (04/23/2009)
-
-* Scoping ClearanceMailer properly within controllers so it works in production environments. (Nick Quaranto)
-
-h2. 0.6.2 (04/22/2009)
-
-* Insert Clearance::User into User model if it exists. (Nick Quaranto)
-* World(NavigationHelpers) Cucumber 3.0 style. (Shay Arnett & Mark Cornick)
-
-h2. 0.6.1 (04/21/2009)
-* Scope operators are necessary to keep Rails happy. Reverting the original
-revert so they're back in the library now for constants referenced inside of
-the gem. (Nick Quaranto)
-
-h2. 0.6.0 (04/21/2009)
-
-* Converted Clearance to a Rails engine. (Dan Croak & Joe Ferris)
-* Include Clearance::User in User model in app. (Dan Croak & Joe Ferris)
-* Include Clearance::Authentication in ApplicationController. (Dan Croak & Joe Ferris)
-* Namespace controllers under Clearance. (Dan Croak & Joe Ferris)
-* Routes move to engine, use namespaced controllers but publicly the same. (Dan Croak & Joe Ferris)
-* If you want to override a controller, subclass it like SessionsController <
-Clearance::SessionsController. This gives you access to usual hooks such as
-url_after_create. (Dan Croak & Joe Ferris)
-* Controllers, mailer, model, routes all unit tested inside engine. Use
-script/generate clearance_features to test integration of Clearance with your
-Rails app. No longer including modules in your app's test files. (Dan Croak & Joe Ferris)
-* Moved views to engine. (Joe Ferris)
-* Converted generated test/factories/clearance.rb to use inheritence for
-email_confirmed_user. (Dan Croak)
-* Corrected some spelling errors with methods (Nick Quaranto)
-* Converted "I should see error messages" to use a regex in the features (Nick
-Quaranto)
-* Loading clearance routes after rails routes via some monkeypatching (Nick
-Quaranto)
-* Made the clearance controllers unloadable to stop constant loading errors in
-development mode (Nick Quaranto)
-
-h2. 0.5.6 (4/11/2009)
-
-* [#57] Step definition changed for "User should see error messages" so
-features won't fail for certain validations. (Nick Quaranto)
-
-h2. 0.5.5 (3/23/2009)
-
-* Removing duplicate test to get rid of warning. (Nick Quaranto)
-
-h2. 0.5.4 (3/21/2009)
-
-* When users fail logging in, redirect them instead of rendering. (Matt
-Jankowski)
-
-h2. 0.5.3 (3/5/2009)
-
-* Clearance now works with (and requires) Shoulda 2.10.0. (Mark Cornick, Joe
-Ferris, Dan Croak)
-* Prefer flat over nested contexts in sessions_controller_test. (Joe Ferris,
-Dan Croak)
-
-h2. 0.5.2 (3/2/2009)
-
-* Fixed last remaining errors in Rails 2.3 tests. Now fully compatible. (Joe
-Ferris, Dan Croak)
-
-h2. 0.5.1 (2/27/2009)
-
-* [#46] A user with unconfirmed email who resets password now confirms email.
-(Marcel Görner)
-* Refactored user_from_cookie, user_from_session, User#authenticate to use
-more direct return code instead of ugly, harder to read ternary. (Dan Croak)
-* Switch order of cookies and sessions to take advantage of Rails 2.3's "Rack-based lazy-loaded sessions":http://is.gd/i23E. (Dan Croak)
-* Altered generator to interact with application_controller.rb instead of
-application.rb in Rails 2.3 apps. (Dan Croak)
-* [#42] Bug fix. Rack-based session change altered how to test remember me
-cookie. (Mihai Anca)
-
-h2. 0.5.0 (2/27/2009)
-
-* Fixed problem with Cucumber features. (Dan Croak)
-* Fixed mising HTTP fluency use case. (Dan Croak)
-* Refactored User#update_password to take just parameters it needs. (Dan
-Croak)
-* Refactored User unit tests to be more readable. (Dan Croak)
-
-h2. 0.4.9 (2/20/2009)
-
-* Protect passwords & confirmations actions with forbidden filters. (Dan Croak)
-* Return 403 Forbidden status code in those cases. (Tim Pope)
-* Test 403 Forbidden status code in Cucumber feature. (Dan Croak, Joe Ferris)
-* Raise custom ActionController::Forbidden error internally. (Joe Ferris, Mike Burns, Jason Morrison)
-* Test ActionController::Forbidden error is raised in functional test. (Joe Ferris, Mike Burns, Dan Croak)
-* [#45] Fixed bug that allowed anyone to edit another user's password (Marcel Görner)
-* Required Factory Girl >= 1.2.0. (Dan Croak)
-
-h2. 0.4.8 (2/16/2009)
-
-* Added support paths for Cucumber. (Ben Mabey)
-* Added documentation for the flash. (Ben Mabey)
-* Generators require "test_helper" instead of File.join. for rr compatibility. (Joe Ferris)
-* Removed interpolated email address from flash message to make i18n easier. (Bence Nagy)
-* Standardized flash messages that refer to email delivery. (Dan Croak)
-
-h2. 0.4.7 (2/12/2009)
-
-* Removed Clearance::Test::TestHelper so there is one less setup step. (Dan Croak)
-* All test helpers now in shoulda_macros. (Dan Croak)
-
-h2. 0.4.6 (2/11/2009)
-
-* Made the modules behave like mixins again. (hat-tip Eloy Duran)
-* Created Actions and PrivateMethods modules on controllers for future RDoc reasons. (Dan Croak, Joe Ferris)
-
-h2. 0.4.5 (2/9/2009)
-
-* [#43] Removed email downcasing because local-part is case sensitive per RFC5321. (Dan Croak)
-* [#42] Removed dependency on Mocha. (Dan Croak)
-* Required Shoulda >= 2.9.1. (Dan Croak)
-* Added password reset feature to clearance_features generator. (Eugene Bolshakov, Dan Croak)
-* Removed unnecessary session[:salt]. (Dan Croak)
-* [#41] Only store location for session[:return_to] for GET requests. (Dan Croak)
-* Audited "sign up" naming convention. "Register" had slipped in a few places. (Dan Croak)
-* Switched to SHA1 encryption. Cypher doesn't matter much for email confirmation, password reset. Better to have shorter hashes in the emails for clients who line break on 72 chars. (Dan Croak)
-
-h2. 0.4.4 (2/2/2009)
-
-* Added a generator for Cucumber features. (Joe Ferris, Dan Croak)
-* Standarized naming for "Sign up," "Sign in," and "Sign out". (Dan Croak)
diff --git a/vendor/plugins/clearance/LICENSE b/vendor/plugins/clearance/LICENSE
deleted file mode 100644
index 5060183..0000000
--- a/vendor/plugins/clearance/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License
-
-Copyright (c) 2008 thoughtbot, inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/plugins/clearance/README.textile b/vendor/plugins/clearance/README.textile
deleted file mode 100644
index 3aa3687..0000000
--- a/vendor/plugins/clearance/README.textile
+++ /dev/null
@@ -1,123 +0,0 @@
-h1. Clearance
-
-Rails authentication with email & password.
-
-"We have clearance, Clarence.":http://www.youtube.com/v/mNRXJEE3Nz8
-
-h2. Wiki
-
-Most information regarding Clearance is on the "Github Wiki":http://wiki.github.com/thoughtbot/clearance.
-
-h2. Installation
-
-Clearance is a Rails engine. It works with versions of Rails greater than 2.3.
-
-In config/environment.rb:
-
-
-
-Make sure the development database exists and run the generator:
-
-@script/generate clearance@
-
-A number of files will be created and instructions will be printed.
-
-You may already have some of these files. Don't worry. You'll be asked if you want to overwrite them.
-
-Run the migration:
-
-@rake db:migrate@
-
-Define a HOST constant in your environment files.
-In config/environments/test.rb and config/environments/development.rb it can be:
-
-@HOST = "localhost"@
-
-In production.rb it must be the actual host your application is deployed to.
-The constant is used by mailers to generate URLs in emails.
-
-In config/environment.rb:
-
-@DO_NOT_REPLY = "donotreply@example.com"@
-
-Define root_url to *something* in your config/routes.rb:
-
-@map.root :controller => 'home'@
-
-h2. Cucumber Features
-
-As your app evolves, you want to know that authentication still works. Clearance's opinion is that you should test its integration with your app using "Cucumber":http://cukes.info/.
-
-In config/environments/test.rb:
-
-
-
-We don't vendor nokogiri due to its native extensions, so install it normally on your machine:
-
-@sudo gem install nokogiri@
-
-Run the Cucumber generator (if you haven't already) and Clearance's feature generator:
-
-
-
-All of the files generated should be new with the exception of the features/support/paths.rb file. If you have not modified your paths.rb then you will be okay to replace it with this one. If you need to keep your paths.rb file then add these locations in your paths.rb manually:
-
-
-def path_to(page_name)
- case page_name
- ...
- when /the sign up page/i
- new_user_path
- when /the sign in page/i
- new_session_path
- when /the password reset request page/i
- new_password_path
- ...
-end
-
-
-h2. Authors
-
-Clearance was extracted out of "Hoptoad":http://hoptoadapp.com. We merged the authentication code from two of thoughtbot's clients' Rails apps and have since used it each time we need authentication. The following people have improved the library. Thank you!
-
-Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Nick Quaranto, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, Mark Cornick, Shay Arnett, Joshua Clayton & Mustafa Ekim.
-
-h2. Questions?
-
-Ask the "mailing list":http://groups.google.com/group/thoughtbot-clearance
-
-h2. Suggestions, Bugs, Refactoring?
-
-Fork away and create a "Github Issue":http://github.com/thoughtbot/clearance/issues. Please don't send pull requests.
-
diff --git a/vendor/plugins/clearance/Rakefile b/vendor/plugins/clearance/Rakefile
deleted file mode 100644
index b5fd366..0000000
--- a/vendor/plugins/clearance/Rakefile
+++ /dev/null
@@ -1,76 +0,0 @@
-# encoding: utf-8
-
-require 'rake'
-require 'rake/testtask'
-require 'cucumber/rake/task'
-
-namespace :test do
- Rake::TestTask.new(:all => ["generator:cleanup",
- "generator:generate"]) do |task|
- task.libs << "lib"
- task.libs << "test"
- task.pattern = "test/**/*_test.rb"
- task.verbose = false
- end
-
- Cucumber::Rake::Task.new(:features) do |t|
- t.cucumber_opts = "--format progress"
- t.feature_pattern = "test/rails_root/features/*.feature"
- end
-end
-
-generators = %w(clearance clearance_features)
-
-namespace :generator do
- desc "Cleans up the test app before running the generator"
- task :cleanup do
- generators.each do |generator|
- FileList["generators/#{generator}/templates/**/*.*"].each do |each|
- file = "test/rails_root/#{each.gsub("generators/#{generator}/templates/",'')}"
- File.delete(file) if File.exists?(file)
- end
- end
-
- FileList["test/rails_root/db/**/*"].each do |each|
- FileUtils.rm_rf(each)
- end
- FileUtils.rm_rf("test/rails_root/vendor/plugins/clearance")
- FileUtils.mkdir_p("test/rails_root/vendor/plugins")
- clearance_root = File.expand_path(File.dirname(__FILE__))
- system("ln -s #{clearance_root} test/rails_root/vendor/plugins/clearance")
- end
-
- desc "Run the generator on the tests"
- task :generate do
- generators.each do |generator|
- system "cd test/rails_root && ./script/generate #{generator} && rake db:migrate db:test:prepare"
- end
- end
-end
-
-desc "Run the test suite"
-task :default => ['test:all', 'test:features']
-
-gem_spec = Gem::Specification.new do |gem_spec|
- gem_spec.name = "clearance"
- gem_spec.version = "0.6.9"
- gem_spec.summary = "Rails authentication with email & password."
- gem_spec.email = "support@thoughtbot.com"
- gem_spec.homepage = "http://github.com/thoughtbot/clearance"
- gem_spec.description = "Rails authentication with email & password."
- gem_spec.authors = ["Dan Croak", "Mike Burns", "Jason Morrison",
- "Joe Ferris", "Eugene Bolshakov", "Nick Quaranto",
- "Josh Nichols", "Mike Breen", "Marcel Görner",
- "Bence Nagy", "Ben Mabey", "Eloy Duran",
- "Tim Pope", "Mihai Anca", "Mark Cornick",
- "Shay Arnett"]
- gem_spec.files = FileList["[A-Z]*", "{app,config,generators,lib,shoulda_macros,rails}/**/*"]
-end
-
-desc "Generate a gemspec file"
-task :gemspec do
- File.open("#{gem_spec.name}.gemspec", 'w') do |f|
- f.write gem_spec.to_yaml
- end
-end
-
diff --git a/vendor/plugins/clearance/TODO.textile b/vendor/plugins/clearance/TODO.textile
deleted file mode 100644
index 9805aed..0000000
--- a/vendor/plugins/clearance/TODO.textile
+++ /dev/null
@@ -1,6 +0,0 @@
-h1. To-do
-
-* Make insertion of Clearance::User into User model automatic from the generator.
-* Change generated README to include instruction about running the migration.
-* DO_NOT_REPLY, HOST refactoring.
-
diff --git a/vendor/plugins/clearance/app/controllers/clearance/confirmations_controller.rb b/vendor/plugins/clearance/app/controllers/clearance/confirmations_controller.rb
deleted file mode 100644
index 9f1e125..0000000
--- a/vendor/plugins/clearance/app/controllers/clearance/confirmations_controller.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-class Clearance::ConfirmationsController < ApplicationController
- unloadable
-
- before_filter :forbid_confirmed_user, :only => [:new, :create]
- before_filter :forbid_missing_token, :only => [:new, :create]
- before_filter :forbid_non_existent_user, :only => [:new, :create]
- filter_parameter_logging :token
-
- def new
- create
- end
-
- def create
- @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
- @user.confirm_email!
-
- sign_in(@user)
- flash_success_after_create
- redirect_to(url_after_create)
- end
-
- private
-
- def forbid_confirmed_user
- user = ::User.find_by_id(params[:user_id])
- if user && user.email_confirmed?
- raise ActionController::Forbidden, "confirmed user"
- end
- end
-
- def forbid_missing_token
- if params[:token].blank?
- raise ActionController::Forbidden, "missing token"
- end
- end
-
- def forbid_non_existent_user
- unless ::User.find_by_id_and_token(params[:user_id], params[:token])
- raise ActionController::Forbidden, "non-existent user"
- end
- end
-
- def flash_success_after_create
- flash[:success] = translate(:confirmed_email,
- :scope => [:clearance, :controllers, :confirmations],
- :default => "Confirmed email and signed in.")
- end
-
- def url_after_create
- root_url
- end
-end
diff --git a/vendor/plugins/clearance/app/controllers/clearance/passwords_controller.rb b/vendor/plugins/clearance/app/controllers/clearance/passwords_controller.rb
deleted file mode 100644
index 6221ad3..0000000
--- a/vendor/plugins/clearance/app/controllers/clearance/passwords_controller.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-class Clearance::PasswordsController < ApplicationController
- unloadable
-
- before_filter :forbid_missing_token, :only => [:edit, :update]
- before_filter :forbid_non_existent_user, :only => [:edit, :update]
- filter_parameter_logging :password, :password_confirmation
-
- def new
- render :template => 'passwords/new'
- end
-
- def create
- if user = ::User.find_by_email(params[:password][:email])
- user.forgot_password!
- ::ClearanceMailer.deliver_change_password user
- flash_notice_after_create
- redirect_to(url_after_create)
- else
- flash_failure_after_create
- render :template => 'passwords/new'
- end
- end
-
- def edit
- @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
- render :template => 'passwords/edit'
- end
-
- def update
- @user = ::User.find_by_id_and_token(params[:user_id], params[:token])
-
- if @user.update_password(params[:user][:password],
- params[:user][:password_confirmation])
- @user.confirm_email!
- sign_in(@user)
- flash_success_after_update
- redirect_to(url_after_update)
- else
- render :template => 'passwords/edit'
- end
- end
-
- private
-
- def forbid_missing_token
- if params[:token].blank?
- raise ActionController::Forbidden, "missing token"
- end
- end
-
- def forbid_non_existent_user
- unless ::User.find_by_id_and_token(params[:user_id], params[:token])
- raise ActionController::Forbidden, "non-existent user"
- end
- end
-
- def flash_notice_after_create
- flash[:notice] = translate(:deliver_change_password,
- :scope => [:clearance, :controllers, :passwords],
- :default => "You will receive an email within the next few minutes. " <<
- "It contains instructions for changing your password.")
- end
-
- def flash_failure_after_create
- flash.now[:failure] = translate(:unknown_email,
- :scope => [:clearance, :controllers, :passwords],
- :default => "Unknown email.")
- end
-
- def url_after_create
- new_session_url
- end
-
- def flash_success_after_update
- flash[:success] = translate(:signed_in, :default => "Signed in.")
- end
-
- def url_after_update
- root_url
- end
-end
diff --git a/vendor/plugins/clearance/app/controllers/clearance/sessions_controller.rb b/vendor/plugins/clearance/app/controllers/clearance/sessions_controller.rb
deleted file mode 100644
index 2ea0440..0000000
--- a/vendor/plugins/clearance/app/controllers/clearance/sessions_controller.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-class Clearance::SessionsController < ApplicationController
- unloadable
-
- protect_from_forgery :except => :create
- filter_parameter_logging :password
-
- def new
- render :template => 'sessions/new'
- end
-
- def create
- @user = ::User.authenticate(params[:session][:email],
- params[:session][:password])
- if @user.nil?
- flash_failure_after_create
- render :template => 'sessions/new', :status => :unauthorized
- else
- if @user.email_confirmed?
- sign_in(@user)
- remember(@user) if remember?
- flash_success_after_create
- redirect_back_or(url_after_create)
- else
- ::ClearanceMailer.deliver_confirmation(@user)
- flash_notice_after_create
- redirect_to(new_session_url)
- end
- end
- end
-
- def destroy
- forget(current_user)
- flash_success_after_destroy
- redirect_to(url_after_destroy)
- end
-
- private
-
- def flash_failure_after_create
- flash.now[:failure] = translate(:bad_email_or_password,
- :scope => [:clearance, :controllers, :sessions],
- :default => "Bad email or password.")
- end
-
- def flash_success_after_create
- flash[:success] = translate(:signed_in, :default => "Signed in.")
- end
-
- def flash_notice_after_create
- flash[:notice] = translate(:unconfirmed_email,
- :scope => [:clearance, :controllers, :sessions],
- :default => "User has not confirmed email. " <<
- "Confirmation email will be resent.")
- end
-
- def url_after_create
- root_url
- end
-
- def flash_success_after_destroy
- flash[:success] = translate(:signed_out, :default => "Signed out.")
- end
-
- def url_after_destroy
- new_session_url
- end
-end
diff --git a/vendor/plugins/clearance/app/controllers/clearance/users_controller.rb b/vendor/plugins/clearance/app/controllers/clearance/users_controller.rb
deleted file mode 100644
index 6b8659e..0000000
--- a/vendor/plugins/clearance/app/controllers/clearance/users_controller.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-class Clearance::UsersController < ApplicationController
- unloadable
-
- before_filter :redirect_to_root, :only => [:new, :create], :if => :signed_in?
- filter_parameter_logging :password
-
- def new
- @user = ::User.new(params[:user])
- render :template => 'users/new'
- end
-
- def create
- @user = ::User.new params[:user]
- if @user.save
- ::ClearanceMailer.deliver_confirmation @user
- flash_notice_after_create
- redirect_to(url_after_create)
- else
- render :template => 'users/new'
- end
- end
-
- private
-
- def flash_notice_after_create
- flash[:notice] = translate(:deliver_confirmation,
- :scope => [:clearance, :controllers, :users],
- :default => "You will receive an email within the next few minutes. " <<
- "It contains instructions for confirming your account.")
- end
-
- def url_after_create
- new_session_url
- end
-end
diff --git a/vendor/plugins/clearance/app/models/clearance_mailer.rb b/vendor/plugins/clearance/app/models/clearance_mailer.rb
deleted file mode 100644
index 90f5f16..0000000
--- a/vendor/plugins/clearance/app/models/clearance_mailer.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class ClearanceMailer < ActionMailer::Base
-
- default_url_options[:host] = HOST
-
- def change_password(user)
- from DO_NOT_REPLY
- recipients user.email
- subject I18n.t(:change_password,
- :scope => [:clearance, :models, :clearance_mailer],
- :default => "Change your password")
- body :user => user
- end
-
- def confirmation(user)
- from DO_NOT_REPLY
- recipients user.email
- subject I18n.t(:confirmation,
- :scope => [:clearance, :models, :clearance_mailer],
- :default => "Account confirmation")
- body :user => user
- end
-
-end
diff --git a/vendor/plugins/clearance/app/views/clearance_mailer/change_password.html.erb b/vendor/plugins/clearance/app/views/clearance_mailer/change_password.html.erb
deleted file mode 100644
index 246324d..0000000
--- a/vendor/plugins/clearance/app/views/clearance_mailer/change_password.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-Someone, hopefully you, has requested that we send you a link to change your password.
-
-Here's the link:
-
-<%= edit_user_password_url(@user, :token => @user.token, :escape => false) %>
-
-If you didn't request this, ignore this email. Don't worry. Your password hasn't been changed.
diff --git a/vendor/plugins/clearance/app/views/clearance_mailer/confirmation.html.erb b/vendor/plugins/clearance/app/views/clearance_mailer/confirmation.html.erb
deleted file mode 100644
index 83d3de4..0000000
--- a/vendor/plugins/clearance/app/views/clearance_mailer/confirmation.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-<%= new_user_confirmation_url :user_id => @user, :token => @user.token, :encode => false %>
diff --git a/vendor/plugins/clearance/app/views/passwords/edit.html.erb b/vendor/plugins/clearance/app/views/passwords/edit.html.erb
deleted file mode 100644
index c8637f5..0000000
--- a/vendor/plugins/clearance/app/views/passwords/edit.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-
Change your password
-
-
- Your password has been reset. Choose a new password below.
-
-<% end %>
\ No newline at end of file
diff --git a/vendor/plugins/clearance/app/views/sessions/new.html.erb b/vendor/plugins/clearance/app/views/sessions/new.html.erb
deleted file mode 100644
index a1e5607..0000000
--- a/vendor/plugins/clearance/app/views/sessions/new.html.erb
+++ /dev/null
@@ -1,28 +0,0 @@
-
\ No newline at end of file
diff --git a/vendor/plugins/clearance/app/views/users/new.html.erb b/vendor/plugins/clearance/app/views/users/new.html.erb
deleted file mode 100644
index de2ebf7..0000000
--- a/vendor/plugins/clearance/app/views/users/new.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-
Sign up
-
-<% form_for @user do |form| %>
- <%= render :partial => '/users/form', :object => form %>
- <%= form.submit 'Sign up', :disable_with => 'Please wait...' %>
-<% end %>
diff --git a/vendor/plugins/clearance/clearance.gemspec b/vendor/plugins/clearance/clearance.gemspec
deleted file mode 100644
index e00b453..0000000
--- a/vendor/plugins/clearance/clearance.gemspec
+++ /dev/null
@@ -1,132 +0,0 @@
---- !ruby/object:Gem::Specification
-name: clearance
-version: !ruby/object:Gem::Version
- version: 0.6.9
-platform: ruby
-authors:
-- Dan Croak
-- Mike Burns
-- Jason Morrison
-- Joe Ferris
-- Eugene Bolshakov
-- Nick Quaranto
-- Josh Nichols
-- Mike Breen
-- "Marcel G\xC3\xB6rner"
-- Bence Nagy
-- Ben Mabey
-- Eloy Duran
-- Tim Pope
-- Mihai Anca
-- Mark Cornick
-- Shay Arnett
-autorequire:
-bindir: bin
-cert_chain: []
-
-date: 2009-07-04 00:00:00 -04:00
-default_executable:
-dependencies: []
-
-description: Rails authentication with email & password.
-email: support@thoughtbot.com
-executables: []
-
-extensions: []
-
-extra_rdoc_files: []
-
-files:
-- CHANGELOG.textile
-- LICENSE
-- Rakefile
-- README.textile
-- TODO.textile
-- app/controllers
-- app/controllers/clearance
-- app/controllers/clearance/confirmations_controller.rb
-- app/controllers/clearance/passwords_controller.rb
-- app/controllers/clearance/sessions_controller.rb
-- app/controllers/clearance/users_controller.rb
-- app/models
-- app/models/clearance_mailer.rb
-- app/views
-- app/views/clearance_mailer
-- app/views/clearance_mailer/change_password.html.erb
-- app/views/clearance_mailer/confirmation.html.erb
-- app/views/passwords
-- app/views/passwords/edit.html.erb
-- app/views/passwords/new.html.erb
-- app/views/sessions
-- app/views/sessions/new.html.erb
-- app/views/users
-- app/views/users/_form.html.erb
-- app/views/users/new.html.erb
-- config/clearance_routes.rb
-- generators/clearance
-- generators/clearance/clearance_generator.rb
-- generators/clearance/lib
-- generators/clearance/lib/insert_commands.rb
-- generators/clearance/lib/rake_commands.rb
-- generators/clearance/templates
-- generators/clearance/templates/factories.rb
-- generators/clearance/templates/migrations
-- generators/clearance/templates/migrations/create_users.rb
-- generators/clearance/templates/migrations/update_users.rb
-- generators/clearance/templates/README
-- generators/clearance/templates/user.rb
-- generators/clearance/USAGE
-- generators/clearance_features
-- generators/clearance_features/clearance_features_generator.rb
-- generators/clearance_features/templates
-- generators/clearance_features/templates/features
-- generators/clearance_features/templates/features/password_reset.feature
-- generators/clearance_features/templates/features/sign_in.feature
-- generators/clearance_features/templates/features/sign_out.feature
-- generators/clearance_features/templates/features/sign_up.feature
-- generators/clearance_features/templates/features/step_definitions
-- generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
-- generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
-- generators/clearance_features/templates/features/support
-- generators/clearance_features/templates/features/support/paths.rb
-- generators/clearance_features/USAGE
-- lib/clearance
-- lib/clearance/authentication.rb
-- lib/clearance/extensions
-- lib/clearance/extensions/errors.rb
-- lib/clearance/extensions/rescue.rb
-- lib/clearance/extensions/routes.rb
-- lib/clearance/user.rb
-- lib/clearance.rb
-- shoulda_macros/clearance.rb
-- rails/init.rb
-has_rdoc: true
-homepage: http://github.com/thoughtbot/clearance
-licenses: []
-
-post_install_message:
-rdoc_options: []
-
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-requirements: []
-
-rubyforge_project:
-rubygems_version: 1.3.4
-signing_key:
-specification_version: 3
-summary: Rails authentication with email & password.
-test_files: []
-
diff --git a/vendor/plugins/clearance/config/clearance_routes.rb b/vendor/plugins/clearance/config/clearance_routes.rb
deleted file mode 100644
index caeb5cc..0000000
--- a/vendor/plugins/clearance/config/clearance_routes.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- map.resources :passwords,
- :controller => 'clearance/passwords',
- :only => [:new, :create]
-
- map.resource :session,
- :controller => 'clearance/sessions',
- :only => [:new, :create, :destroy]
-
- map.resources :users, :controller => 'clearance/users' do |users|
- users.resource :password,
- :controller => 'clearance/passwords',
- :only => [:create, :edit, :update]
-
- users.resource :confirmation,
- :controller => 'clearance/confirmations',
- :only => [:new, :create]
- end
-
- map.sign_up 'sign_up',
- :controller => 'clearance/users',
- :action => 'new'
- map.sign_in 'sign_in',
- :controller => 'clearance/sessions',
- :action => 'new'
- map.sign_out 'sign_out',
- :controller => 'clearance/sessions',
- :action => 'destroy',
- :method => :delete
-end
diff --git a/vendor/plugins/clearance/generators/clearance/USAGE b/vendor/plugins/clearance/generators/clearance/USAGE
deleted file mode 100644
index 3d9cabe..0000000
--- a/vendor/plugins/clearance/generators/clearance/USAGE
+++ /dev/null
@@ -1 +0,0 @@
-script/generate clearance
\ No newline at end of file
diff --git a/vendor/plugins/clearance/generators/clearance/clearance_generator.rb b/vendor/plugins/clearance/generators/clearance/clearance_generator.rb
deleted file mode 100644
index d3704b7..0000000
--- a/vendor/plugins/clearance/generators/clearance/clearance_generator.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/lib/insert_commands.rb")
-require File.expand_path(File.dirname(__FILE__) + "/lib/rake_commands.rb")
-require 'factory_girl'
-
-class ClearanceGenerator < Rails::Generator::Base
-
- def manifest
- record do |m|
- m.insert_into "app/controllers/application_controller.rb",
- "include Clearance::Authentication"
-
- user_model = "app/models/user.rb"
- if File.exists?(user_model)
- m.insert_into user_model, "include Clearance::User"
- else
- m.directory File.join("app", "models")
- m.file "user.rb", user_model
- end
-
- m.directory File.join("test", "factories")
- m.file "factories.rb", "test/factories/clearance.rb"
-
- m.migration_template "migrations/#{migration_name}.rb",
- 'db/migrate',
- :migration_file_name => "clearance_#{migration_name}"
-
- m.readme "README"
- end
- end
-
- private
-
- def migration_name
- if ActiveRecord::Base.connection.table_exists?(:users)
- 'update_users'
- else
- 'create_users'
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/generators/clearance/lib/insert_commands.rb b/vendor/plugins/clearance/generators/clearance/lib/insert_commands.rb
deleted file mode 100644
index cc76c56..0000000
--- a/vendor/plugins/clearance/generators/clearance/lib/insert_commands.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
-
-Rails::Generator::Commands::Base.class_eval do
- def file_contains?(relative_destination, line)
- File.read(destination_path(relative_destination)).include?(line)
- end
-end
-
-Rails::Generator::Commands::Create.class_eval do
- def insert_into(file, line)
- logger.insert "#{line} into #{file}"
- unless options[:pretend] || file_contains?(file, line)
- gsub_file file, /^(class|module) .+$/ do |match|
- "#{match}\n #{line}"
- end
- end
- end
-end
-
-Rails::Generator::Commands::Destroy.class_eval do
- def insert_into(file, line)
- logger.remove "#{line} from #{file}"
- unless options[:pretend]
- gsub_file file, "\n #{line}", ''
- end
- end
-end
-
-Rails::Generator::Commands::List.class_eval do
- def insert_into(file, line)
- logger.insert "#{line} into #{file}"
- end
-end
diff --git a/vendor/plugins/clearance/generators/clearance/lib/rake_commands.rb b/vendor/plugins/clearance/generators/clearance/lib/rake_commands.rb
deleted file mode 100644
index a9fd417..0000000
--- a/vendor/plugins/clearance/generators/clearance/lib/rake_commands.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-Rails::Generator::Commands::Create.class_eval do
- def rake_db_migrate
- logger.rake "db:migrate"
- unless system("rake db:migrate")
- logger.rake "db:migrate failed. Rolling back"
- command(:destroy).invoke!
- end
- end
-end
-
-Rails::Generator::Commands::Destroy.class_eval do
- def rake_db_migrate
- logger.rake "db:rollback"
- system "rake db:rollback"
- end
-end
-
-Rails::Generator::Commands::List.class_eval do
- def rake_db_migrate
- logger.rake "db:migrate"
- end
-end
diff --git a/vendor/plugins/clearance/generators/clearance/templates/README b/vendor/plugins/clearance/generators/clearance/templates/README
deleted file mode 100644
index 17850c8..0000000
--- a/vendor/plugins/clearance/generators/clearance/templates/README
+++ /dev/null
@@ -1,22 +0,0 @@
-
-*******************************************************************************
-
-Ok, enough fancy automatic stuff. Time for some old school monkey copy-pasting.
-
-1. Define a HOST constant in your environments files.
-In config/environments/test.rb and config/environments/development.rb it can be:
-
- HOST = "localhost"
-
-In production.rb it must be the actual host your application is deployed to.
-The constant is used by mailers to generate URLs in emails.
-
-2. In config/environment.rb:
-
- DO_NOT_REPLY = "donotreply@example.com"
-
-3. Define root_url to *something* in your config/routes.rb:
-
- map.root :controller => 'home'
-
-*******************************************************************************
diff --git a/vendor/plugins/clearance/generators/clearance/templates/factories.rb b/vendor/plugins/clearance/generators/clearance/templates/factories.rb
deleted file mode 100644
index 9bdd13a..0000000
--- a/vendor/plugins/clearance/generators/clearance/templates/factories.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-Factory.sequence :email do |n|
- "user#{n}@example.com"
-end
-
-Factory.define :user do |user|
- user.email { Factory.next :email }
- user.password { "password" }
- user.password_confirmation { "password" }
-end
-
-Factory.define :email_confirmed_user, :parent => :user do |user|
- user.email_confirmed { true }
-end
diff --git a/vendor/plugins/clearance/generators/clearance/templates/migrations/create_users.rb b/vendor/plugins/clearance/generators/clearance/templates/migrations/create_users.rb
deleted file mode 100644
index 22e921a..0000000
--- a/vendor/plugins/clearance/generators/clearance/templates/migrations/create_users.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class ClearanceCreateUsers < ActiveRecord::Migration
- def self.up
- create_table(:users) do |t|
- t.string :email
- t.string :encrypted_password, :limit => 128
- t.string :salt, :limit => 128
- t.string :token, :limit => 128
- t.datetime :token_expires_at
- t.boolean :email_confirmed, :default => false, :null => false
- t.timestamps
- end
-
- add_index :users, [:id, :token]
- add_index :users, :email
- add_index :users, :token
- end
-
- def self.down
- drop_table :users
- end
-end
diff --git a/vendor/plugins/clearance/generators/clearance/templates/migrations/update_users.rb b/vendor/plugins/clearance/generators/clearance/templates/migrations/update_users.rb
deleted file mode 100644
index 4a329fa..0000000
--- a/vendor/plugins/clearance/generators/clearance/templates/migrations/update_users.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-class ClearanceUpdateUsers < ActiveRecord::Migration
- def self.up
-<%
- existing_columns = ActiveRecord::Base.connection.columns(:users).collect { |each| each.name }
- columns = [
- [:email, 't.string :email'],
- [:encrypted_password, 't.string :encrypted_password, :limit => 128'],
- [:salt, 't.string :salt, :limit => 128'],
- [:token, 't.string :token, :limit => 128'],
- [:token_expires_at, 't.datetime :token_expires_at'],
- [:email_confirmed, 't.boolean :email_confirmed, :default => false, :null => false']
- ].delete_if {|c| existing_columns.include?(c.first.to_s)}
--%>
- change_table(:users) do |t|
-<% columns.each do |c| -%>
- <%= c.last %>
-<% end -%>
- end
-
-<%
- existing_indexes = ActiveRecord::Base.connection.indexes(:users)
- index_names = existing_indexes.collect { |each| each.name }
- new_indexes = [
- [:index_users_on_id_and_token, 'add_index :users, [:id, :token]'],
- [:index_users_on_email, 'add_index :users, :email'],
- [:index_users_on_token, 'add_index :users, :token']
- ].delete_if { |each| index_names.include?(each.first.to_s) }
--%>
-<% new_indexes.each do |each| -%>
- <%= each.last %>
-<% end -%>
- end
-
- def self.down
- change_table(:users) do |t|
-<% unless columns.empty? -%>
- t.remove <%= columns.collect { |each| ":#{each.first}" }.join(',') %>
-<% end -%>
- end
- end
-end
diff --git a/vendor/plugins/clearance/generators/clearance/templates/user.rb b/vendor/plugins/clearance/generators/clearance/templates/user.rb
deleted file mode 100644
index 6d077a1..0000000
--- a/vendor/plugins/clearance/generators/clearance/templates/user.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class User < ActiveRecord::Base
- include Clearance::User
-end
diff --git a/vendor/plugins/clearance/generators/clearance_features/USAGE b/vendor/plugins/clearance/generators/clearance_features/USAGE
deleted file mode 100644
index 3758c0b..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/USAGE
+++ /dev/null
@@ -1 +0,0 @@
-script/generate clearance_features
diff --git a/vendor/plugins/clearance/generators/clearance_features/clearance_features_generator.rb b/vendor/plugins/clearance/generators/clearance_features/clearance_features_generator.rb
deleted file mode 100644
index f2b43ea..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/clearance_features_generator.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class ClearanceFeaturesGenerator < Rails::Generator::Base
-
- def manifest
- record do |m|
- m.directory File.join("features", "step_definitions")
- m.directory File.join("features", "support")
-
- ["features/step_definitions/clearance_steps.rb",
- "features/step_definitions/factory_girl_steps.rb",
- "features/support/paths.rb",
- "features/sign_in.feature",
- "features/sign_out.feature",
- "features/sign_up.feature",
- "features/password_reset.feature"].each do |file|
- m.file file, file
- end
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/password_reset.feature b/vendor/plugins/clearance/generators/clearance_features/templates/features/password_reset.feature
deleted file mode 100644
index 51b77f7..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/password_reset.feature
+++ /dev/null
@@ -1,33 +0,0 @@
-Feature: Password reset
- In order to sign in even if user forgot their password
- A user
- Should be able to reset it
-
- Scenario: User is not signed up
- Given no user exists with an email of "email@person.com"
- When I request password reset link to be sent to "email@person.com"
- Then I should see "Unknown email"
-
- Scenario: User is signed up and requests password reset
- Given I signed up with "email@person.com/password"
- When I request password reset link to be sent to "email@person.com"
- Then I should see "instructions for changing your password"
- And a password reset message should be sent to "email@person.com"
-
- Scenario: User is signed up updated his password and types wrong confirmation
- Given I signed up with "email@person.com/password"
- When I follow the password reset link sent to "email@person.com"
- And I update my password with "newpassword/wrongconfirmation"
- Then I should see error messages
- And I should be signed out
-
- Scenario: User is signed up and updates his password
- Given I signed up with "email@person.com/password"
- When I follow the password reset link sent to "email@person.com"
- And I update my password with "newpassword/newpassword"
- Then I should be signed in
- When I sign out
- Then I should be signed out
- And I sign in as "email@person.com/newpassword"
- Then I should be signed in
-
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_in.feature b/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_in.feature
deleted file mode 100644
index 4b44c39..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_in.feature
+++ /dev/null
@@ -1,42 +0,0 @@
-Feature: Sign in
- In order to get access to protected sections of the site
- A user
- Should be able to sign in
-
- Scenario: User is not signed up
- Given no user exists with an email of "email@person.com"
- When I go to the sign in page
- And I sign in as "email@person.com/password"
- Then I should see "Bad email or password"
- And I should be signed out
-
- Scenario: User is not confirmed
- Given I signed up with "email@person.com/password"
- When I go to the sign in page
- And I sign in as "email@person.com/password"
- Then I should see "User has not confirmed email"
- And I should be signed out
-
- Scenario: User enters wrong password
- Given I am signed up and confirmed as "email@person.com/password"
- When I go to the sign in page
- And I sign in as "email@person.com/wrongpassword"
- Then I should see "Bad email or password"
- And I should be signed out
-
- Scenario: User signs in successfully
- Given I am signed up and confirmed as "email@person.com/password"
- When I go to the sign in page
- And I sign in as "email@person.com/password"
- Then I should see "Signed in"
- And I should be signed in
-
- Scenario: User signs in and checks "remember me"
- Given I am signed up and confirmed as "email@person.com/password"
- When I go to the sign in page
- And I sign in with "remember me" as "email@person.com/password"
- Then I should see "Signed in"
- And I should be signed in
- When I return next time
- Then I should be signed in
-
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_out.feature b/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_out.feature
deleted file mode 100644
index 2107226..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_out.feature
+++ /dev/null
@@ -1,23 +0,0 @@
-Feature: Sign out
- To protect my account from unauthorized access
- A signed in user
- Should be able to sign out
-
- Scenario: User signs out
- Given I am signed up and confirmed as "email@person.com/password"
- When I sign in as "email@person.com/password"
- Then I should be signed in
- And I sign out
- Then I should see "Signed out"
- And I should be signed out
-
- Scenario: User who was remembered signs out
- Given I am signed up and confirmed as "email@person.com/password"
- When I sign in with "remember me" as "email@person.com/password"
- Then I should be signed in
- And I sign out
- Then I should see "Signed out"
- And I should be signed out
- When I return next time
- Then I should be signed out
-
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_up.feature b/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_up.feature
deleted file mode 100644
index 27492d9..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/sign_up.feature
+++ /dev/null
@@ -1,28 +0,0 @@
-Feature: Sign up
- In order to get access to protected sections of the site
- A user
- Should be able to sign up
-
- Scenario: User signs up with invalid data
- When I go to the sign up page
- And I fill in "Email" with "invalidemail"
- And I fill in "Password" with "password"
- And I fill in "Confirm password" with ""
- And I press "Sign Up"
- Then I should see error messages
-
- Scenario: User signs up with valid data
- When I go to the sign up page
- And I fill in "Email" with "email@person.com"
- And I fill in "Password" with "password"
- And I fill in "Confirm password" with "password"
- And I press "Sign Up"
- Then I should see "instructions for confirming"
- And a confirmation message should be sent to "email@person.com"
-
- Scenario: User confirms his account
- Given I signed up with "email@person.com/password"
- When I follow the confirmation link sent to "email@person.com"
- Then I should see "Confirmed email and signed in"
- And I should be signed in
-
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb b/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
deleted file mode 100644
index 52ac7f4..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/clearance_steps.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-# General
-
-Then /^I should see error messages$/ do
- assert_match /error(s)? prohibited/m, response.body
-end
-
-# Database
-
-Given /^no user exists with an email of "(.*)"$/ do |email|
- assert_nil User.find_by_email(email)
-end
-
-Given /^I signed up with "(.*)\/(.*)"$/ do |email, password|
- user = Factory :user,
- :email => email,
- :password => password,
- :password_confirmation => password
-end
-
-Given /^I am signed up and confirmed as "(.*)\/(.*)"$/ do |email, password|
- user = Factory :email_confirmed_user,
- :email => email,
- :password => password,
- :password_confirmation => password
-end
-
-# Session
-
-Then /^I should be signed in$/ do
- assert controller.signed_in?
-end
-
-Then /^I should be signed out$/ do
- assert ! controller.signed_in?
-end
-
-When /^session is cleared$/ do
- request.reset_session
- controller.instance_variable_set(:@_current_user, nil)
-end
-
-# Emails
-
-Then /^a confirmation message should be sent to "(.*)"$/ do |email|
- user = User.find_by_email(email)
- sent = ActionMailer::Base.deliveries.first
- assert_equal [user.email], sent.to
- assert_match /confirm/i, sent.subject
- assert !user.token.blank?
- assert_match /#{user.token}/, sent.body
-end
-
-When /^I follow the confirmation link sent to "(.*)"$/ do |email|
- user = User.find_by_email(email)
- visit new_user_confirmation_path(:user_id => user, :token => user.token)
-end
-
-Then /^a password reset message should be sent to "(.*)"$/ do |email|
- user = User.find_by_email(email)
- sent = ActionMailer::Base.deliveries.first
- assert_equal [user.email], sent.to
- assert_match /password/i, sent.subject
- assert !user.token.blank?
- assert_match /#{user.token}/, sent.body
-end
-
-When /^I follow the password reset link sent to "(.*)"$/ do |email|
- user = User.find_by_email(email)
- visit edit_user_password_path(:user_id => user, :token => user.token)
-end
-
-When /^I try to change the password of "(.*)" without token$/ do |email|
- user = User.find_by_email(email)
- visit edit_user_password_path(:user_id => user)
-end
-
-Then /^I should be forbidden$/ do
- assert_response :forbidden
-end
-
-# Actions
-
-When /^I sign in( with "remember me")? as "(.*)\/(.*)"$/ do |remember, email, password|
- When %{I go to the sign in page}
- And %{I fill in "Email" with "#{email}"}
- And %{I fill in "Password" with "#{password}"}
- And %{I check "Remember me"} if remember
- And %{I press "Sign In"}
-end
-
-When /^I sign out$/ do
- visit '/session', :delete
-end
-
-When /^I request password reset link to be sent to "(.*)"$/ do |email|
- When %{I go to the password reset request page}
- And %{I fill in "Email address" with "#{email}"}
- And %{I press "Reset password"}
-end
-
-When /^I update my password with "(.*)\/(.*)"$/ do |password, confirmation|
- And %{I fill in "Choose password" with "#{password}"}
- And %{I fill in "Confirm password" with "#{confirmation}"}
- And %{I press "Save this password"}
-end
-
-When /^I return next time$/ do
- When %{session is cleared}
- And %{I go to the homepage}
-end
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb b/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
deleted file mode 100644
index 6337f66..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/step_definitions/factory_girl_steps.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Factory.factories.each do |name, factory|
- Given /^an? #{name} exists with an? (.*) of "([^"]*)"$/ do |attr, value|
- Factory(name, attr.gsub(' ', '_') => value)
- end
-end
diff --git a/vendor/plugins/clearance/generators/clearance_features/templates/features/support/paths.rb b/vendor/plugins/clearance/generators/clearance_features/templates/features/support/paths.rb
deleted file mode 100644
index 62ba3d5..0000000
--- a/vendor/plugins/clearance/generators/clearance_features/templates/features/support/paths.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module NavigationHelpers
- def path_to(page_name)
- case page_name
-
- when /the homepage/i
- root_path
- when /the sign up page/i
- new_user_path
- when /the sign in page/i
- new_session_path
- when /the password reset request page/i
- new_password_path
-
- # Add more page name => path mappings here
-
- else
- raise "Can't find mapping from \"#{page_name}\" to a path."
- end
- end
-end
-
-World(NavigationHelpers)
diff --git a/vendor/plugins/clearance/lib/clearance.rb b/vendor/plugins/clearance/lib/clearance.rb
deleted file mode 100644
index 260c4d6..0000000
--- a/vendor/plugins/clearance/lib/clearance.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'clearance/extensions/errors'
-require 'clearance/extensions/rescue'
-require 'clearance/extensions/routes'
-
-require 'clearance/authentication'
-require 'clearance/user'
diff --git a/vendor/plugins/clearance/lib/clearance/authentication.rb b/vendor/plugins/clearance/lib/clearance/authentication.rb
deleted file mode 100644
index 48143f2..0000000
--- a/vendor/plugins/clearance/lib/clearance/authentication.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-module Clearance
- module Authentication
-
- def self.included(controller)
- controller.send(:include, InstanceMethods)
-
- controller.class_eval do
- helper_method :current_user
- helper_method :signed_in?
-
- hide_action :current_user, :signed_in?
- end
- end
-
- module InstanceMethods
- def current_user
- @_current_user ||= (user_from_cookie || user_from_session)
- end
-
- def signed_in?
- ! current_user.nil?
- end
-
- protected
-
- def authenticate
- deny_access unless signed_in?
- end
-
- def user_from_session
- if session[:user_id]
- return nil unless user = ::User.find_by_id(session[:user_id])
- return user if user.email_confirmed?
- end
- end
-
- def user_from_cookie
- if token = cookies[:remember_token]
- return nil unless user = ::User.find_by_token(token)
- return user if user.remember?
- end
- end
-
- def sign_user_in(user)
- warn "[DEPRECATION] sign_user_in: unnecessary. use sign_in(user) instead."
- sign_in(user)
- end
-
- def sign_in(user)
- if user
- session[:user_id] = user.id
- end
- end
-
- def remember?
- params[:session] && params[:session][:remember_me] == "1"
- end
-
- def remember(user)
- user.remember_me!
- cookies[:remember_token] = { :value => user.token,
- :expires => user.token_expires_at }
- end
-
- def forget(user)
- user.forget_me! if user
- cookies.delete(:remember_token)
- reset_session
- end
-
- def redirect_back_or(default)
- redirect_to(return_to || default)
- clear_return_to
- end
-
- def return_to
- session[:return_to] || params[:return_to]
- end
-
- def clear_return_to
- session[:return_to] = nil
- end
-
- def redirect_to_root
- redirect_to(root_url)
- end
-
- def store_location
- session[:return_to] = request.request_uri if request.get?
- end
-
- def deny_access(flash_message = nil, opts = {})
- store_location
- flash[:failure] = flash_message if flash_message
- redirect_to(new_session_url)
- end
- end
-
- end
-end
diff --git a/vendor/plugins/clearance/lib/clearance/extensions/errors.rb b/vendor/plugins/clearance/lib/clearance/extensions/errors.rb
deleted file mode 100644
index d6b19bf..0000000
--- a/vendor/plugins/clearance/lib/clearance/extensions/errors.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-if defined?(ActionController)
- module ActionController
- class Forbidden < StandardError
- end
- end
-end
diff --git a/vendor/plugins/clearance/lib/clearance/extensions/rescue.rb b/vendor/plugins/clearance/lib/clearance/extensions/rescue.rb
deleted file mode 100644
index 7afe4ad..0000000
--- a/vendor/plugins/clearance/lib/clearance/extensions/rescue.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-if defined?(ActionController::Base)
- ActionController::Base.rescue_responses.update('ActionController::Forbidden' => :forbidden)
-end
diff --git a/vendor/plugins/clearance/lib/clearance/extensions/routes.rb b/vendor/plugins/clearance/lib/clearance/extensions/routes.rb
deleted file mode 100644
index 1a6c43b..0000000
--- a/vendor/plugins/clearance/lib/clearance/extensions/routes.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-if defined?(ActionController::Routing::RouteSet)
- class ActionController::Routing::RouteSet
- def load_routes_with_clearance!
- lib_path = File.dirname(__FILE__)
- clearance_routes = File.join(lib_path, *%w[.. .. .. config clearance_routes.rb])
- unless configuration_files.include?(clearance_routes)
- add_configuration_file(clearance_routes)
- end
- load_routes_without_clearance!
- end
-
- alias_method_chain :load_routes!, :clearance
- end
-end
diff --git a/vendor/plugins/clearance/lib/clearance/user.rb b/vendor/plugins/clearance/lib/clearance/user.rb
deleted file mode 100644
index f6206e9..0000000
--- a/vendor/plugins/clearance/lib/clearance/user.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-require 'digest/sha1'
-
-module Clearance
- module User
-
- def self.included(model)
- model.extend(ClassMethods)
-
- model.send(:include, InstanceMethods)
- model.send(:include, AttrAccessible)
- model.send(:include, AttrAccessor)
- model.send(:include, Validations)
- model.send(:include, Callbacks)
- end
-
- module AttrAccessible
- def self.included(model)
- model.class_eval do
- attr_accessible :email, :password, :password_confirmation
- end
- end
- end
-
- module AttrAccessor
- def self.included(model)
- model.class_eval do
- attr_accessor :password, :password_confirmation
- end
- end
- end
-
- module Validations
- def self.included(model)
- model.class_eval do
- validates_presence_of :email
- validates_uniqueness_of :email, :case_sensitive => false
- validates_format_of :email, :with => %r{.+@.+\..+}
-
- validates_presence_of :password, :if => :password_required?
- validates_confirmation_of :password, :if => :password_required?
- end
- end
- end
-
- module Callbacks
- def self.included(model)
- model.class_eval do
- before_save :initialize_salt, :encrypt_password, :initialize_token
- end
- end
- end
-
- module InstanceMethods
- def authenticated?(password)
- encrypted_password == encrypt(password)
- end
-
- def encrypt(string)
- generate_hash("--#{salt}--#{string}--")
- end
-
- def remember?
- token_expires_at && Time.now.utc < token_expires_at
- end
-
- def remember_me!
- remember_me_until! 2.weeks.from_now.utc
- end
-
- def forget_me!
- clear_token
- save(false)
- end
-
- def confirm_email!
- self.email_confirmed = true
- self.token = nil
- save(false)
- end
-
- def forgot_password!
- generate_token
- save(false)
- end
-
- def update_password(new_password, new_password_confirmation)
- self.password = new_password
- self.password_confirmation = new_password_confirmation
- clear_token if valid?
- save
- end
-
- protected
-
- def generate_hash(string)
- Digest::SHA1.hexdigest(string)
- end
-
- def initialize_salt
- if new_record?
- self.salt = generate_hash("--#{Time.now.utc.to_s}--#{password}--")
- end
- end
-
- def encrypt_password
- return if password.blank?
- self.encrypted_password = encrypt(password)
- end
-
- def generate_token
- self.token = encrypt("--#{Time.now.utc.to_s}--#{password}--")
- self.token_expires_at = nil
- end
-
- def clear_token
- self.token = nil
- self.token_expires_at = nil
- end
-
- def initialize_token
- generate_token if new_record?
- end
-
- def password_required?
- encrypted_password.blank? || !password.blank?
- end
-
- def remember_me_until!(time)
- self.token_expires_at = time
- self.token = encrypt("--#{token_expires_at}--#{password}--")
- save(false)
- end
- end
-
- module ClassMethods
- def authenticate(email, password)
- return nil unless user = find_by_email(email)
- return user if user.authenticated?(password)
- end
- end
-
- end
-end
diff --git a/vendor/plugins/clearance/rails/init.rb b/vendor/plugins/clearance/rails/init.rb
deleted file mode 100644
index 5ed1d1b..0000000
--- a/vendor/plugins/clearance/rails/init.rb
+++ /dev/null
@@ -1 +0,0 @@
-require 'clearance'
\ No newline at end of file
diff --git a/vendor/plugins/clearance/shoulda_macros/clearance.rb b/vendor/plugins/clearance/shoulda_macros/clearance.rb
deleted file mode 100644
index cc44b7d..0000000
--- a/vendor/plugins/clearance/shoulda_macros/clearance.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-module Clearance
- module Shoulda
-
- # STATE OF AUTHENTICATION
-
- def should_be_signed_in_as(&block)
- should "be signed in as #{block.bind(self).call}" do
- user = block.bind(self).call
- assert_not_nil user,
- "please pass a User. try: should_be_signed_in_as { @user }"
- assert_equal user, @controller.send(:current_user),
- "#{user.inspect} is not the current_user, " <<
- "which is #{@controller.send(:current_user).inspect}"
- end
- end
-
- def should_be_signed_in_and_email_confirmed_as(&block)
- warn "[DEPRECATION] should_be_signed_in_and_email_confirmed_as: questionable usefulness"
- should_be_signed_in_as &block
-
- should "have confirmed email" do
- user = block.bind(self).call
-
- assert_not_nil user
- assert_equal user, assigns(:user)
- assert assigns(:user).email_confirmed?
- end
- end
-
- def should_not_be_signed_in
- should "not be signed in" do
- assert_nil session[:user_id]
- end
- end
-
- def should_deny_access_on(http_method, action, opts = {})
- warn "[DEPRECATION] should_deny_access_on: use a setup & should_deny_access(:flash => ?)"
- flash_message = opts.delete(:flash)
- context "on #{http_method} to #{action}" do
- setup do
- send(http_method, action, opts)
- end
-
- should_deny_access(:flash => flash_message)
- end
- end
-
- def should_deny_access(opts = {})
- if opts[:flash]
- should_set_the_flash_to opts[:flash]
- else
- should_not_set_the_flash
- end
-
- should_redirect_to('new_session_url') { new_session_url }
- end
-
- # HTTP FLUENCY
-
- def should_forbid(description, &block)
- should "forbid #{description}" do
- assert_raises ActionController::Forbidden do
- instance_eval(&block)
- end
- end
- end
-
- # CONTEXTS
-
- def signed_in_user_context(&blk)
- warn "[DEPRECATION] signed_in_user_context: creates a Mystery Guest, causes Obscure Test"
- context "A signed in user" do
- setup do
- @user = Factory(:user)
- @user.confirm_email!
- sign_in_as @user
- end
- merge_block(&blk)
- end
- end
-
- def public_context(&blk)
- warn "[DEPRECATION] public_context: common case is no-op. call sign_out otherwise"
- context "The public" do
- setup { sign_out }
- merge_block(&blk)
- end
- end
-
- # CREATING USERS
-
- def should_create_user_successfully
- warn "[DEPRECATION] should_create_user_successfully: not meant to be public, no longer used internally"
- should_assign_to :user
- should_change 'User.count', :by => 1
-
- should "send the confirmation email" do
- assert_sent_email do |email|
- email.subject =~ /account confirmation/i
- end
- end
-
- should_set_the_flash_to /confirm/i
- should_redirect_to_url_after_create
- end
-
- # RENDERING
-
- def should_render_nothing
- should "render nothing" do
- assert @response.body.blank?
- end
- end
-
- # REDIRECTS
-
- def should_redirect_to_url_after_create
- should_redirect_to("the post-create url") do
- @controller.send(:url_after_create)
- end
- end
-
- def should_redirect_to_url_after_update
- should_redirect_to("the post-update url") do
- @controller.send(:url_after_update)
- end
- end
-
- def should_redirect_to_url_after_destroy
- should_redirect_to("the post-destroy url") do
- @controller.send(:url_after_destroy)
- end
- end
-
- # VALIDATIONS
-
- def should_validate_confirmation_of(attribute, opts = {})
- warn "[DEPRECATION] should_validate_confirmation_of: not meant to be public, no longer used internally"
- raise ArgumentError if opts[:factory].nil?
-
- context "on save" do
- should_validate_confirmation_is_not_blank opts[:factory], attribute
- should_validate_confirmation_is_not_bad opts[:factory], attribute
- end
- end
-
- def should_validate_confirmation_is_not_blank(factory, attribute, opts = {})
- warn "[DEPRECATION] should_validate_confirmation_is_not_blank: not meant to be public, no longer used internally"
- should "validate #{attribute}_confirmation is not blank" do
- model = Factory.build(factory, blank_confirmation_options(attribute))
- model.save
- assert_confirmation_error(model, attribute,
- "#{attribute}_confirmation cannot be blank")
- end
- end
-
- def should_validate_confirmation_is_not_bad(factory, attribute, opts = {})
- warn "[DEPRECATION] should_validate_confirmation_is_not_bad: not meant to be public, no longer used internally"
- should "validate #{attribute}_confirmation is different than #{attribute}" do
- model = Factory.build(factory, bad_confirmation_options(attribute))
- model.save
- assert_confirmation_error(model, attribute,
- "#{attribute}_confirmation cannot be different than #{attribute}")
- end
- end
-
- # FORMS
-
- def should_display_a_password_update_form
- warn "[DEPRECATION] should_display_a_password_update_form: not meant to be public, no longer used internally"
- should "have a form for the user's token, password, and password confirm" do
- update_path = ERB::Util.h(
- user_password_path(@user, :token => @user.token)
- )
-
- assert_select 'form[action=?]', update_path do
- assert_select 'input[name=_method][value=?]', 'put'
- assert_select 'input[name=?]', 'user[password]'
- assert_select 'input[name=?]', 'user[password_confirmation]'
- end
- end
- end
-
- def should_display_a_sign_up_form
- warn "[DEPRECATION] should_display_a_sign_up_form: not meant to be public, no longer used internally"
- should "display a form to sign up" do
- assert_select "form[action=#{users_path}][method=post]",
- true, "There must be a form to sign up" do
- assert_select "input[type=text][name=?]",
- "user[email]", true, "There must be an email field"
- assert_select "input[type=password][name=?]",
- "user[password]", true, "There must be a password field"
- assert_select "input[type=password][name=?]",
- "user[password_confirmation]", true, "There must be a password confirmation field"
- assert_select "input[type=submit]", true,
- "There must be a submit button"
- end
- end
- end
-
- def should_display_a_sign_in_form
- warn "[DEPRECATION] should_display_a_sign_in_form: not meant to be public, no longer used internally"
- should 'display a "sign in" form' do
- assert_select "form[action=#{session_path}][method=post]",
- true, "There must be a form to sign in" do
- assert_select "input[type=text][name=?]",
- "session[email]", true, "There must be an email field"
- assert_select "input[type=password][name=?]",
- "session[password]", true, "There must be a password field"
- assert_select "input[type=checkbox][name=?]",
- "session[remember_me]", true, "There must be a 'remember me' check box"
- assert_select "input[type=submit]", true,
- "There must be a submit button"
- end
- end
- end
- end
-end
-
-module Clearance
- module Shoulda
- module Helpers
- def sign_in_as(user)
- @controller.class_eval { attr_accessor :current_user }
- @controller.current_user = user
- return user
- end
-
- def sign_in
- sign_in_as Factory(:email_confirmed_user)
- end
-
- def sign_out
- @controller.class_eval { attr_accessor :current_user }
- @controller.current_user = nil
- end
-
- def blank_confirmation_options(attribute)
- warn "[DEPRECATION] blank_confirmation_options: not meant to be public, no longer used internally"
- opts = { attribute => attribute.to_s }
- opts.merge("#{attribute}_confirmation".to_sym => "")
- end
-
- def bad_confirmation_options(attribute)
- warn "[DEPRECATION] bad_confirmation_options: not meant to be public, no longer used internally"
- opts = { attribute => attribute.to_s }
- opts.merge("#{attribute}_confirmation".to_sym => "not_#{attribute}")
- end
-
- def assert_confirmation_error(model, attribute, message = "confirmation error")
- warn "[DEPRECATION] assert_confirmation_error: not meant to be public, no longer used internally"
- assert model.errors.on(attribute).include?("doesn't match confirmation"),
- message
- end
- end
- end
-end
-
-class Test::Unit::TestCase
- include Clearance::Shoulda::Helpers
-end
-Test::Unit::TestCase.extend(Clearance::Shoulda)
diff --git a/vendor/plugins/clearance/test/controllers/confirmations_controller_test.rb b/vendor/plugins/clearance/test/controllers/confirmations_controller_test.rb
deleted file mode 100644
index d412707..0000000
--- a/vendor/plugins/clearance/test/controllers/confirmations_controller_test.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'test_helper'
-
-class ConfirmationsControllerTest < ActionController::TestCase
-
- tests Clearance::ConfirmationsController
-
- should_filter_params :token
-
- context "a user whose email has not been confirmed" do
- setup { @user = Factory(:user) }
-
- should "have a token" do
- assert_not_nil @user.token
- assert_not_equal "", @user.token
- end
-
- context "on GET to #new with correct id and token" do
- setup do
- get :new, :user_id => @user.to_param, :token => @user.token
- end
-
- should_set_the_flash_to /confirmed email/i
- should_set_the_flash_to /signed in/i
- should_be_signed_in_and_email_confirmed_as { @user }
- should_redirect_to_url_after_create
- end
-
- context "with an incorrect token" do
- setup do
- @bad_token = "bad token"
- assert_not_equal @bad_token, @user.token
- end
-
- should_forbid "on GET to #new with incorrect token" do
- get :new, :user_id => @user.to_param, :token => @bad_token
- end
- end
-
- should_forbid "on GET to #new with blank token" do
- get :new, :user_id => @user.to_param, :token => ""
- end
-
- should_forbid "on GET to #new with no token" do
- get :new, :user_id => @user.to_param
- end
- end
-
- context "a user with email confirmed" do
- setup { @user = Factory(:email_confirmed_user) }
-
- should_forbid "on GET to #new with correct id" do
- get :new, :user_id => @user.to_param
- end
- end
-
- context "no users" do
- setup { assert_equal 0, ::User.count }
-
- should_forbid "on GET to #new with nonexistent id and token" do
- get :new, :user_id => '123', :token => '123'
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/test/controllers/passwords_controller_test.rb b/vendor/plugins/clearance/test/controllers/passwords_controller_test.rb
deleted file mode 100644
index e42f981..0000000
--- a/vendor/plugins/clearance/test/controllers/passwords_controller_test.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-require 'test_helper'
-
-class PasswordsControllerTest < ActionController::TestCase
-
- tests Clearance::PasswordsController
-
- should_route :get, '/users/1/password/edit',
- :controller => 'clearance/passwords', :action => 'edit', :user_id => '1'
-
- context "a signed up user" do
- setup do
- @user = Factory(:user)
- end
-
- context "on GET to #new" do
- setup { get :new, :user_id => @user.to_param }
-
- should_respond_with :success
- should_render_template "new"
- end
-
- context "on POST to #create" do
- context "with correct email address" do
- setup do
- ActionMailer::Base.deliveries.clear
- post :create, :password => { :email => @user.email }
- end
-
- should "generate a token for the change your password email" do
- assert_not_nil @user.reload.token
- end
-
- should "send the change your password email" do
- assert_sent_email do |email|
- email.subject =~ /change your password/i
- end
- end
-
- should_set_the_flash_to /password/i
- should_redirect_to_url_after_create
- end
-
- context "with incorrect email address" do
- setup do
- email = "user1@example.com"
- assert ! ::User.exists?(['email = ?', email])
- ActionMailer::Base.deliveries.clear
- assert_equal @user.token, @user.reload.token
-
- post :create, :password => { :email => email }
- end
-
- should "not generate a token for the change your password email" do
- assert_equal @user.token, @user.reload.token
- end
-
- should "not send a password reminder email" do
- assert ActionMailer::Base.deliveries.empty?
- end
-
- should "set the failure flash to Unknown email" do
- assert_match /unknown email/i, flash.now[:failure]
- end
-
- should_render_template :new
- end
- end
- end
-
- context "a signed up user and forgotten password" do
- setup do
- @user = Factory(:user)
- @user.forgot_password!
- end
-
- context "on GET to #edit with correct id and token" do
- setup do
- get :edit, :user_id => @user.to_param, :token => @user.token
- end
-
- should "find the user" do
- assert_equal @user, assigns(:user)
- end
-
- should_respond_with :success
- should_render_template "edit"
- should_display_a_password_update_form
- end
-
- should_forbid "on GET to #edit with correct id but blank token" do
- get :edit, :user_id => @user.to_param, :token => ""
- end
-
- should_forbid "on GET to #edit with correct id but no token" do
- get :edit, :user_id => @user.to_param
- end
-
- context "on PUT to #update with matching password and password confirmation" do
- setup do
- new_password = "new_password"
- @encrypted_new_password = @user.encrypt(new_password)
- assert_not_equal @encrypted_new_password, @user.encrypted_password
-
- put(:update,
- :user_id => @user,
- :token => @user.token,
- :user => {
- :password => new_password,
- :password_confirmation => new_password
- })
- @user.reload
- end
-
- should "update password" do
- assert_equal @encrypted_new_password, @user.encrypted_password
- end
-
- should "clear token" do
- assert_nil @user.token
- end
-
- should_be_signed_in_as { @user }
- should_set_the_flash_to(/signed in/i)
- should_redirect_to_url_after_update
- end
-
- context "on PUT to #update with password but blank password confirmation" do
- setup do
- new_password = "new_password"
- @encrypted_new_password = @user.encrypt(new_password)
-
- put(:update,
- :user_id => @user.to_param,
- :token => @user.token,
- :user => {
- :password => new_password,
- :password_confirmation => ''
- })
- @user.reload
- end
-
- should "not update password" do
- assert_not_equal @encrypted_new_password, @user.encrypted_password
- end
-
- should "not clear token" do
- assert_not_nil @user.token
- end
-
- should_not_be_signed_in
- should_not_set_the_flash
- should_respond_with :success
- should_render_template :edit
-
- should_display_a_password_update_form
- end
-
- should_forbid "on PUT to #update with id but no token" do
- put :update, :user_id => @user.to_param, :token => ""
- end
- end
-
- context "given two users and user one signs in" do
- setup do
- @user_one = Factory(:user)
- @user_two = Factory(:user)
- sign_in_as @user_one
- end
-
- should_forbid "when user one tries to change user two's password on GET with no token" do
- get :edit, :user_id => @user_two.to_param
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/test/controllers/sessions_controller_test.rb b/vendor/plugins/clearance/test/controllers/sessions_controller_test.rb
deleted file mode 100644
index 6a1cccb..0000000
--- a/vendor/plugins/clearance/test/controllers/sessions_controller_test.rb
+++ /dev/null
@@ -1,178 +0,0 @@
-require 'test_helper'
-
-class SessionsControllerTest < ActionController::TestCase
-
- tests Clearance::SessionsController
-
- should_filter_params :password
-
- context "on GET to /sessions/new" do
- setup { get :new }
-
- should_respond_with :success
- should_render_template :new
- should_not_set_the_flash
- should_display_a_sign_in_form
- end
-
- context "on POST to #create with unconfirmed credentials" do
- setup do
- @user = Factory(:user)
- ActionMailer::Base.deliveries.clear
- post :create, :session => {
- :email => @user.email,
- :password => @user.password }
- end
-
- should_deny_access(:flash => /User has not confirmed email. Confirmation email will be resent./i)
-
- should "send the confirmation email" do
- assert_not_nil email = ActionMailer::Base.deliveries[0]
- assert_match /account confirmation/i, email.subject
- end
- end
-
- context "on POST to #create with good credentials" do
- setup do
- @user = Factory(:email_confirmed_user)
- post :create, :session => {
- :email => @user.email,
- :password => @user.password }
- end
-
- should_set_the_flash_to /signed in/i
- should_redirect_to_url_after_create
- should_be_signed_in_as { @user }
- end
-
- context "on POST to #create with good credentials and remember me" do
- setup do
- @user = Factory(:email_confirmed_user)
- post :create, :session => {
- :email => @user.email,
- :password => @user.password,
- :remember_me => '1' }
- end
-
- should_set_the_flash_to /signed in/i
- should_redirect_to_url_after_create
- should_be_signed_in_as { @user }
-
- should 'set the cookie' do
- assert ! cookies['remember_token'].empty?
- end
-
- should 'set the token in users table' do
- assert_not_nil @user.reload.token
- assert_not_nil @user.reload.token_expires_at
- end
- end
-
- context "on POST to #create with good credentials and a session return url" do
- setup do
- @user = Factory(:email_confirmed_user)
- @return_url = '/url_in_the_session'
- @request.session[:return_to] = @return_url
- post :create, :session => {
- :email => @user.email,
- :password => @user.password }
- end
-
- should_redirect_to("the return URL") { @return_url }
- end
-
- context "on POST to #create with good credentials and a request return url" do
- setup do
- @user = Factory(:email_confirmed_user)
- @return_url = '/url_in_the_request'
- post :create, :session => {
- :email => @user.email,
- :password => @user.password },
- :return_to => @return_url
- end
-
- should_redirect_to("the return URL") { @return_url }
- end
-
- context "on POST to #create with good credentials and a session return url and request return url" do
- setup do
- @user = Factory(:email_confirmed_user)
- @return_url = '/url_in_the_session'
- @request.session[:return_to] = @return_url
- post :create, :session => {
- :email => @user.email,
- :password => @user.password },
- :return_to => '/url_in_the_request'
- end
-
- should_redirect_to("the return URL") { @return_url }
- end
-
- context "on POST to #create with bad credentials" do
- setup do
- post :create, :session => {
- :email => 'bad.email@example.com',
- :password => "bad value" }
- end
-
- should_set_the_flash_to /bad/i
- should_respond_with :unauthorized
- should_render_template :new
- should_not_be_signed_in
- end
-
- context "on POST to #create with bad credentials and remember me" do
- setup do
- post :create, :session => {
- :email => 'bad.email@example.com',
- :password => "bad value",
- :remember_me => '1' }
- end
-
- should_set_the_flash_to /bad/i
- should_respond_with :unauthorized
- should_render_template :new
- should_not_be_signed_in
-
- should 'not create the cookie' do
- assert_nil cookies['remember_token']
- end
- end
-
- context "on DELETE to #destroy given a signed out user" do
- setup do
- sign_out
- delete :destroy
- end
- should_set_the_flash_to(/signed out/i)
- should_redirect_to_url_after_destroy
- end
-
- context "on DELETE to #destroy without a cookie" do
- setup do
- sign_in
- delete :destroy
- end
- should_set_the_flash_to(/signed out/i)
- should_redirect_to_url_after_destroy
- end
-
- context "on DELETE to #destroy with a cookie" do
- setup do
- @user = Factory(:email_confirmed_user)
- cookies['remember_token'] = CGI::Cookie.new('token', 'value')
- sign_in_as @user
- delete :destroy
- end
-
- should "delete the cookie token" do
- assert_nil cookies['remember_token']
- end
-
- should "delete the database token" do
- assert_nil @user.reload.token
- assert_nil @user.reload.token_expires_at
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/test/controllers/users_controller_test.rb b/vendor/plugins/clearance/test/controllers/users_controller_test.rb
deleted file mode 100644
index c9e9057..0000000
--- a/vendor/plugins/clearance/test/controllers/users_controller_test.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'test_helper'
-
-class UsersControllerTest < ActionController::TestCase
-
- tests Clearance::UsersController
-
- should_filter_params :password
-
- context "when signed out" do
- setup { sign_out }
-
- context "on GET to #new" do
- setup { get :new }
-
- should_respond_with :success
- should_render_template :new
- should_not_set_the_flash
-
- should_display_a_sign_up_form
- end
-
- context "on GET to #new with email" do
- setup do
- @email = "a@example.com"
- get :new, :user => { :email => @email }
- end
-
- should "set assigned user's email" do
- assert_equal @email, assigns(:user).email
- end
- end
-
- context "on POST to #create with valid attributes" do
- setup do
- user_attributes = Factory.attributes_for(:user)
- post :create, :user => user_attributes
- end
-
- should_create_user_successfully
- end
- end
-
- signed_in_user_context do
- context "GET to new" do
- setup { get :new }
- should_redirect_to("the home page") { root_url }
- end
-
- context "POST to create" do
- setup { post :create, :user => {} }
- should_redirect_to("the home page") { root_url }
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/test/models/clearance_mailer_test.rb b/vendor/plugins/clearance/test/models/clearance_mailer_test.rb
deleted file mode 100644
index c7295d5..0000000
--- a/vendor/plugins/clearance/test/models/clearance_mailer_test.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'test_helper'
-
-class ClearanceMailerTest < ActiveSupport::TestCase
-
- context "A change password email" do
- setup do
- @user = Factory(:user)
- @email = ClearanceMailer.create_change_password @user
- end
-
- should "be from DO_NOT_REPLY" do
- assert_match /#{@email.from[0]}/i, DO_NOT_REPLY
- end
-
- should "be sent to user" do
- assert_match /#{@user.email}/i, @email.to.first
- end
-
- should "contain a link to edit the user's password" do
- host = ActionMailer::Base.default_url_options[:host]
- regexp = %r{http://#{host}/users/#{@user.id}/password/edit\?token=#{@user.token}}
- assert_match regexp, @email.body
- end
-
- should "set its subject" do
- assert_match /Change your password/, @email.subject
- end
- end
-
- context "A confirmation email" do
- setup do
- @user = Factory(:user)
- @email = ClearanceMailer.create_confirmation @user
- end
-
- should "be from DO_NOT_REPLY" do
- assert_match /#{@email.from[0]}/i, DO_NOT_REPLY
- end
-
- should "be sent to user" do
- assert_match /#{@user.email}/i, @email.to.first
- end
-
- should "set its subject" do
- assert_match /Account confirmation/, @email.subject
- end
-
- should "contain a link to confirm the user's account" do
- host = ActionMailer::Base.default_url_options[:host]
- regexp = %r{http://#{host}/users/#{@user.id}/confirmation/new\?token=#{@user.token}}
- assert_match regexp, @email.body
- end
- end
-
-end
diff --git a/vendor/plugins/clearance/test/models/user_test.rb b/vendor/plugins/clearance/test/models/user_test.rb
deleted file mode 100644
index 4266409..0000000
--- a/vendor/plugins/clearance/test/models/user_test.rb
+++ /dev/null
@@ -1,233 +0,0 @@
-require 'test_helper'
-
-class UserTest < ActiveSupport::TestCase
-
- should_not_allow_mass_assignment_of :email_confirmed,
- :salt, :encrypted_password,
- :token, :token_expires_at
-
- # signing up
-
- context "When signing up" do
- should_validate_presence_of :email, :password
- should_allow_values_for :email, "foo@example.com"
- should_not_allow_values_for :email, "foo"
- should_not_allow_values_for :email, "example.com"
-
- should "require password confirmation on create" do
- user = Factory.build(:user, :password => 'blah',
- :password_confirmation => 'boogidy')
- assert ! user.save
- assert user.errors.on(:password)
- end
-
- should "require non blank password confirmation on create" do
- user = Factory.build(:user, :password => 'blah',
- :password_confirmation => '')
- assert ! user.save
- assert user.errors.on(:password)
- end
-
- should "initialize salt" do
- assert_not_nil Factory(:user).salt
- end
-
- should "initialize token without expiry date" do
- assert_not_nil Factory(:user).token
- assert_nil Factory(:user).token_expires_at
- end
-
- context "encrypt password" do
- setup do
- @salt = "salt"
- @user = Factory.build(:user, :salt => @salt)
- def @user.initialize_salt; end
- @user.save!
- @password = @user.password
-
- @user.encrypt(@password)
- @expected = Digest::SHA1.hexdigest("--#{@salt}--#{@password}--")
- end
-
- should "create an encrypted password using SHA1 encryption" do
- assert_equal @expected, @user.encrypted_password
- end
- end
-
- should "store email in exact case" do
- user = Factory(:user, :email => "John.Doe@example.com")
- assert_equal "John.Doe@example.com", user.email
- end
- end
-
- context "When multiple users have signed up" do
- setup { @user = Factory(:user) }
- should_validate_uniqueness_of :email
- end
-
- # confirming email
-
- context "A user without email confirmation" do
- setup do
- @user = Factory(:user)
- assert ! @user.email_confirmed?
- end
-
- context "after #confirm_email!" do
- setup do
- assert @user.confirm_email!
- @user.reload
- end
-
- should "have confirmed their email" do
- assert @user.email_confirmed?
- end
-
- should "reset token" do
- assert_nil @user.token
- end
- end
- end
-
- # authenticating
-
- context "A user" do
- setup do
- @user = Factory(:user)
- @password = @user.password
- end
-
- should "authenticate with good credentials" do
- assert ::User.authenticate(@user.email, @password)
- assert @user.authenticated?(@password)
- end
-
- should "not authenticate with bad credentials" do
- assert ! ::User.authenticate(@user.email, 'bad_password')
- assert ! @user.authenticated?('bad_password')
- end
- end
-
- # remember me
-
- context "When authenticating with remember_me!" do
- setup do
- @user = Factory(:email_confirmed_user)
- @token = @user.token
- assert_nil @user.token_expires_at
- @user.remember_me!
- end
-
- should "set the remember token and expiration date" do
- assert_not_equal @token, @user.token
- assert_not_nil @user.token_expires_at
- end
-
- should "remember user when token expires in the future" do
- @user.update_attribute :token_expires_at,
- 2.weeks.from_now.utc
- assert @user.remember?
- end
-
- should "not remember user when token has already expired" do
- @user.update_attribute :token_expires_at,
- 2.weeks.ago.utc
- assert ! @user.remember?
- end
-
- should "not remember user when token expiry date is not set" do
- @user.update_attribute :token_expires_at, nil
- assert ! @user.remember?
- end
-
- # logging out
-
- context "forget_me!" do
- setup { @user.forget_me! }
-
- should "unset the remember token and expiration date" do
- assert_nil @user.token
- assert_nil @user.token_expires_at
- end
-
- should "not remember user" do
- assert ! @user.remember?
- end
- end
- end
-
- # updating password
-
- context "An email confirmed user" do
- setup do
- @user = Factory(:email_confirmed_user)
- @old_encrypted_password = @user.encrypted_password
- end
-
- context "who updates password with confirmation" do
- setup do
- @user.update_password("new_password", "new_password")
- end
-
- should "change encrypted password" do
- assert_not_equal @user.encrypted_password,
- @old_encrypted_password
- end
- end
- end
-
- # recovering forgotten password
-
- context "An email confirmed user" do
- setup do
- @user = Factory(:email_confirmed_user)
- @old_encrypted_password = @user.encrypted_password
- @user.confirm_email!
- end
-
- context "who requests password reminder" do
- setup do
- assert_nil @user.token
- @user.forgot_password!
- end
-
- should "generate token" do
- assert_not_nil @user.token
- end
-
- context "and then updates password" do
- context 'with confirmation' do
- setup do
- @user.update_password("new_password", "new_password")
- end
-
- should "change encrypted password" do
- assert_not_equal @user.encrypted_password,
- @old_encrypted_password
- end
-
- should "clear token" do
- assert_nil @user.token
- end
- end
-
- context 'without confirmation' do
- setup do
- @user.update_password("new_password", "")
- end
-
- should "not change encrypted password" do
- assert_equal @user.encrypted_password,
- @old_encrypted_password
- end
-
- should "not clear token" do
- assert_not_nil @user.token
- end
- end
- end
- end
-
- end
-
-end
diff --git a/vendor/plugins/clearance/test/rails_root/.gitignore b/vendor/plugins/clearance/test/rails_root/.gitignore
deleted file mode 100644
index 5964c47..0000000
--- a/vendor/plugins/clearance/test/rails_root/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-log/*
-tmp/**/*
-db/schema.rb
-db/*.sqlite3
-public/system
-*.DS_Store
-coverage/*
-*.swp
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/.rake_tasks b/vendor/plugins/clearance/test/rails_root/.rake_tasks
deleted file mode 100644
index 63bec09..0000000
--- a/vendor/plugins/clearance/test/rails_root/.rake_tasks
+++ /dev/null
@@ -1,103 +0,0 @@
-db:abort_if_pending_migrations
-db:bootstrap
-db:bootstrap:load
-db:charset
-db:collation
-db:create
-db:create:all
-db:drop
-db:drop:all
-db:fixtures:identify
-db:fixtures:load
-db:migrate
-db:migrate:down
-db:migrate:redo
-db:migrate:reset
-db:migrate:up
-db:reset
-db:rollback
-db:schema:dump
-db:schema:load
-db:sessions:clear
-db:sessions:create
-db:structure:dump
-db:test:clone
-db:test:clone_structure
-db:test:prepare
-db:test:purge
-db:version
-deploy
-doc:app
-doc:clobber_app
-doc:clobber_plugins
-doc:clobber_rails
-doc:plugins
-doc:rails
-doc:reapp
-doc:rerails
-gems
-gems:build
-gems:install
-gems:unpack
-gems:unpack:dependencies
-git:branch:production
-git:diff:production
-git:diff:staging
-git:pull:template
-git:push:production
-git:push:staging
-log:clear
-notes
-notes:fixme
-notes:optimize
-notes:todo
-rails:freeze:edge
-rails:freeze:gems
-rails:unfreeze
-rails:update
-rails:update:configs
-rails:update:javascripts
-rails:update:scripts
-remote:cleanup
-remote:cold_deploy
-remote:deploy
-remote:deploy_with_migrations
-remote:diff_from_last_deploy
-remote:disable_web
-remote:enable_web
-remote:exec
-remote:invoke
-remote:migrate
-remote:restart
-remote:rollback
-remote:rollback_code
-remote:setup
-remote:shell
-remote:show_tasks
-remote:spinner
-remote:symlink
-remote:update
-remote:update_code
-remote:update_current
-rollback
-routes
-secret
-shoulda:from_yaml
-shoulda:list
-stats
-test
-test:functionals
-test:integration
-test:plugins
-test:recent
-test:uncommitted
-test:units
-time:zones:all
-time:zones:local
-time:zones:us
-tmp:cache:clear
-tmp:clear
-tmp:create
-tmp:pids:clear
-tmp:sessions:clear
-tmp:sockets:clear
diff --git a/vendor/plugins/clearance/test/rails_root/Capfile b/vendor/plugins/clearance/test/rails_root/Capfile
deleted file mode 100644
index c36d48d..0000000
--- a/vendor/plugins/clearance/test/rails_root/Capfile
+++ /dev/null
@@ -1,3 +0,0 @@
-load 'deploy' if respond_to?(:namespace) # cap2 differentiator
-Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
-load 'config/deploy'
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/Rakefile b/vendor/plugins/clearance/test/rails_root/Rakefile
deleted file mode 100644
index 3bb0e85..0000000
--- a/vendor/plugins/clearance/test/rails_root/Rakefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
diff --git a/vendor/plugins/clearance/test/rails_root/app/controllers/accounts_controller.rb b/vendor/plugins/clearance/test/rails_root/app/controllers/accounts_controller.rb
deleted file mode 100644
index a54e1ad..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/controllers/accounts_controller.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-class AccountsController < ApplicationController
- before_filter :authenticate
-
- def edit
- end
-
- def create
- redirect_to edit_account_path
- end
-end
diff --git a/vendor/plugins/clearance/test/rails_root/app/controllers/application_controller.rb b/vendor/plugins/clearance/test/rails_root/app/controllers/application_controller.rb
deleted file mode 100644
index 8312eee..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/controllers/application_controller.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class ApplicationController < ActionController::Base
- helper :all
- protect_from_forgery
- include Clearance::Authentication
-end
diff --git a/vendor/plugins/clearance/test/rails_root/app/helpers/application_helper.rb b/vendor/plugins/clearance/test/rails_root/app/helpers/application_helper.rb
deleted file mode 100644
index 7ad714a..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/helpers/application_helper.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module ApplicationHelper
- def body_class
- "#{controller.controller_name} #{controller.controller_name}-#{controller.action_name}"
- end
-end
diff --git a/vendor/plugins/clearance/test/rails_root/app/helpers/confirmations_helper.rb b/vendor/plugins/clearance/test/rails_root/app/helpers/confirmations_helper.rb
deleted file mode 100644
index e475aa1..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/helpers/confirmations_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module ConfirmationsHelper
-end
diff --git a/vendor/plugins/clearance/test/rails_root/app/helpers/passwords_helper.rb b/vendor/plugins/clearance/test/rails_root/app/helpers/passwords_helper.rb
deleted file mode 100644
index 8797917..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/helpers/passwords_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module PasswordsHelper
-end
diff --git a/vendor/plugins/clearance/test/rails_root/app/models/.keep b/vendor/plugins/clearance/test/rails_root/app/models/.keep
deleted file mode 100644
index e69de29..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/models/.keep
+++ /dev/null
diff --git a/vendor/plugins/clearance/test/rails_root/app/views/accounts/edit.html.erb b/vendor/plugins/clearance/test/rails_root/app/views/accounts/edit.html.erb
deleted file mode 100644
index e69de29..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/views/accounts/edit.html.erb
+++ /dev/null
diff --git a/vendor/plugins/clearance/test/rails_root/app/views/layouts/application.html.erb b/vendor/plugins/clearance/test/rails_root/app/views/layouts/application.html.erb
deleted file mode 100644
index 56a61f6..0000000
--- a/vendor/plugins/clearance/test/rails_root/app/views/layouts/application.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- Clearance
- <%= stylesheet_link_tag 'screen', :media => 'all' %>
- <%= javascript_include_tag :defaults %>
-
-
-
- <% flash.each do |key, value| -%>
-
<%=h value %>
- <% end %>
-
- <%= yield %>
-
-
diff --git a/vendor/plugins/clearance/test/rails_root/config/boot.rb b/vendor/plugins/clearance/test/rails_root/config/boot.rb
deleted file mode 100644
index 0ad0f78..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/boot.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.3.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
diff --git a/vendor/plugins/clearance/test/rails_root/config/database.yml b/vendor/plugins/clearance/test/rails_root/config/database.yml
deleted file mode 100644
index 55bd1c6..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/database.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
diff --git a/vendor/plugins/clearance/test/rails_root/config/environment.rb b/vendor/plugins/clearance/test/rails_root/config/environment.rb
deleted file mode 100644
index 2215092..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/environment.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.join(File.dirname(__FILE__), 'boot')
-require 'digest/md5'
-
-Rails::Initializer.run do |config|
- config.load_paths += Dir.glob(File.join(RAILS_ROOT, 'vendor', 'gems', '*', 'lib'))
- config.time_zone = 'Eastern Time (US & Canada)'
- config.action_controller.session = {
- :session_key => "_clearance_session",
- :secret => ['clearance', 'random', 'words', 'here'].map {|k| Digest::MD5.hexdigest(k) }.join
- }
-end
-
-DO_NOT_REPLY = "donotreply@example.com"
diff --git a/vendor/plugins/clearance/test/rails_root/config/environments/development.rb b/vendor/plugins/clearance/test/rails_root/config/environments/development.rb
deleted file mode 100644
index 4013d5b..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/environments/development.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# In the development environment your application's code is reloaded on
-# every request. This slows down response time but is perfect for development
-# since you don't have to restart the webserver when you make code changes.
-config.cache_classes = false
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.debug_rjs = true
-
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
-
-HOST = "localhost"
diff --git a/vendor/plugins/clearance/test/rails_root/config/environments/production.rb b/vendor/plugins/clearance/test/rails_root/config/environments/production.rb
deleted file mode 100644
index 5a0b99e..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/environments/production.rb
+++ /dev/null
@@ -1 +0,0 @@
-HOST = "http://example.com"
diff --git a/vendor/plugins/clearance/test/rails_root/config/environments/test.rb b/vendor/plugins/clearance/test/rails_root/config/environments/test.rb
deleted file mode 100644
index fbe8599..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/environments/test.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
-
-# Tell ActionMailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
-
-HOST = "localhost"
-
-config.gem 'thoughtbot-shoulda',
- :lib => 'shoulda',
- :source => "http://gems.github.com",
- :version => '>= 2.9.1'
-config.gem 'thoughtbot-factory_girl',
- :lib => 'factory_girl',
- :source => "http://gems.github.com",
- :version => '>= 1.2.0'
diff --git a/vendor/plugins/clearance/test/rails_root/config/initializers/clearance.rb b/vendor/plugins/clearance/test/rails_root/config/initializers/clearance.rb
deleted file mode 100644
index 601e97c..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/initializers/clearance.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# This simulates loading the clearance gem, but without relying on
-# vendor/gems
-
-clearance_path = File.join(File.dirname(__FILE__), *%w(.. .. .. ..))
-clearance_lib_path = File.join(clearance_path, "lib")
-
-$LOAD_PATH.unshift(clearance_lib_path)
-load File.join(clearance_path, 'rails', 'init.rb')
diff --git a/vendor/plugins/clearance/test/rails_root/config/initializers/inflections.rb b/vendor/plugins/clearance/test/rails_root/config/initializers/inflections.rb
deleted file mode 100644
index 09158b8..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/initializers/inflections.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
diff --git a/vendor/plugins/clearance/test/rails_root/config/initializers/mime_types.rb b/vendor/plugins/clearance/test/rails_root/config/initializers/mime_types.rb
deleted file mode 100644
index 72aca7e..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/initializers/mime_types.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
diff --git a/vendor/plugins/clearance/test/rails_root/config/initializers/requires.rb b/vendor/plugins/clearance/test/rails_root/config/initializers/requires.rb
deleted file mode 100644
index 5acec2b..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/initializers/requires.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-Dir[File.join(RAILS_ROOT, 'lib', 'extensions', '*.rb')].each do |f|
- require f
-end
-
-Dir[File.join(RAILS_ROOT, 'lib', '*.rb')].each do |f|
- require f
-end
-
-# Rails 2 doesn't like mocks
-
-Dir[File.join(RAILS_ROOT, 'test', 'mocks', RAILS_ENV, '*.rb')].each do |f|
- require f
-end
diff --git a/vendor/plugins/clearance/test/rails_root/config/initializers/time_formats.rb b/vendor/plugins/clearance/test/rails_root/config/initializers/time_formats.rb
deleted file mode 100644
index 99cc335..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/initializers/time_formats.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# Example time formats
-{ :short_date => "%x", :long_date => "%a, %b %d, %Y" }.each do |k, v|
- ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(k => v)
-end
diff --git a/vendor/plugins/clearance/test/rails_root/config/locales/en.yml b/vendor/plugins/clearance/test/rails_root/config/locales/en.yml
deleted file mode 100644
index fb5e204..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/locales/en.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-en:
- clearance:
- models:
- clearance_mailer:
- change_password: Change your password
- confirmation: Account confirmation
- controllers:
- confirmations:
- confirmed_email: Confirmed email and signed in.
- passwords:
- deliver_change_password: You will receive an email within the next few minutes. It contains instructions for changing your password.
- unknown_email: Unknown email.
- sessions:
- bad_email_or_password: Bad email or password.
- unconfirmed_email: User has not confirmed email. Confirmation email will be resent.
- users:
- deliver_confirmation: You will receive an email within the next few minutes. It contains instructions for confirming your account.
- signed_in: Signed in.
- signed_out: Signed out.
diff --git a/vendor/plugins/clearance/test/rails_root/config/routes.rb b/vendor/plugins/clearance/test/rails_root/config/routes.rb
deleted file mode 100644
index ca45194..0000000
--- a/vendor/plugins/clearance/test/rails_root/config/routes.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- map.resource :account
-
- map.root :controller => 'accounts', :action => 'edit'
-end
diff --git a/vendor/plugins/clearance/test/rails_root/db/.keep b/vendor/plugins/clearance/test/rails_root/db/.keep
deleted file mode 100644
index e69de29..0000000
--- a/vendor/plugins/clearance/test/rails_root/db/.keep
+++ /dev/null
diff --git a/vendor/plugins/clearance/test/rails_root/doc/README_FOR_APP b/vendor/plugins/clearance/test/rails_root/doc/README_FOR_APP
deleted file mode 100644
index ac6c149..0000000
--- a/vendor/plugins/clearance/test/rails_root/doc/README_FOR_APP
+++ /dev/null
@@ -1,2 +0,0 @@
-Use this README file to introduce your application and point to useful places in the API for learning more.
-Run "rake appdoc" to generate API documentation for your models and controllers.
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/doc/README_FOR_TEMPLATE b/vendor/plugins/clearance/test/rails_root/doc/README_FOR_TEMPLATE
deleted file mode 100644
index e890e2c..0000000
--- a/vendor/plugins/clearance/test/rails_root/doc/README_FOR_TEMPLATE
+++ /dev/null
@@ -1,15 +0,0 @@
-This is the Thoughtbot Rails Template. To create a new project, checkout this
-repository and run:
-
- ./script/create_project.rb projectname
-
-This will create a project in ../projectname. You should then follow the
-instructions on Github to upload that project there. This script creates an
-entirely new git repository, and is not meant to be used against an existing
-repo.
-
-When making a change to a project that was created via this template, consider
-whether it's a change that should be made across all projects. If so, then
-make the change in this template, and pull it into your project via:
-
- git pull git@github.com:thoughtbot/rails-template.git master
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/features/step_definitions/webrat_steps.rb b/vendor/plugins/clearance/test/rails_root/features/step_definitions/webrat_steps.rb
deleted file mode 100644
index 30841f9..0000000
--- a/vendor/plugins/clearance/test/rails_root/features/step_definitions/webrat_steps.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
-
-# Commonly used webrat steps
-# http://github.com/brynary/webrat
-
-When /^I go to (.+)$/ do |page_name|
- visit path_to(page_name)
-end
-
-When /^I press "(.*)"$/ do |button|
- click_button(button)
-end
-
-When /^I follow "(.*)"$/ do |link|
- click_link(link)
-end
-
-When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
- fill_in(field, :with => value)
-end
-
-When /^I select "(.*)" from "(.*)"$/ do |value, field|
- select(value, :from => field)
-end
-
-# Use this step in conjunction with Rail's datetime_select helper. For example:
-# When I select "December 25, 2008 10:00" as the date and time
-When /^I select "(.*)" as the date and time$/ do |time|
- select_datetime(time)
-end
-
-# Use this step when using multiple datetime_select helpers on a page or
-# you want to specify which datetime to select. Given the following view:
-# <%= f.label :preferred %>
-# <%= f.datetime_select :preferred %>
-# <%= f.label :alternative %>
-# <%= f.datetime_select :alternative %>
-# The following steps would fill out the form:
-# When I select "November 23, 2004 11:20" as the "Preferred" data and time
-# And I select "November 25, 2004 10:30" as the "Alternative" data and time
-When /^I select "(.*)" as the "(.*)" date and time$/ do |datetime, datetime_label|
- select_datetime(datetime, :from => datetime_label)
-end
-
-# Use this step in conjuction with Rail's time_select helper. For example:
-# When I select "2:20PM" as the time
-# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
-# will convert the 2:20PM to 14:20 and then select it.
-When /^I select "(.*)" as the time$/ do |time|
- select_time(time)
-end
-
-# Use this step when using multiple time_select helpers on a page or you want to
-# specify the name of the time on the form. For example:
-# When I select "7:30AM" as the "Gym" time
-When /^I select "(.*)" as the "(.*)" time$/ do |time, time_label|
- select_time(time, :from => time_label)
-end
-
-# Use this step in conjuction with Rail's date_select helper. For example:
-# When I select "February 20, 1981" as the date
-When /^I select "(.*)" as the date$/ do |date|
- select_date(date)
-end
-
-# Use this step when using multiple date_select helpers on one page or
-# you want to specify the name of the date on the form. For example:
-# When I select "April 26, 1982" as the "Date of Birth" date
-When /^I select "(.*)" as the "(.*)" date$/ do |date, date_label|
- select_date(date, :from => date_label)
-end
-
-When /^I check "(.*)"$/ do |field|
- check(field)
-end
-
-When /^I uncheck "(.*)"$/ do |field|
- uncheck(field)
-end
-
-When /^I choose "(.*)"$/ do |field|
- choose(field)
-end
-
-When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
- attach_file(field, path)
-end
-
-Then /^I should see "(.*)"$/ do |text|
- assert_match /#{text}/m, response.body
-end
-
-Then /^I should not see "(.*)"$/ do |text|
- assert_match /#{text}/m, response.body
-end
-
-Then /^the "(.*)" checkbox should be checked$/ do |label|
- field_labeled(label).should be_checked
-end
diff --git a/vendor/plugins/clearance/test/rails_root/features/support/env.rb b/vendor/plugins/clearance/test/rails_root/features/support/env.rb
deleted file mode 100644
index 52bceb8..0000000
--- a/vendor/plugins/clearance/test/rails_root/features/support/env.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# Sets up the Rails environment for Cucumber
-ENV["RAILS_ENV"] = "test"
-require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
-require 'factory_girl'
-require 'cucumber/rails/world'
-require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
-Cucumber::Rails.use_transactional_fixtures
-Cucumber::Rails.bypass_rescue
-
-require 'webrat'
-
-Webrat.configure do |config|
- config.mode = :rails
-end
diff --git a/vendor/plugins/clearance/test/rails_root/public/.htaccess b/vendor/plugins/clearance/test/rails_root/public/.htaccess
deleted file mode 100644
index d3c9983..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/.htaccess
+++ /dev/null
@@ -1,40 +0,0 @@
-# General Apache options
-AddHandler fastcgi-script .fcgi
-AddHandler cgi-script .cgi
-Options +FollowSymLinks +ExecCGI
-
-# If you don't want Rails to look in certain directories,
-# use the following rewrite rules so that Apache won't rewrite certain requests
-#
-# Example:
-# RewriteCond %{REQUEST_URI} ^/notrails.*
-# RewriteRule .* - [L]
-
-# Redirect all requests not available on the filesystem to Rails
-# By default the cgi dispatcher is used which is very slow
-#
-# For better performance replace the dispatcher with the fastcgi one
-#
-# Example:
-# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-RewriteEngine On
-
-# If your Rails application is accessed via an Alias directive,
-# then you MUST also set the RewriteBase in this htaccess file.
-#
-# Example:
-# Alias /myrailsapp /path/to/myrailsapp/public
-# RewriteBase /myrailsapp
-
-RewriteRule ^$ index.html [QSA]
-RewriteRule ^([^.]+)$ $1.html [QSA]
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
-
-# In case Rails experiences terminal errors
-# Instead of displaying this message you can supply a file here which will be rendered instead
-#
-# Example:
-# ErrorDocument 500 /500.html
-
-ErrorDocument 500 "
Application error
Rails application failed to start properly"
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/public/404.html b/vendor/plugins/clearance/test/rails_root/public/404.html
deleted file mode 100644
index eff660b..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/404.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- The page you were looking for doesn't exist (404)
-
-
-
-
-
-
-
The page you were looking for doesn't exist.
-
You may have mistyped the address or the page may have moved.
-
-
-
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/public/422.html b/vendor/plugins/clearance/test/rails_root/public/422.html
deleted file mode 100644
index b54e4a3..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/422.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- The change you wanted was rejected (422)
-
-
-
-
-
-
-
The change you wanted was rejected.
-
Maybe you tried to change something you didn't have access to.
-
-
-
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/public/500.html b/vendor/plugins/clearance/test/rails_root/public/500.html
deleted file mode 100644
index f0aee0e..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/500.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- We're sorry, but something went wrong
-
-
-
-
-
-
-
We're sorry, but something went wrong.
-
We've been notified about this issue and we'll take a look at it shortly.
-
-
-
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/public/dispatch.rb b/vendor/plugins/clearance/test/rails_root/public/dispatch.rb
deleted file mode 100755
index a76782a..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/dispatch.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/opt/local/bin/ruby
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
\ No newline at end of file
diff --git a/vendor/plugins/clearance/test/rails_root/public/favicon.ico b/vendor/plugins/clearance/test/rails_root/public/favicon.ico
deleted file mode 100644
index e69de29..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/favicon.ico
+++ /dev/null
diff --git a/vendor/plugins/clearance/test/rails_root/public/images/rails.png b/vendor/plugins/clearance/test/rails_root/public/images/rails.png
deleted file mode 100644
index b8441f1..0000000
Binary files a/vendor/plugins/clearance/test/rails_root/public/images/rails.png and /dev/null differ
diff --git a/vendor/plugins/clearance/test/rails_root/public/javascripts/application.js b/vendor/plugins/clearance/test/rails_root/public/javascripts/application.js
deleted file mode 100644
index fe45776..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/javascripts/application.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
diff --git a/vendor/plugins/clearance/test/rails_root/public/javascripts/builder.js b/vendor/plugins/clearance/test/rails_root/public/javascripts/builder.js
deleted file mode 100644
index 5b4ce87..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/javascripts/builder.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// script.aculo.us builder.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007
-
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//
-// script.aculo.us is freely distributable under the terms of an MIT-style license.
-// For details, see the script.aculo.us web site: http://script.aculo.us/
-
-var Builder = {
- NODEMAP: {
- AREA: 'map',
- CAPTION: 'table',
- COL: 'table',
- COLGROUP: 'table',
- LEGEND: 'fieldset',
- OPTGROUP: 'select',
- OPTION: 'select',
- PARAM: 'object',
- TBODY: 'table',
- TD: 'table',
- TFOOT: 'table',
- TH: 'table',
- THEAD: 'table',
- TR: 'table'
- },
- // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
- // due to a Firefox bug
- node: function(elementName) {
- elementName = elementName.toUpperCase();
-
- // try innerHTML approach
- var parentTag = this.NODEMAP[elementName] || 'div';
- var parentElement = document.createElement(parentTag);
- try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
- parentElement.innerHTML = "<" + elementName + ">" + elementName + ">";
- } catch(e) {}
- var element = parentElement.firstChild || null;
-
- // see if browser added wrapping tags
- if(element && (element.tagName.toUpperCase() != elementName))
- element = element.getElementsByTagName(elementName)[0];
-
- // fallback to createElement approach
- if(!element) element = document.createElement(elementName);
-
- // abort if nothing could be created
- if(!element) return;
-
- // attributes (or text)
- if(arguments[1])
- if(this._isStringOrNumber(arguments[1]) ||
- (arguments[1] instanceof Array) ||
- arguments[1].tagName) {
- this._children(element, arguments[1]);
- } else {
- var attrs = this._attributes(arguments[1]);
- if(attrs.length) {
- try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
- parentElement.innerHTML = "<" +elementName + " " +
- attrs + ">" + elementName + ">";
- } catch(e) {}
- element = parentElement.firstChild || null;
- // workaround firefox 1.0.X bug
- if(!element) {
- element = document.createElement(elementName);
- for(attr in arguments[1])
- element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
- }
- if(element.tagName.toUpperCase() != elementName)
- element = parentElement.getElementsByTagName(elementName)[0];
- }
- }
-
- // text, or array of children
- if(arguments[2])
- this._children(element, arguments[2]);
-
- return element;
- },
- _text: function(text) {
- return document.createTextNode(text);
- },
-
- ATTR_MAP: {
- 'className': 'class',
- 'htmlFor': 'for'
- },
-
- _attributes: function(attributes) {
- var attrs = [];
- for(attribute in attributes)
- attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
- '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"');
- return attrs.join(" ");
- },
- _children: function(element, children) {
- if(children.tagName) {
- element.appendChild(children);
- return;
- }
- if(typeof children=='object') { // array can hold nodes and text
- children.flatten().each( function(e) {
- if(typeof e=='object')
- element.appendChild(e)
- else
- if(Builder._isStringOrNumber(e))
- element.appendChild(Builder._text(e));
- });
- } else
- if(Builder._isStringOrNumber(children))
- element.appendChild(Builder._text(children));
- },
- _isStringOrNumber: function(param) {
- return(typeof param=='string' || typeof param=='number');
- },
- build: function(html) {
- var element = this.node('div');
- $(element).update(html.strip());
- return element.down();
- },
- dump: function(scope) {
- if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
-
- var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
- "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
- "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
- "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
- "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
- "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
-
- tags.each( function(tag){
- scope[tag] = function() {
- return Builder.node.apply(Builder, [tag].concat($A(arguments)));
- }
- });
- }
-}
diff --git a/vendor/plugins/clearance/test/rails_root/public/javascripts/controls.js b/vendor/plugins/clearance/test/rails_root/public/javascripts/controls.js
deleted file mode 100644
index 5aaf0bb..0000000
--- a/vendor/plugins/clearance/test/rails_root/public/javascripts/controls.js
+++ /dev/null
@@ -1,963 +0,0 @@
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
-// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
-// Contributors:
-// Richard Livsey
-// Rahul Bhargava
-// Rob Wills
-//
-// script.aculo.us is freely distributable under the terms of an MIT-style license.
-// For details, see the script.aculo.us web site: http://script.aculo.us/
-
-// Autocompleter.Base handles all the autocompletion functionality
-// that's independent of the data source for autocompletion. This
-// includes drawing the autocompletion menu, observing keyboard
-// and mouse events, and similar.
-//
-// Specific autocompleters need to provide, at the very least,
-// a getUpdatedChoices function that will be invoked every time
-// the text inside the monitored textbox changes. This method
-// should get the text for which to provide autocompletion by
-// invoking this.getToken(), NOT by directly accessing
-// this.element.value. This is to allow incremental tokenized
-// autocompletion. Specific auto-completion logic (AJAX, etc)
-// belongs in getUpdatedChoices.
-//
-// Tokenized incremental autocompletion is enabled automatically
-// when an autocompleter is instantiated with the 'tokens' option
-// in the options parameter, e.g.:
-// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
-// will incrementally autocomplete with a comma as the token.
-// Additionally, ',' in the above example can be replaced with
-// a token array, e.g. { tokens: [',', '\n'] } which
-// enables autocompletion on multiple tokens. This is most
-// useful when one of the tokens is \n (a newline), as it
-// allows smart autocompletion after linebreaks.
-
-if(typeof Effect == 'undefined')
- throw("controls.js requires including script.aculo.us' effects.js library");
-
-var Autocompleter = { }
-Autocompleter.Base = Class.create({
- baseInitialize: function(element, update, options) {
- element = $(element)
- this.element = element;
- this.update = $(update);
- this.hasFocus = false;
- this.changed = false;
- this.active = false;
- this.index = 0;
- this.entryCount = 0;
- this.oldElementValue = this.element.value;
-
- if(this.setOptions)
- this.setOptions(options);
- else
- this.options = options || { };
-
- this.options.paramName = this.options.paramName || this.element.name;
- this.options.tokens = this.options.tokens || [];
- this.options.frequency = this.options.frequency || 0.4;
- this.options.minChars = this.options.minChars || 1;
- this.options.onShow = this.options.onShow ||
- function(element, update){
- if(!update.style.position || update.style.position=='absolute') {
- update.style.position = 'absolute';
- Position.clone(element, update, {
- setHeight: false,
- offsetTop: element.offsetHeight
- });
- }
- Effect.Appear(update,{duration:0.15});
- };
- this.options.onHide = this.options.onHide ||
- function(element, update){ new Effect.Fade(update,{duration:0.15}) };
-
- if(typeof(this.options.tokens) == 'string')
- this.options.tokens = new Array(this.options.tokens);
- // Force carriage returns as token delimiters anyway
- if (!this.options.tokens.include('\n'))
- this.options.tokens.push('\n');
-
- this.observer = null;
-
- this.element.setAttribute('autocomplete','off');
-
- Element.hide(this.update);
-
- Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
- Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
- },
-
- show: function() {
- if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
- if(!this.iefix &&
- (Prototype.Browser.IE) &&
- (Element.getStyle(this.update, 'position')=='absolute')) {
- new Insertion.After(this.update,
- '');
- this.iefix = $(this.update.id+'_iefix');
- }
- if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
- },
-
- fixIEOverlapping: function() {
- Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
- this.iefix.style.zIndex = 1;
- this.update.style.zIndex = 2;
- Element.show(this.iefix);
- },
-
- hide: function() {
- this.stopIndicator();
- if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
- if(this.iefix) Element.hide(this.iefix);
- },
-
- startIndicator: function() {
- if(this.options.indicator) Element.show(this.options.indicator);
- },
-
- stopIndicator: function() {
- if(this.options.indicator) Element.hide(this.options.indicator);
- },
-
- onKeyPress: function(event) {
- if(this.active)
- switch(event.keyCode) {
- case Event.KEY_TAB:
- case Event.KEY_RETURN:
- this.selectEntry();
- Event.stop(event);
- case Event.KEY_ESC:
- this.hide();
- this.active = false;
- Event.stop(event);
- return;
- case Event.KEY_LEFT:
- case Event.KEY_RIGHT:
- return;
- case Event.KEY_UP:
- this.markPrevious();
- this.render();
- Event.stop(event);
- return;
- case Event.KEY_DOWN:
- this.markNext();
- this.render();
- Event.stop(event);
- return;
- }
- else
- if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
- (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
-
- this.changed = true;
- this.hasFocus = true;
-
- if(this.observer) clearTimeout(this.observer);
- this.observer =
- setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
- },
-
- activate: function() {
- this.changed = false;
- this.hasFocus = true;
- this.getUpdatedChoices();
- },
-
- onHover: function(event) {
- var element = Event.findElement(event, 'LI');
- if(this.index != element.autocompleteIndex)
- {
- this.index = element.autocompleteIndex;
- this.render();
- }
- Event.stop(event);
- },
-
- onClick: function(event) {
- var element = Event.findElement(event, 'LI');
- this.index = element.autocompleteIndex;
- this.selectEntry();
- this.hide();
- },
-
- onBlur: function(event) {
- // needed to make click events working
- setTimeout(this.hide.bind(this), 250);
- this.hasFocus = false;
- this.active = false;
- },
-
- render: function() {
- if(this.entryCount > 0) {
- for (var i = 0; i < this.entryCount; i++)
- this.index==i ?
- Element.addClassName(this.getEntry(i),"selected") :
- Element.removeClassName(this.getEntry(i),"selected");
- if(this.hasFocus) {
- this.show();
- this.active = true;
- }
- } else {
- this.active = false;
- this.hide();
- }
- },
-
- markPrevious: function() {
- if(this.index > 0) this.index--
- else this.index = this.entryCount-1;
- this.getEntry(this.index).scrollIntoView(true);
- },
-
- markNext: function() {
- if(this.index < this.entryCount-1) this.index++
- else this.index = 0;
- this.getEntry(this.index).scrollIntoView(false);
- },
-
- getEntry: function(index) {
- return this.update.firstChild.childNodes[index];
- },
-
- getCurrentEntry: function() {
- return this.getEntry(this.index);
- },
-
- selectEntry: function() {
- this.active = false;
- this.updateElement(this.getCurrentEntry());
- },
-
- updateElement: function(selectedElement) {
- if (this.options.updateElement) {
- this.options.updateElement(selectedElement);
- return;
- }
- var value = '';
- if (this.options.select) {
- var nodes = $(selectedElement).select('.' + this.options.select) || [];
- if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
- } else
- value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
-
- var bounds = this.getTokenBounds();
- if (bounds[0] != -1) {
- var newValue = this.element.value.substr(0, bounds[0]);
- var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
- if (whitespace)
- newValue += whitespace[0];
- this.element.value = newValue + value + this.element.value.substr(bounds[1]);
- } else {
- this.element.value = value;
- }
- this.oldElementValue = this.element.value;
- this.element.focus();
-
- if (this.options.afterUpdateElement)
- this.options.afterUpdateElement(this.element, selectedElement);
- },
-
- updateChoices: function(choices) {
- if(!this.changed && this.hasFocus) {
- this.update.innerHTML = choices;
- Element.cleanWhitespace(this.update);
- Element.cleanWhitespace(this.update.down());
-
- if(this.update.firstChild && this.update.down().childNodes) {
- this.entryCount =
- this.update.down().childNodes.length;
- for (var i = 0; i < this.entryCount; i++) {
- var entry = this.getEntry(i);
- entry.autocompleteIndex = i;
- this.addObservers(entry);
- }
- } else {
- this.entryCount = 0;
- }
-
- this.stopIndicator();
- this.index = 0;
-
- if(this.entryCount==1 && this.options.autoSelect) {
- this.selectEntry();
- this.hide();
- } else {
- this.render();
- }
- }
- },
-
- addObservers: function(element) {
- Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
- Event.observe(element, "click", this.onClick.bindAsEventListener(this));
- },
-
- onObserverEvent: function() {
- this.changed = false;
- this.tokenBounds = null;
- if(this.getToken().length>=this.options.minChars) {
- this.getUpdatedChoices();
- } else {
- this.active = false;
- this.hide();
- }
- this.oldElementValue = this.element.value;
- },
-
- getToken: function() {
- var bounds = this.getTokenBounds();
- return this.element.value.substring(bounds[0], bounds[1]).strip();
- },
-
- getTokenBounds: function() {
- if (null != this.tokenBounds) return this.tokenBounds;
- var value = this.element.value;
- if (value.strip().empty()) return [-1, 0];
- var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
- var offset = (diff == this.oldElementValue.length ? 1 : 0);
- var prevTokenPos = -1, nextTokenPos = value.length;
- var tp;
- for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
- tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
- if (tp > prevTokenPos) prevTokenPos = tp;
- tp = value.indexOf(this.options.tokens[index], diff + offset);
- if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
- }
- return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
- }
-});
-
-Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
- var boundary = Math.min(newS.length, oldS.length);
- for (var index = 0; index < boundary; ++index)
- if (newS[index] != oldS[index])
- return index;
- return boundary;
-};
-
-Ajax.Autocompleter = Class.create(Autocompleter.Base, {
- initialize: function(element, update, url, options) {
- this.baseInitialize(element, update, options);
- this.options.asynchronous = true;
- this.options.onComplete = this.onComplete.bind(this);
- this.options.defaultParams = this.options.parameters || null;
- this.url = url;
- },
-
- getUpdatedChoices: function() {
- this.startIndicator();
-
- var entry = encodeURIComponent(this.options.paramName) + '=' +
- encodeURIComponent(this.getToken());
-
- this.options.parameters = this.options.callback ?
- this.options.callback(this.element, entry) : entry;
-
- if(this.options.defaultParams)
- this.options.parameters += '&' + this.options.defaultParams;
-
- new Ajax.Request(this.url, this.options);
- },
-
- onComplete: function(request) {
- this.updateChoices(request.responseText);
- }
-});
-
-// The local array autocompleter. Used when you'd prefer to
-// inject an array of autocompletion options into the page, rather
-// than sending out Ajax queries, which can be quite slow sometimes.
-//
-// The constructor takes four parameters. The first two are, as usual,
-// the id of the monitored textbox, and id of the autocompletion menu.
-// The third is the array you want to autocomplete from, and the fourth
-// is the options block.
-//
-// Extra local autocompletion options:
-// - choices - How many autocompletion choices to offer
-//
-// - partialSearch - If false, the autocompleter will match entered
-// text only at the beginning of strings in the
-// autocomplete array. Defaults to true, which will
-// match text at the beginning of any *word* in the
-// strings in the autocomplete array. If you want to
-// search anywhere in the string, additionally set
-// the option fullSearch to true (default: off).
-//
-// - fullSsearch - Search anywhere in autocomplete array strings.
-//
-// - partialChars - How many characters to enter before triggering
-// a partial match (unlike minChars, which defines
-// how many characters are required to do any match
-// at all). Defaults to 2.
-//
-// - ignoreCase - Whether to ignore case when autocompleting.
-// Defaults to true.
-//
-// It's possible to pass in a custom function as the 'selector'
-// option, if you prefer to write your own autocompletion logic.
-// In that case, the other options above will not apply unless
-// you support them.
-
-Autocompleter.Local = Class.create(Autocompleter.Base, {
- initialize: function(element, update, array, options) {
- this.baseInitialize(element, update, options);
- this.options.array = array;
- },
-
- getUpdatedChoices: function() {
- this.updateChoices(this.options.selector(this));
- },
-
- setOptions: function(options) {
- this.options = Object.extend({
- choices: 10,
- partialSearch: true,
- partialChars: 2,
- ignoreCase: true,
- fullSearch: false,
- selector: function(instance) {
- var ret = []; // Beginning matches
- var partial = []; // Inside matches
- var entry = instance.getToken();
- var count = 0;
-
- for (var i = 0; i < instance.options.array.length &&
- ret.length < instance.options.choices ; i++) {
-
- var elem = instance.options.array[i];
- var foundPos = instance.options.ignoreCase ?
- elem.toLowerCase().indexOf(entry.toLowerCase()) :
- elem.indexOf(entry);
-
- while (foundPos != -1) {
- if (foundPos == 0 && elem.length != entry.length) {
- ret.push("