Tuesday, May 5, 2009

My RailsSpace Journey - Day 4 (Continued)

  1. RailsSpace Book: Starting Chapter 6.
  2. Ran this: rake db:sessions:create and got this: (p.133)
    (in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
    exists db/migrate
    create db/migrate/20090505190833_create_sessions.rb
  3. Uncommented one line in config/environment.rb file (p.133)
  4. Ran this: $ rake db:migrate and got this: (p.133)
    (in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
    == 20090505190833 CreateSessions: migrating ===================================
    -- create_table(:sessions)
    -> 0.1760s
    -- add_index(:sessions, :session_id)
    -> 0.1570s
    -- add_index(:sessions, :updated_at)
    -> 0.1740s
    == 20090505190833 CreateSessions: migrated (0.5090s) ==========================
  5. Then updated app/controllers/user_controller.rb as specified in Listing 6.1. (p.134)
  6. Then updated test/functional/user_controller_test.rb as specified in Listing 6.2. (p.135) Got this: 3 tests, 23 assertions, 0 failures, 0 errors
  7. Then updated app/views/layouts/application.rhtml as specified on Listing 6.3 . (p.135)
  8. Then updated app/views/layouts/application.rhtml as specified on Listing 6.4 . (p.137)
  9. Then updated public/stylesheets/site.cs as specified on Listing 6.5. (p.138)
  10. Then updated app/views/layouts/application.rhtml as specified on Listing 6.6 . (p.139-140)
  11. Then created app/views/user/login.rthml as specified on Listing 6.7 . (p.140)
  12. Then updated app/controllers/user_controller.rb as specified in Listing 6.8. (p.141)
  13. Tried to run it but got "ActionController::InvalidAuthenticityToken in User#register" so I checked the Errata for Chapter 6 and fixed app/controllers/application.rb. (#3). Used foobar/bazquux and logined in successfully.
  14. Then updated test/functional/user_controller_test.rb as specified on Listing 6.9. (p.143) Got this: 3 tests, 23 assertions, 0 failures, 0 errors
  15. Then updated test/functional/user_controller_test.rb as specified on Listing 6.10. (p.143-144) Got this: 4 tests, 30 assertions, 0 failures, 0 errors
  16. Then updated test/functional/user_controller_test.rb as specified on Listing 6.11. (p.144) Got this: 5 tests, 39 assertions, 0 failures, 0 errors
  17. Then updated app/controllers/user_controller.rb as specified in Listing 6.12. (p.145) Then ran the tests and they worked.
  18. Then updated app/controllers/user_controller.rb as specified in Listing 6.13. (p.146) Then ran the tests and they worked.
  19. Then updated app/views/layouts/application.rhtml as specified in Listing 6.14. (p.146-147) Then ran the tests and they worked.
  20. Then updated test/functional/user_controller_test.rb as specified on Listing 6.15. (p.148) Got this: 1 tests, 5 assertions, 0 failures, 0 errors
  21. Then updated test/functional/site_controller_test.rb as specified on Listing 6.16. (p.148) Got this: 4 tests, 12 assertions, 0 failures, 0 errors
  22. Then updated test/functional/user_controller_test.rb as specified on Listing 6.17. (p.149) Got this: 8 tests, 47 assertions, 0 failures, 0 errors
  23. Then updated test/functional/user_controller_test.rb as specified on Listing 6.18. (p.150) Got this: 9 tests, 50 assertions, 0 failures, 0 errors
  24. Then updated app/controllers/user_controller.rb as specified in Listing 6.19. (p.150).
  25. Then updated app/controllers/user_controller.rb as specified in Listing 6.20. (p.151).
  26. Then updated app/controllers/user_controller.rb as specified in Listing 6.21. (p.152).
  27. Then updated test/functional/user_controller_test.rb as specified on Listing 6.22. (p.154) Got this: 9 tests, 50 assertions, 0 failures, 0 errors
  28. Then updated test/functional/user_controller_test.rb as specified on Listing 6.23. (p.154) Got this: 10 tests, 53 assertions, 0 failures, 0 errors
  29. Then updated test/functional/user_controller_test.rb as specified on Listing 6.24. (p.154) Got this: 11 tests, 55 assertions, 0 failures, 0 errors
  30. Then updated app/views/layouts/application.rhtml as specified in Listing 6.25. (p.156)
  31. Then updated app/controllers/user_controller.rb as specified in Listing 6.26. (p.159).
  32. Then updated app/controllers/user_controller.rb as specified in Listing 6.27. (p.160).
  33. Then updated app/controllers/user_controller.rb as specified in Listing 6.28. (p.162).
  34. Then updated test/functional/user_controller_test.rb as specified on Listing 6.29. (p.162) Got this: 12 tests, 61 assertions, 0 failures, 0 errors
  35. Then updated test/functional/user_controller_test.rb as specified on Listing 6.30. (p.163) Got this: 12 tests, 61 assertions, 0 failures, 0 errors
  36. START REFACTORING. (p.163)
  37. Then updated app/helpers/application_helper.rb as specified on Listing 6.31. (p.165)
  38. Then updated test/functional/user_controller_test.rb as specified on Listing 6.32. (p.165) Got this: 12 tests, 61 assertions, 0 failures, 0 errors (NO CHANGE/GOOD)
  39. Skipped 6.33. No Change.
  40. Then updated app/controllers/user_controller.rb as specified in Listing 6.34. (p.166). Got this: 12 tests, 61 assertions, 0 failures, 0 errors (NO CHANGE/GOOD)
  41. Then updated app/views/layouts/application.rhtml as specified on Listing 6.35 . (p.167)
  42. Then updated app/views/layouts/application.rhtml as specified on Listing 6.36 . (p.167)
  43. Ran the test suites and user worked and site did not. Got this for site: $ ruby test/fu*/s*
    Loaded suite test/functional/site_controller_test
    Started
    .........F...
    Finished in 0.458 seconds.
    1) Failure:
    test_register_friendly_url_forwarding(UserControllerTest)
    [test/functional/site_controller_test.rb:224:in `test_register_friendly_url_fo
    warding'
    C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/activesupport-2.1.0/lib
    active_support/testing/setup_and_teardown.rb:33:in `__send__'
    C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/activesupport-2.1.0/lib
    active_support/testing/setup_and_teardown.rb:33:in `run']:
    expected but was
    <"/user">.
  44. Then updated test/functional/user_controller_test.rb as specified on Listing 6.37. (p.167) Got this: 13 tests, 67 assertions, 1 failures, 0 errors (1 FAILURE)
  45. Then updated app/controllers/user_controller.rb as specified in Listing 6.38. (p.168). Got this: 13 tests, 67 assertions, 1 failures, 0 errors (1 FAILURE)
  46. Then updated app/controllers/user_controller.rb as specified in Listing 6.39. (p.169).
  47. Then updated app/models/user.rb as specified in Listing 6.40. (p.170). Ran user tests and got this: 13 tests, 67 assertions, 1 failures, 0 errors (1 FAILURE)
  48. Then updated app/models/user.rb as specified in Listing 6.40. (p.170). Ran user tests and got this: 13 tests, 67 assertions, 1 failures, 0 errors (1 FAILURE)
  49. Then updated app/controllers/user_controller.rb as specified in Listing 6.42. (p.171). Ran user tests and got this: 13 tests, 68 assertions, 0 failures, 0 errors (BACK TO GOOD)
  50. Then updated app/models/user.rb as specified in Listing 6.43. (p.172). Ran user tests and got this: 13 tests, 68 assertions, 0 failures, 0 errors
  51. Then updated app/controllers/user_controller.rb as specified in Listing 6.44. (p.173). Ran user tests and got this: 13 tests, 68 assertions, 0 failures, 0 errors
  52. Then updated app/controllers/user_controller.rb as specified in Listing 6.45. (p.173). Ran user tests and got this: 13 tests, 68 assertions, 0 failures, 0 errors
  53. Then updated app/models/user.rb as specified in Listing 6.46. (p.174). Ran user tests and got this: 13 tests, 68 assertions, 0 failures, 0 errors
  54. Then updated app/controllers/user_controller.rb as specified in Listing 6.47, 6.47.5. (p.174).
  55. Then updated test/functional/user_controller_test.rb as specified on Listing 6.48. (p.175) Got this: 13 tests, 68 assertions, 0 failures, 0 errors
  56. Then updated app/controllers/user_controller.rb as specified in Listing 6.49. (p.176). Got this: 13 tests, 68 assertions, 0 failures, 0 errors
  57. Then updated app/controllers/user_controller.rb as specified in Listing 6.50. (p.176-177). Got this: 13 tests, 68 assertions, 0 failures, 0 errors
  58. Then updated app/controllers/user_controller.rb as specified in Listing 6.51. (p.177). Got this: 13 tests, 68 assertions, 0 failures, 0 errors
  59. Then updated app/controllers/user_controller.rb as specified in Listing 6.52. (p.177). Got this: 13 tests, 68 assertions, 0 failures, 0 errors
  60. Finally I did this: $ rake
    (in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
    C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/unit/user_test.rb"
    Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
    ake/rake_test_loader
    Started
    ............
    Finished in 0.342 seconds.
    12 tests, 53 assertions, 0 failures, 0 errors
    C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSIO
    N/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/functional/site_controller_test.rb" "test/functional/user_controller_test.rb"
    Loaded suite C:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/r
    ake/rake_test_loader
    Started
    .............
    Finished in 0.442 seconds.
    13 tests, 68 assertions, 0 failures, 0 errors
    C:/DeepDive/InstantRails-2.0-win/ruby/bin/ruby -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/lib" -I"C:/cygwin/home/jasnow/RAILSPASSION/rails_space/test" "C:/cygd
    rive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader
    .rb"
  61. Unclear why I have [13, 68, 0, 0] instead of [17, 78, 0, 0] on page 179.
  62. End of Chapter 6.

No comments:

Post a Comment