thoughtbot-clearance 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +99 -0
- data/TODO.textile +21 -0
- data/generators/clearance/templates/app/views/sessions/new.html.erb +17 -0
- data/generators/clearance/templates/app/views/user_mailer/change_password.html.erb +6 -0
- data/generators/clearance/templates/app/views/user_mailer/confirmation.html.erb +1 -0
- data/generators/clearance/templates/app/views/users/_form.html.erb +7 -0
- data/generators/clearance/templates/app/views/users/edit.html.erb +4 -0
- data/generators/clearance/templates/app/views/users/new.html.erb +4 -0
- data/generators/clearance/templates/test/functional/confirmations_controller_test.rb +5 -0
- data/generators/clearance/templates/test/functional/passwords_controller_test.rb +5 -0
- data/generators/clearance/templates/test/functional/sessions_controller_test.rb +5 -0
- data/lib/clearance/test/functionals/users_controller_test.rb +60 -0
- data/lib/clearance/version.rb +7 -0
- data/lib/clearance.rb +1 -0
- data/test/rails_root/Capfile +3 -0
- data/test/rails_root/Rakefile +10 -0
- data/test/rails_root/app/controllers/application.rb +5 -0
- data/test/rails_root/app/controllers/confirmations_controller.rb +3 -0
- data/test/rails_root/app/controllers/passwords_controller.rb +3 -0
- data/test/rails_root/app/controllers/sessions_controller.rb +3 -0
- data/test/rails_root/app/controllers/users_controller.rb +3 -0
- data/test/rails_root/app/helpers/application_helper.rb +5 -0
- data/test/rails_root/app/helpers/confirmations_helper.rb +2 -0
- data/test/rails_root/app/helpers/passwords_helper.rb +2 -0
- data/test/rails_root/app/models/user.rb +3 -0
- data/test/rails_root/app/models/user_mailer.rb +7 -0
- data/test/rails_root/app/views/confirmations/new.html.erb +4 -0
- data/test/rails_root/app/views/layouts/_flashes.erb +5 -0
- data/test/rails_root/app/views/layouts/application.html.erb +14 -0
- data/test/rails_root/app/views/passwords/edit.html.erb +28 -0
- data/test/rails_root/app/views/passwords/new.html.erb +13 -0
- data/test/rails_root/app/views/sessions/new.html.erb +17 -0
- data/test/rails_root/app/views/user_mailer/change_password.html.erb +6 -0
- data/test/rails_root/app/views/user_mailer/confirmation.html.erb +1 -0
- data/test/rails_root/app/views/users/_form.html.erb +7 -0
- data/test/rails_root/app/views/users/edit.html.erb +4 -0
- data/test/rails_root/app/views/users/new.html.erb +4 -0
- data/test/rails_root/config/boot.rb +109 -0
- data/test/rails_root/config/database.yml +13 -0
- data/test/rails_root/config/environment.rb +17 -0
- data/test/rails_root/config/environments/development.rb +20 -0
- data/test/rails_root/config/environments/test.rb +24 -0
- data/test/rails_root/config/initializers/clearance.rb +8 -0
- data/test/rails_root/config/initializers/inflections.rb +10 -0
- data/test/rails_root/config/initializers/mime_types.rb +5 -0
- data/test/rails_root/config/initializers/requires.rb +13 -0
- data/test/rails_root/config/initializers/time_formats.rb +4 -0
- data/test/rails_root/config/routes.rb +19 -0
- data/test/rails_root/db/migrate/001_create_users.rb +18 -0
- data/test/rails_root/doc/README_FOR_APP +2 -0
- data/test/rails_root/doc/README_FOR_TEMPLATE +15 -0
- data/test/rails_root/lib/tasks/bootstrap.rake +16 -0
- data/test/rails_root/lib/tasks/capistrano.rake +96 -0
- data/test/rails_root/lib/tasks/git_tasks.rake +129 -0
- data/test/rails_root/public/404.html +30 -0
- data/test/rails_root/public/422.html +30 -0
- data/test/rails_root/public/500.html +30 -0
- data/test/rails_root/public/dispatch.rb +10 -0
- data/test/rails_root/public/favicon.ico +0 -0
- data/test/rails_root/public/images/rails.png +0 -0
- data/test/rails_root/public/javascripts/application.js +2 -0
- data/test/rails_root/public/javascripts/builder.js +136 -0
- data/test/rails_root/public/javascripts/controls.js +963 -0
- data/test/rails_root/public/javascripts/dragdrop.js +972 -0
- data/test/rails_root/public/javascripts/effects.js +1120 -0
- data/test/rails_root/public/javascripts/prototype.js +4225 -0
- data/test/rails_root/public/javascripts/scriptaculous.js +58 -0
- data/test/rails_root/public/javascripts/slider.js +277 -0
- data/test/rails_root/public/javascripts/sound.js +60 -0
- data/test/rails_root/public/robots.txt +1 -0
- data/test/rails_root/script/about +3 -0
- data/test/rails_root/script/breakpointer +3 -0
- data/test/rails_root/script/console +3 -0
- data/test/rails_root/script/create_project.rb +52 -0
- data/test/rails_root/script/dbconsole +3 -0
- data/test/rails_root/script/destroy +3 -0
- data/test/rails_root/script/generate +3 -0
- data/test/rails_root/script/performance/benchmarker +3 -0
- data/test/rails_root/script/performance/profiler +3 -0
- data/test/rails_root/script/performance/request +3 -0
- data/test/rails_root/script/plugin +3 -0
- data/test/rails_root/script/process/inspector +3 -0
- data/test/rails_root/script/process/reaper +3 -0
- data/test/rails_root/script/process/spawner +3 -0
- data/test/rails_root/script/runner +3 -0
- data/test/rails_root/script/server +3 -0
- data/test/rails_root/test/factories.rb +9 -0
- data/test/rails_root/test/functional/confirmations_controller_test.rb +5 -0
- data/test/rails_root/test/functional/passwords_controller_test.rb +5 -0
- data/test/rails_root/test/functional/sessions_controller_test.rb +5 -0
- data/test/rails_root/test/functional/users_controller_test.rb +5 -0
- data/test/rails_root/test/test_helper.rb +27 -0
- data/test/rails_root/test/unit/user_mailer_test.rb +6 -0
- data/test/rails_root/test/unit/user_test.rb +5 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/COPYING +3 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/MIT-LICENSE +7 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/README +35 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/RELEASE +246 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/Rakefile +188 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/examples/misc.rb +44 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb +26 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/examples/stubba.rb +65 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/any_instance_method.rb +54 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/backtrace_filter.rb +17 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/cardinality.rb +95 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/central.rb +27 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/change_state_side_effect.rb +19 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/class_method.rb +86 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/configuration.rb +60 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/deprecation.rb +22 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/exception_raiser.rb +17 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/expectation.rb +445 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/expectation_error.rb +15 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/expectation_list.rb +50 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/in_state_ordering_constraint.rb +19 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/inspect.rb +39 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/instance_method.rb +16 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/is_a.rb +9 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/logger.rb +15 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/metaclass.rb +7 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/method_matcher.rb +21 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/mock.rb +196 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/mockery.rb +181 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/module_method.rb +16 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/multiple_yields.rb +20 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/names.rb +53 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/no_yields.rb +11 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/object.rb +134 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/all_of.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/any_of.rb +47 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/any_parameters.rb +40 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/anything.rb +33 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/base.rb +15 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/equals.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/has_entries.rb +45 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/has_entry.rb +56 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/has_key.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/has_value.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/includes.rb +40 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/instance_of.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/is_a.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/kind_of.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/not.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/object.rb +9 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/optionally.rb +55 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/regexp_matches.rb +43 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/responds_with.rb +43 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers/yaml_equivalent.rb +43 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameter_matchers.rb +26 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/parameters_matcher.rb +37 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/pretty_parameters.rb +28 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/return_values.rb +31 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/sequence.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/single_return_value.rb +17 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/single_yield.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/standalone.rb +166 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/state_machine.rb +91 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/stubbing_error.rb +16 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/test_case_adapter.rb +103 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/unexpected_invocation.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha/yield_parameters.rb +31 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha.rb +20 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/mocha_standalone.rb +2 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/lib/stubba.rb +4 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/acceptance_test_helper.rb +38 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/bug_18914_test.rb +43 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/bug_21465_test.rb +34 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/bug_21563_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/expected_invocation_count_test.rb +196 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/failure_messages_test.rb +64 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/mocha_example_test.rb +98 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/mocha_test_result_test.rb +84 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/mock_test.rb +100 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/mock_with_initializer_block_test.rb +51 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/mocked_methods_dispatch_test.rb +78 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/optional_parameters_test.rb +70 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/parameter_matcher_test.rb +179 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/partial_mocks_test.rb +47 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/return_value_test.rb +52 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/sequence_test.rb +186 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/standalone_test.rb +139 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/states_test.rb +70 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_any_instance_method_test.rb +195 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_class_method_test.rb +203 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_everything_test.rb +56 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_instance_method_test.rb +165 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_module_method_test.rb +163 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stub_test.rb +52 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubba_example_test.rb +102 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubba_test.rb +15 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubba_test_result_test.rb +66 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_error_backtrace_test.rb +64 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_method_unnecessarily_test.rb +65 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +130 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_existent_class_method_test.rb +155 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_existent_instance_method_test.rb +145 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_public_any_instance_method_test.rb +130 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_public_class_method_test.rb +161 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_non_public_instance_method_test.rb +141 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/acceptance/stubbing_on_non_mock_object_test.rb +64 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/active_record_test_case.rb +36 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/deprecation_disabler.rb +15 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/execution_point.rb +36 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/method_definer.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/simple_counter.rb +13 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/test_helper.rb +11 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/test_runner.rb +33 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/any_instance_method_test.rb +126 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/array_inspect_test.rb +16 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/backtrace_filter_test.rb +19 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/cardinality_test.rb +56 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/central_test.rb +65 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/change_state_side_effect_test.rb +41 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/class_method_test.rb +237 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/date_time_inspect_test.rb +21 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/exception_raiser_test.rb +42 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/expectation_list_test.rb +57 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/expectation_test.rb +459 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/hash_inspect_test.rb +16 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/in_state_ordering_constraint_test.rb +43 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/metaclass_test.rb +22 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/method_matcher_test.rb +23 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/mock_test.rb +290 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/mockery_test.rb +149 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/multiple_yields_test.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/no_yields_test.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/object_inspect_test.rb +37 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/object_test.rb +82 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/all_of_test.rb +26 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/any_of_test.rb +26 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/anything_test.rb +21 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/equals_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/has_entries_test.rb +51 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/has_entry_test.rb +62 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/has_key_test.rb +36 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/has_value_test.rb +37 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/includes_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/instance_of_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/is_a_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/kind_of_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/not_test.rb +26 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/regexp_matches_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/responds_with_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/stub_matcher.rb +27 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameter_matchers/yaml_equivalent_test.rb +25 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/parameters_matcher_test.rb +121 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/return_values_test.rb +63 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/sequence_test.rb +104 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/single_return_value_test.rb +14 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/single_yield_test.rb +18 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/state_machine_test.rb +98 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/string_inspect_test.rb +11 -0
- data/test/rails_root/vendor/gems/mocha-0.9.1/test/unit/yield_parameters_test.rb +93 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/CONTRIBUTION_GUIDELINES.rdoc +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/MIT-LICENSE +22 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/README.rdoc +132 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/Rakefile +72 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/bin/convert_to_should_syntax +42 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/action_mailer/assertions.rb +39 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/action_mailer.rb +10 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/active_record/assertions.rb +85 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/active_record/macros.rb +715 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/active_record.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/assertions.rb +45 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/context.rb +306 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller/formats/html.rb +201 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller/formats/xml.rb +170 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller/helpers.rb +64 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller/macros.rb +316 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller/resource_options.rb +236 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/controller.rb +30 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/helpers.rb +10 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/macros.rb +74 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/private_helpers.rb +22 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/proc_extensions.rb +14 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/rails.rb +19 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/tasks/list_tests.rake +24 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/tasks/yaml_to_shoulda.rake +28 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda/tasks.rb +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/lib/shoulda.rb +17 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/rails/init.rb +1 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/README +36 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fail_macros.rb +34 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/addresses.yml +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/friendships.yml +0 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/posts.yml +5 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/products.yml +0 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/taggings.yml +0 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/tags.yml +9 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/fixtures/users.yml +6 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/posts_controller_test.rb +104 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/users_controller_test.rb +38 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/other/context_test.rb +145 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/other/convert_to_should_syntax_test.rb +63 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/other/helpers_test.rb +183 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/other/private_helpers_test.rb +34 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/other/should_test.rb +266 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/controllers/application.rb +25 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/controllers/posts_controller.rb +85 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/controllers/users_controller.rb +84 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/helpers/application_helper.rb +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/helpers/posts_helper.rb +2 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/helpers/users_helper.rb +2 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/address.rb +7 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/dog.rb +5 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/flea.rb +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/friendship.rb +4 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/post.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/product.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/tag.rb +8 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/tagging.rb +4 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/models/user.rb +28 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/layouts/posts.rhtml +17 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/layouts/users.rhtml +17 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/layouts/wide.html.erb +1 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/posts/edit.rhtml +27 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/posts/index.rhtml +25 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/posts/new.rhtml +26 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/posts/show.rhtml +18 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/users/edit.rhtml +22 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/users/index.rhtml +22 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/users/new.rhtml +21 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/app/views/users/show.rhtml +13 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/boot.rb +109 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/database.yml +4 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/environment.rb +14 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/environments/sqlite3.rb +0 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/initializers/new_rails_defaults.rb +15 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/initializers/shoulda.rb +8 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/config/routes.rb +6 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/001_create_users.rb +18 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/002_create_posts.rb +13 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/003_create_taggings.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/004_create_tags.rb +11 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/005_create_dogs.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/006_create_addresses.rb +14 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/007_create_fleas.rb +11 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/008_create_dogs_fleas.rb +12 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/009_create_products.rb +17 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/migrate/010_create_friendships.rb +14 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/db/schema.rb +0 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/log/sqlite3.log +1 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/public/404.html +30 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/public/422.html +30 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/public/500.html +30 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/script/console +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/rails_root/script/generate +3 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/test_helper.rb +33 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/address_test.rb +10 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/dog_test.rb +7 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/flea_test.rb +6 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/friendship_test.rb +6 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/post_test.rb +15 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/product_test.rb +27 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/tag_test.rb +14 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/tagging_test.rb +6 -0
- data/test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/unit/user_test.rb +52 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/MIT-LICENSE +20 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/README +34 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/init.rb +9 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/USAGE +18 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/factory_generator.rb +17 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/templates/factory.rb +5 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/templates/fixtures.yml +19 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/templates/migration.rb +16 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/templates/model.rb +2 -0
- data/test/rails_root/vendor/plugins/factory_girl_on_rails/rails_generators/factory/templates/unit_test.rb +7 -0
- metadata +486 -14
- data/clearance.gemspec +0 -50
data/Rakefile
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'date'
|
4
|
+
require 'activerecord'
|
5
|
+
require 'lib/clearance/version'
|
6
|
+
|
7
|
+
test_files_pattern = 'test/rails_root/test/{unit,functional,other}/**/*_test.rb'
|
8
|
+
Rake::TestTask.new do |t|
|
9
|
+
t.libs << 'lib'
|
10
|
+
t.pattern = test_files_pattern
|
11
|
+
t.verbose = false
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Run the test suite"
|
15
|
+
task :default => :test
|
16
|
+
|
17
|
+
spec = Gem::Specification.new do |s|
|
18
|
+
s.name = "clearance"
|
19
|
+
s.version = "#{Clearance::Version::MAJOR}.#{Clearance::Version::MINOR}.#{Clearance::Version::PATCH}"
|
20
|
+
date = DateTime.now
|
21
|
+
s.date = "#{date.year}-#{date.month}-#{date.day}"
|
22
|
+
s.summary = "Simple, complete Rails authentication."
|
23
|
+
s.email = "dcroak@thoughtbot.com"
|
24
|
+
s.homepage = "http://github.com/thoughtbot/clearance"
|
25
|
+
s.description = "Simple, complete Rails authentication scheme."
|
26
|
+
s.authors = ["thoughtbot, inc.", "Dan Croak", "Josh Nichols", "Mike Breen", "Mike Burns", "Jason Morrison"]
|
27
|
+
s.files = FileList["[A-Z]*", "{generators,lib,test}/**/*"]
|
28
|
+
end
|
29
|
+
|
30
|
+
namespace :gemspec do
|
31
|
+
desc "Generate a gemspec file for GitHub"
|
32
|
+
task :write do
|
33
|
+
File.open("#{spec.name}.gemspec", 'w') do |f|
|
34
|
+
f.write spec.to_ruby
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
namespace :bump do
|
39
|
+
desc "Bump the gemspec a major version."
|
40
|
+
task :major do
|
41
|
+
major = Clearance::Version::MAJOR + 1
|
42
|
+
File.open("lib/clearance/version.rb", 'w') do |file|
|
43
|
+
file.write <<-END
|
44
|
+
module Clearance
|
45
|
+
module Version
|
46
|
+
MAJOR = #{major}
|
47
|
+
MINOR = 0
|
48
|
+
PATCH = 0
|
49
|
+
end
|
50
|
+
end
|
51
|
+
END
|
52
|
+
end
|
53
|
+
|
54
|
+
spec.version = "#{major}.0.0"
|
55
|
+
Rake::Task["gemspec:write"].invoke
|
56
|
+
puts "Gem bumped to #{spec.version}"
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "Bump the gemspec a minor version."
|
60
|
+
task :minor do
|
61
|
+
minor = Clearance::Version::MINOR + 1
|
62
|
+
File.open("lib/clearance/version.rb", 'w') do |file|
|
63
|
+
file.write <<-END
|
64
|
+
module Clearance
|
65
|
+
module Version
|
66
|
+
MAJOR = #{Clearance::Version::MAJOR}
|
67
|
+
MINOR = #{minor}
|
68
|
+
PATCH = 0
|
69
|
+
end
|
70
|
+
end
|
71
|
+
END
|
72
|
+
end
|
73
|
+
|
74
|
+
spec.version = "#{Clearance::Version::MAJOR}.#{minor}.0"
|
75
|
+
Rake::Task["gemspec:write"].invoke
|
76
|
+
puts "Gem bumped to #{spec.version}"
|
77
|
+
end
|
78
|
+
|
79
|
+
desc "Bump the gemspec a patch version."
|
80
|
+
task :patch do
|
81
|
+
patch = Clearance::Version::PATCH + 1
|
82
|
+
File.open("lib/clearance/version.rb", 'w') do |file|
|
83
|
+
file.write <<-END
|
84
|
+
module Clearance
|
85
|
+
module Version
|
86
|
+
MAJOR = #{Clearance::Version::MAJOR}
|
87
|
+
MINOR = #{Clearance::Version::MINOR}
|
88
|
+
PATCH = #{patch}
|
89
|
+
end
|
90
|
+
end
|
91
|
+
END
|
92
|
+
end
|
93
|
+
|
94
|
+
spec.version = "#{Clearance::Version::MAJOR}.#{Clearance::Version::MINOR}.#{patch}"
|
95
|
+
Rake::Task["gemspec:write"].invoke
|
96
|
+
puts "Gem bumped to #{spec.version}"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
data/TODO.textile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
(this is in order of highest priority first)
|
2
|
+
|
3
|
+
# Gemspec rake task
|
4
|
+
# sessions controller test is missing some tests
|
5
|
+
# mailers should not hardcode example.com as from address
|
6
|
+
# check to make sure attr_accessible doesn't override and w/ attr_protected
|
7
|
+
# helpers and tests shouldn't depend on login/logout routes
|
8
|
+
# move shoulda macros in test_helper to shoulda_macros folder
|
9
|
+
# refactor Mailer default_url_options[:host] to something cleaner
|
10
|
+
|
11
|
+
ideas stolen from merb-auth:
|
12
|
+
|
13
|
+
# store current_user on the session, not controller
|
14
|
+
# respond with 401 Unauthorized when request requires authentication
|
15
|
+
# respond with 405 Method Not Allowed when action requested isn’t allowed
|
16
|
+
# email confirmation is a strategy
|
17
|
+
# forgot password is a strategy
|
18
|
+
# salted password is a strategy
|
19
|
+
# 401 and 405 need to be in Exceptions controller
|
20
|
+
|
21
|
+
http://adam.speaksoutofturn.com/articles/entication_vs_orization.html
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% form_for :session, :url => session_path do |form| %>
|
2
|
+
<div class="group">
|
3
|
+
<%= form.label :email %>
|
4
|
+
<%= form.text_field :email %>
|
5
|
+
</div>
|
6
|
+
<div class="group">
|
7
|
+
<%= form.label :password %>
|
8
|
+
<%= form.password_field :password %>
|
9
|
+
</div>
|
10
|
+
<div class="checkbox">
|
11
|
+
<%= form.check_box :remember_me %>
|
12
|
+
<%= form.label :remember_me %>
|
13
|
+
</div>
|
14
|
+
<div class="group buttons">
|
15
|
+
<%= form.submit 'Login', :disable_with => 'Please wait...' %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Someone, hopefully you, has requested that we send you a link to change your password.
|
2
|
+
|
3
|
+
Here's the link:
|
4
|
+
<%= edit_user_password_url @user, :email => @user.email, :password => @user.crypted_password %>
|
5
|
+
|
6
|
+
If you didn't request this, no need to freak out, your password hasn't been changed. You can just ignore this email.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= new_user_confirmation_url :user_id => @user, :salt => @user.salt %>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Clearance
|
2
|
+
module UsersControllerTest
|
3
|
+
|
4
|
+
def self.included(base)
|
5
|
+
base.class_eval do
|
6
|
+
public_context do
|
7
|
+
|
8
|
+
context "on GET to /users/new" do
|
9
|
+
setup { get :new }
|
10
|
+
should_respond_with :success
|
11
|
+
should_render_template :new
|
12
|
+
should_not_set_the_flash
|
13
|
+
should_have_form :action => "users_path",
|
14
|
+
:method => :post,
|
15
|
+
:fields => { :email => :text,
|
16
|
+
:password => :password,
|
17
|
+
:password_confirmation => :password }
|
18
|
+
|
19
|
+
context "with params" do
|
20
|
+
setup do
|
21
|
+
@email = 'a@example.com'
|
22
|
+
get :new, :user => {:email => @email}
|
23
|
+
end
|
24
|
+
|
25
|
+
should_assign_to :user
|
26
|
+
should "set the @user's params" do
|
27
|
+
assert_equal @email, assigns(:user).email
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "on POST to /users" do
|
33
|
+
setup do
|
34
|
+
post :create, :user => {
|
35
|
+
:email => Factory.next(:email),
|
36
|
+
:password => 'skerit',
|
37
|
+
:password_confirmation => 'skerit'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
should_set_the_flash_to /created/i
|
42
|
+
should_redirect_to "@controller.send(:url_after_create)"
|
43
|
+
should_assign_to :user
|
44
|
+
should_change 'User.count', :by => 1
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
logged_in_user_context do
|
50
|
+
|
51
|
+
should_deny_access_on "get :new"
|
52
|
+
should_deny_access_on "post :create, :user => {}"
|
53
|
+
should_filter_params :password
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
data/lib/clearance.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
6
|
+
<title><%= PROJECT_NAME.humanize %></title>
|
7
|
+
<%= stylesheet_link_tag 'screen', :media => 'all' %>
|
8
|
+
<%= javascript_include_tag :defaults %>
|
9
|
+
</head>
|
10
|
+
<body class="<%= body_class %>">
|
11
|
+
<%= render :partial => 'layouts/flashes' %>
|
12
|
+
<%= yield %>
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="page">
|
2
|
+
<div class="plain">
|
3
|
+
<div class="page-header">
|
4
|
+
<h2 class="instructions">
|
5
|
+
Your password has been reset. Choose a new password below.
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<%= error_messages_for :user %>
|
9
|
+
<% form_for(:user,
|
10
|
+
:url => user_password_path(
|
11
|
+
@user,
|
12
|
+
:email => @user.email,
|
13
|
+
:password => @user.crypted_password),
|
14
|
+
:html => { :method => :put }) do |form| %>
|
15
|
+
<div class="text">
|
16
|
+
<%= form.label :password, 'Choose password' %>
|
17
|
+
<%= form.password_field :password %>
|
18
|
+
</div>
|
19
|
+
<div class="text">
|
20
|
+
<%= form.label :password_confirmation, 'Verify password' %>
|
21
|
+
<%= form.password_field :password_confirmation %>
|
22
|
+
</div>
|
23
|
+
<div class="buttons" id="password-submit">
|
24
|
+
<%= form.submit 'Save this password' %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
28
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<p class="help">We'll email you a link to change your password.</p>
|
4
|
+
|
5
|
+
<% form_for :password, :url => passwords_path do |form| %>
|
6
|
+
<div class="text">
|
7
|
+
<%= form.label :email, 'Email address' %>
|
8
|
+
<%= form.text_field :email %>
|
9
|
+
</div>
|
10
|
+
<div class="buttons" id="password-submit">
|
11
|
+
<%= form.submit 'Reset password' %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% form_for :session, :url => session_path do |form| %>
|
2
|
+
<div class="group">
|
3
|
+
<%= form.label :email %>
|
4
|
+
<%= form.text_field :email %>
|
5
|
+
</div>
|
6
|
+
<div class="group">
|
7
|
+
<%= form.label :password %>
|
8
|
+
<%= form.password_field :password %>
|
9
|
+
</div>
|
10
|
+
<div class="checkbox">
|
11
|
+
<%= form.check_box :remember_me %>
|
12
|
+
<%= form.label :remember_me %>
|
13
|
+
</div>
|
14
|
+
<div class="group buttons">
|
15
|
+
<%= form.submit 'Login', :disable_with => 'Please wait...' %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Someone, hopefully you, has requested that we send you a link to change your password.
|
2
|
+
|
3
|
+
Here's the link:
|
4
|
+
<%= edit_user_password_url @user, :email => @user.email, :password => @user.crypted_password %>
|
5
|
+
|
6
|
+
If you didn't request this, no need to freak out, your password hasn't been changed. You can just ignore this email.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= new_user_confirmation_url :user_id => @user, :salt => @user.salt %>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class GemBoot < Boot
|
51
|
+
def load_initializer
|
52
|
+
self.class.load_rubygems
|
53
|
+
load_rails_gem
|
54
|
+
require 'initializer'
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_rails_gem
|
58
|
+
if version = self.class.gem_version
|
59
|
+
gem 'rails', version
|
60
|
+
else
|
61
|
+
gem 'rails'
|
62
|
+
end
|
63
|
+
rescue Gem::LoadError => load_error
|
64
|
+
$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.)
|
65
|
+
exit 1
|
66
|
+
end
|
67
|
+
|
68
|
+
class << self
|
69
|
+
def rubygems_version
|
70
|
+
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
71
|
+
end
|
72
|
+
|
73
|
+
def gem_version
|
74
|
+
if defined? RAILS_GEM_VERSION
|
75
|
+
RAILS_GEM_VERSION
|
76
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
77
|
+
ENV['RAILS_GEM_VERSION']
|
78
|
+
else
|
79
|
+
parse_gem_version(read_environment_rb)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def load_rubygems
|
84
|
+
require 'rubygems'
|
85
|
+
min_version = '1.1.1'
|
86
|
+
unless rubygems_version >= min_version
|
87
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
+
exit 1
|
89
|
+
end
|
90
|
+
|
91
|
+
rescue LoadError
|
92
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
|
96
|
+
def parse_gem_version(text)
|
97
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
98
|
+
end
|
99
|
+
|
100
|
+
private
|
101
|
+
def read_environment_rb
|
102
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# All that for this:
|
109
|
+
Rails.boot!
|
@@ -0,0 +1,13 @@
|
|
1
|
+
development:
|
2
|
+
adapter: sqlite3
|
3
|
+
database: ":memory:"
|
4
|
+
timeout: 5000
|
5
|
+
|
6
|
+
# Warning: The database defined as "test" will be erased and
|
7
|
+
# re-generated from your development database when you run "rake".
|
8
|
+
# Do not set this db to the same as development or production.
|
9
|
+
test:
|
10
|
+
adapter: sqlite3
|
11
|
+
database: ":memory:"
|
12
|
+
timeout: 5000
|
13
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
PROJECT_NAME = "clearance"
|
2
|
+
RAILS_GEM_VERSION = '2.1.1' unless defined? RAILS_GEM_VERSION
|
3
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
4
|
+
require 'md5' # Need this up here to generate the session[:secret] value down there
|
5
|
+
|
6
|
+
Rails::Initializer.run do |config|
|
7
|
+
config.load_paths += Dir.glob(File.join(RAILS_ROOT, 'vendor', 'gems', '*', 'lib'))
|
8
|
+
config.time_zone = 'Eastern Time (US & Canada)'
|
9
|
+
config.action_controller.session = {
|
10
|
+
:session_key => "_#{PROJECT_NAME}_session",
|
11
|
+
:secret => [PROJECT_NAME, 'random', 'words', 'here'].map {|k| Digest::MD5.hexdigest(k) }.join
|
12
|
+
}
|
13
|
+
config.gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com'
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
13
|
+
config.action_controller.perform_caching = false
|
14
|
+
config.action_view.cache_template_extensions = false
|
15
|
+
config.action_view.debug_rjs = true
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
HOST = "localhost"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Disable request forgery protection in test environment
|
17
|
+
config.action_controller.allow_forgery_protection = false
|
18
|
+
|
19
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
20
|
+
# The :test delivery method accumulates sent emails in the
|
21
|
+
# ActionMailer::Base.deliveries array.
|
22
|
+
config.action_mailer.delivery_method = :test
|
23
|
+
|
24
|
+
HOST = "localhost"
|