Permalink
Browse files

automatic import from ryanb/railscasts-episodes

  • Loading branch information...
0 parents commit 8e78b721c7cf9b36350c30e6743692e0884c9fa4 @gilesbowkett gilesbowkett committed Jul 29, 2011
Showing with 2,040 additions and 0 deletions.
  1. +16 −0 README
  2. +5 −0 auth-after/.gitignore
  3. +1 −0 auth-after/.rspec
  4. +31 −0 auth-after/Gemfile
  5. +157 −0 auth-after/Gemfile.lock
  6. +20 −0 auth-after/Guardfile
  7. +7 −0 auth-after/README
  8. +7 −0 auth-after/Rakefile
  9. BIN auth-after/app/assets/images/rails.png
  10. +9 −0 auth-after/app/assets/javascripts/application.js
  11. +3 −0 auth-after/app/assets/javascripts/home.js.coffee
  12. +3 −0 auth-after/app/assets/javascripts/password_resets.js.coffee
  13. +3 −0 auth-after/app/assets/javascripts/sessions.js.coffee
  14. +3 −0 auth-after/app/assets/javascripts/users.js.coffee
  15. +91 −0 auth-after/app/assets/stylesheets/application.css
  16. +7 −0 auth-after/app/assets/stylesheets/home.css.scss
  17. +7 −0 auth-after/app/assets/stylesheets/password_resets.css.scss
  18. +7 −0 auth-after/app/assets/stylesheets/sessions.css.scss
  19. +7 −0 auth-after/app/assets/stylesheets/users.css.scss
  20. +10 −0 auth-after/app/controllers/application_controller.rb
  21. +4 −0 auth-after/app/controllers/home_controller.rb
  22. +25 −0 auth-after/app/controllers/password_resets_controller.rb
  23. +20 −0 auth-after/app/controllers/sessions_controller.rb
  24. +14 −0 auth-after/app/controllers/users_controller.rb
  25. +2 −0 auth-after/app/helpers/application_helper.rb
  26. +2 −0 auth-after/app/helpers/home_helper.rb
  27. +2 −0 auth-after/app/helpers/password_resets_helper.rb
  28. +2 −0 auth-after/app/helpers/sessions_helper.rb
  29. +2 −0 auth-after/app/helpers/users_helper.rb
  30. 0 auth-after/app/mailers/.gitkeep
  31. +8 −0 auth-after/app/mailers/user_mailer.rb
  32. 0 auth-after/app/models/.gitkeep
  33. +18 −0 auth-after/app/models/user.rb
  34. +3 −0 auth-after/app/views/home/index.html.erb
  35. +26 −0 auth-after/app/views/layouts/application.html.erb
  36. +23 −0 auth-after/app/views/password_resets/edit.html.erb
  37. +7 −0 auth-after/app/views/password_resets/new.html.erb
  38. +14 −0 auth-after/app/views/sessions/new.html.erb
  39. +5 −0 auth-after/app/views/user_mailer/password_reset.text.erb
  40. +27 −0 auth-after/app/views/users/new.html.erb
  41. +4 −0 auth-after/config.ru
  42. +42 −0 auth-after/config/application.rb
  43. +6 −0 auth-after/config/boot.rb
  44. +25 −0 auth-after/config/database.yml
  45. +5 −0 auth-after/config/environment.rb
  46. +29 −0 auth-after/config/environments/development.rb
  47. +54 −0 auth-after/config/environments/production.rb
  48. +41 −0 auth-after/config/environments/test.rb
  49. +7 −0 auth-after/config/initializers/backtrace_silencers.rb
  50. +10 −0 auth-after/config/initializers/inflections.rb
  51. +5 −0 auth-after/config/initializers/mime_types.rb
  52. +7 −0 auth-after/config/initializers/secret_token.rb
  53. +8 −0 auth-after/config/initializers/session_store.rb
  54. +12 −0 auth-after/config/initializers/wrap_parameters.rb
  55. +5 −0 auth-after/config/locales/en.yml
  56. +9 −0 auth-after/config/routes.rb
  57. +10 −0 auth-after/db/migrate/20110613044221_create_users.rb
  58. +6 −0 auth-after/db/migrate/20110718213551_add_password_reset_to_users.rb
  59. +24 −0 auth-after/db/schema.rb
  60. +7 −0 auth-after/db/seeds.rb
  61. +2 −0 auth-after/doc/README_FOR_APP
  62. 0 auth-after/lib/tasks/.gitkeep
  63. 0 auth-after/log/.gitkeep
  64. +26 −0 auth-after/public/404.html
  65. +26 −0 auth-after/public/422.html
  66. +26 −0 auth-after/public/500.html
  67. 0 auth-after/public/favicon.ico
  68. +5 −0 auth-after/public/robots.txt
  69. +6 −0 auth-after/script/rails
  70. +4 −0 auth-after/spec/factories.rb
  71. +3 −0 auth-after/spec/fixtures/user_mailer/password_reset
  72. +15 −0 auth-after/spec/mailers/user_mailer_spec.rb
  73. +24 −0 auth-after/spec/models/user_spec.rb
  74. +51 −0 auth-after/spec/requests/password_resets_spec.rb
  75. +28 −0 auth-after/spec/spec_helper.rb
  76. +9 −0 auth-after/spec/support/mailer_macros.rb
  77. 0 auth-after/vendor/assets/stylesheets/.gitkeep
  78. 0 auth-after/vendor/plugins/.gitkeep
  79. +5 −0 auth-before/.gitignore
  80. +29 −0 auth-before/Gemfile
  81. +115 −0 auth-before/Gemfile.lock
  82. +7 −0 auth-before/README
  83. +7 −0 auth-before/Rakefile
  84. BIN auth-before/app/assets/images/rails.png
  85. +9 −0 auth-before/app/assets/javascripts/application.js
  86. +3 −0 auth-before/app/assets/javascripts/home.js.coffee
  87. +3 −0 auth-before/app/assets/javascripts/sessions.js.coffee
  88. +3 −0 auth-before/app/assets/javascripts/users.js.coffee
  89. +91 −0 auth-before/app/assets/stylesheets/application.css
  90. +7 −0 auth-before/app/assets/stylesheets/home.css.scss
  91. +7 −0 auth-before/app/assets/stylesheets/sessions.css.scss
  92. +7 −0 auth-before/app/assets/stylesheets/users.css.scss
  93. +10 −0 auth-before/app/controllers/application_controller.rb
  94. +4 −0 auth-before/app/controllers/home_controller.rb
  95. +20 −0 auth-before/app/controllers/sessions_controller.rb
  96. +14 −0 auth-before/app/controllers/users_controller.rb
  97. +2 −0 auth-before/app/helpers/application_helper.rb
  98. +2 −0 auth-before/app/helpers/home_helper.rb
  99. +2 −0 auth-before/app/helpers/sessions_helper.rb
  100. +2 −0 auth-before/app/helpers/users_helper.rb
  101. 0 auth-before/app/mailers/.gitkeep
  102. 0 auth-before/app/models/.gitkeep
  103. +5 −0 auth-before/app/models/user.rb
  104. +3 −0 auth-before/app/views/home/index.html.erb
  105. +26 −0 auth-before/app/views/layouts/application.html.erb
  106. +13 −0 auth-before/app/views/sessions/new.html.erb
  107. +27 −0 auth-before/app/views/users/new.html.erb
  108. +4 −0 auth-before/config.ru
  109. +42 −0 auth-before/config/application.rb
  110. +6 −0 auth-before/config/boot.rb
  111. +25 −0 auth-before/config/database.yml
  112. +5 −0 auth-before/config/environment.rb
  113. +27 −0 auth-before/config/environments/development.rb
  114. +54 −0 auth-before/config/environments/production.rb
  115. +39 −0 auth-before/config/environments/test.rb
  116. +7 −0 auth-before/config/initializers/backtrace_silencers.rb
  117. +10 −0 auth-before/config/initializers/inflections.rb
  118. +5 −0 auth-before/config/initializers/mime_types.rb
  119. +7 −0 auth-before/config/initializers/secret_token.rb
  120. +8 −0 auth-before/config/initializers/session_store.rb
  121. +12 −0 auth-before/config/initializers/wrap_parameters.rb
  122. +5 −0 auth-before/config/locales/en.yml
  123. +8 −0 auth-before/config/routes.rb
  124. +10 −0 auth-before/db/migrate/20110613044221_create_users.rb
  125. +22 −0 auth-before/db/schema.rb
  126. +7 −0 auth-before/db/seeds.rb
  127. +2 −0 auth-before/doc/README_FOR_APP
  128. 0 auth-before/lib/tasks/.gitkeep
  129. 0 auth-before/log/.gitkeep
  130. +26 −0 auth-before/public/404.html
  131. +26 −0 auth-before/public/422.html
  132. +26 −0 auth-before/public/500.html
  133. 0 auth-before/public/favicon.ico
  134. +5 −0 auth-before/public/robots.txt
  135. +6 −0 auth-before/script/rails
  136. 0 auth-before/test/fixtures/.gitkeep
  137. +9 −0 auth-before/test/fixtures/users.yml
  138. 0 auth-before/test/functional/.gitkeep
  139. +9 −0 auth-before/test/functional/home_controller_test.rb
  140. +9 −0 auth-before/test/functional/sessions_controller_test.rb
  141. +9 −0 auth-before/test/functional/users_controller_test.rb
  142. 0 auth-before/test/integration/.gitkeep
  143. +12 −0 auth-before/test/performance/browsing_test.rb
  144. +13 −0 auth-before/test/test_helper.rb
  145. 0 auth-before/test/unit/.gitkeep
  146. +4 −0 auth-before/test/unit/helpers/home_helper_test.rb
  147. +4 −0 auth-before/test/unit/helpers/secret_helper_test.rb
  148. +4 −0 auth-before/test/unit/helpers/sessions_helper_test.rb
  149. +4 −0 auth-before/test/unit/helpers/users_helper_test.rb
  150. +7 −0 auth-before/test/unit/user_test.rb
  151. 0 auth-before/vendor/assets/stylesheets/.gitkeep
  152. 0 auth-before/vendor/plugins/.gitkeep
@@ -0,0 +1,16 @@
+RailsCasts Episode #275: How I Test
+
+http://railscasts.com/episodes/275-how-i-test
+
+Commands used in episode
+
+ bundle
+ rails g rspec:install
+ mkdir spec/support spec/models spec/routing
+ guard init rspec
+ gem install rb-fsevent
+ rails g integration_test password_reset
+ rails g controller password_resets new --no-test-framework
+ rails g mailer user_mailer password_reset
+ rails g migration add_password_reset_to_users password_reset_token:string password_reset_sent_at:datetime
+ rake db:migrate
@@ -0,0 +1,5 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+.sass-cache/
@@ -0,0 +1 @@
+--colour
@@ -0,0 +1,31 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.1.0.rc4'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+# Asset template engines
+gem 'sass-rails', "~> 3.1.0.rc"
+gem 'coffee-script'
+gem 'uglifier'
+
+gem 'jquery-rails'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+gem "rspec-rails", :group => [:test, :development]
+group :test do
+ gem "factory_girl_rails"
+ gem "capybara"
+ gem "guard-rspec"
+end
@@ -0,0 +1,157 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
+ mail (~> 2.3.0)
+ actionpack (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.0)
+ rack-cache (~> 1.0.1)
+ rack-mount (~> 0.8.1)
+ rack-test (~> 0.6.0)
+ sprockets (~> 2.0.0.beta.10)
+ tzinfo (~> 0.3.27)
+ activemodel (3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ bcrypt-ruby (~> 2.1.4)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ arel (~> 2.1.1)
+ tzinfo (~> 0.3.27)
+ activeresource (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ activesupport (3.1.0.rc4)
+ multi_json (~> 1.0)
+ arel (2.1.1)
+ bcrypt-ruby (2.1.4)
+ builder (3.0.0)
+ capybara (1.0.0)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 0.2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.1.9)
+ ffi (~> 1.0.6)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.1.1)
+ diff-lcs (1.1.2)
+ erubis (2.7.0)
+ execjs (1.1.2)
+ multi_json (~> 1.0)
+ factory_girl (1.3.3)
+ factory_girl_rails (1.0.1)
+ factory_girl (~> 1.3)
+ railties (>= 3.0.0)
+ ffi (1.0.9)
+ guard (0.5.1)
+ thor (~> 0.14.6)
+ guard-rspec (0.4.0)
+ guard (>= 0.4.0)
+ hike (1.0.0)
+ i18n (0.6.0)
+ jquery-rails (1.0.9)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ json_pure (1.5.3)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ nokogiri (1.5.0)
+ polyglot (0.3.1)
+ rack (1.3.0)
+ rack-cache (1.0.2)
+ rack (>= 0.4)
+ rack-mount (0.8.1)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.0)
+ rack (>= 1.0)
+ rails (3.1.0.rc4)
+ actionmailer (= 3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
+ activerecord (= 3.1.0.rc4)
+ activeresource (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ bundler (~> 1.0)
+ railties (= 3.1.0.rc4)
+ railties (3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2)
+ rdoc (3.6.1)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ rspec-rails (2.6.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.6.0)
+ rubyzip (0.9.4)
+ sass (3.1.2)
+ sass-rails (3.1.0.rc.2)
+ actionpack (~> 3.1.0.rc1)
+ railties (~> 3.1.0.rc1)
+ sass (>= 3.1.2)
+ sprockets (>= 2.0.0.beta.9)
+ selenium-webdriver (0.2.2)
+ childprocess (>= 0.1.9)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
+ sprockets (2.0.0.beta.10)
+ hike (~> 1.0)
+ rack (~> 1.0)
+ tilt (!= 1.3.0, ~> 1.1)
+ sqlite3 (1.3.3)
+ thor (0.14.6)
+ tilt (1.3.2)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.27)
+ uglifier (0.5.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ coffee-script
+ factory_girl_rails
+ guard-rspec
+ jquery-rails
+ rails (= 3.1.0.rc4)
+ rspec-rails
+ sass-rails (~> 3.1.0.rc)
+ sqlite3
+ uglifier
@@ -0,0 +1,20 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
@@ -0,0 +1,7 @@
+= RailsCasts Example Application
+
+Run these commands to try it out.
+
+ bundle
+ rake db:migrate
+ rails s
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# 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.expand_path('../config/application', __FILE__)
+
+Auth::Application.load_tasks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,9 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,91 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
+
+html, body {
+ background-color: #4B7399;
+ font-family: Verdana, Helvetica, Arial;
+ font-size: 14px;
+}
+
+a img {
+ border: none;
+}
+
+a {
+ color: #0000FF;
+}
+
+.clear {
+ clear: both;
+ height: 0;
+ overflow: hidden;
+}
+
+#container {
+ width: 75%;
+ margin: 0 auto;
+ background-color: #FFF;
+ padding: 20px 40px;
+ border: solid 1px black;
+ margin-top: 20px;
+}
+
+#flash_notice, #flash_error, #flash_alert {
+ padding: 5px 8px;
+ margin: 10px 0;
+}
+
+#flash_notice {
+ background-color: #CFC;
+ border: solid 1px #6C6;
+}
+
+#flash_error, #flash_alert {
+ background-color: #FCC;
+ border: solid 1px #C66;
+}
+
+form label {
+ display: block;
+ margin-bottom: 2px;
+}
+
+form .field, form .actions {
+ margin: 12px 0;
+}
+
+.fieldWithErrors {
+ display: inline;
+}
+
+.error_messages {
+ width: 400px;
+ border: 2px solid #CF0000;
+ padding: 0px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ font-size: 12px;
+}
+
+.error_messages h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 10px;
+ font-size: 12px;
+ margin: 0;
+ background-color: #c00;
+ color: #fff;
+}
+
+.error_messages p {
+ margin: 8px 10px;
+}
+
+.error_messages ul {
+ margin: 15px 0;
+}
@@ -0,0 +1,7 @@
+// Place all the styles related to the home controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+
+body.home {
+ // Place scoped styles here
+}
@@ -0,0 +1,7 @@
+// Place all the styles related to the password_resets controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+
+body.password-resets {
+ // Place scoped styles here
+}
@@ -0,0 +1,7 @@
+// Place all the styles related to the sessions controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+
+body.sessions {
+ // Place scoped styles here
+}
Oops, something went wrong.

0 comments on commit 8e78b72

Please sign in to comment.