- RailsSpace Book: Chapter 7 (Advanced Login)
- Then updated app/views/user/login.rhtml as specified in Listing 7.1 (p.182).
- Listing 7.2 (repeat)
- NOT GOING TO REPEAT step 2 style statements going forward.
- Ran all the test: $ 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.339 seconds.
12 tests, 53 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:/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.574 seconds.
14 tests, 82 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:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/integration/remember_me_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
1
42
1
.
Finished in 0.344 seconds.
1 tests, 2 assertions, 0 failures, 0 errors - $ rake stats
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 113 | 89 | 3 | 12 | 4 | 5 |
| Helpers | 17 | 13 | 0 | 2 | 0 | 4 |
| Models | 76 | 55 | 1 | 7 | 7 | 5 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Integration tests | 28 | 20 | 1 | 2 | 2 | 8 |
| Functional tests 526 | 396 | 4 | 38 | 9 | 8 |
| Unit tests | 163 | 113 | 1 | 13 | 13 | 6 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 923 | 686 | 10 | 74 | 7 | 7 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 157 Test LOC: 529 Code to Test Ratio: 1:3.4 - End of Chapter 7.
- Starting Chapter 8 (Updating user information)
- At the end of chapter 8, Ran all the tests: $ rake 2>&1 |tee o_r252b
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"
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
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.345 seconds.
10 tests, 53 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:/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.517 seconds.
18 tests, 93 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:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" "test/integration/remember_me_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
1
42
1
.
Finished in 0.316 seconds.
1 tests, 2 assertions, 0 failures, 0 errors - End of Chapter 8.
- Starting Chapter 9.
- Commented out config.action_controller.allow_forgery_protection line in config/environment/test.rb and "RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION" in configuration/environment.rb file.
- Test suites are broken/must repair and put into git.
Wednesday, May 6, 2009
My RailsSpace Journey - Day 5
Tuesday, May 5, 2009
My RailsSpace Journey - Day 4 (Continued)
- RailsSpace Book: Starting Chapter 6.
- 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 - Uncommented one line in config/environment.rb file (p.133)
- 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) ========================== - Then updated app/controllers/user_controller.rb as specified in Listing 6.1. (p.134)
- 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
- Then updated app/views/layouts/application.rhtml as specified on Listing 6.3 . (p.135)
- Then updated app/views/layouts/application.rhtml as specified on Listing 6.4 . (p.137)
- Then updated public/stylesheets/site.cs as specified on Listing 6.5. (p.138)
- Then updated app/views/layouts/application.rhtml as specified on Listing 6.6 . (p.139-140)
- Then created app/views/user/login.rthml as specified on Listing 6.7 . (p.140)
- Then updated app/controllers/user_controller.rb as specified in Listing 6.8. (p.141)
- 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.
- 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
- 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
- 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
- Then updated app/controllers/user_controller.rb as specified in Listing 6.12. (p.145) Then ran the tests and they worked.
- Then updated app/controllers/user_controller.rb as specified in Listing 6.13. (p.146) Then ran the tests and they worked.
- Then updated app/views/layouts/application.rhtml as specified in Listing 6.14. (p.146-147) Then ran the tests and they worked.
- 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
- 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
- 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
- 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
- Then updated app/controllers/user_controller.rb as specified in Listing 6.19. (p.150).
- Then updated app/controllers/user_controller.rb as specified in Listing 6.20. (p.151).
- Then updated app/controllers/user_controller.rb as specified in Listing 6.21. (p.152).
- 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
- 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
- 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
- Then updated app/views/layouts/application.rhtml as specified in Listing 6.25. (p.156)
- Then updated app/controllers/user_controller.rb as specified in Listing 6.26. (p.159).
- Then updated app/controllers/user_controller.rb as specified in Listing 6.27. (p.160).
- Then updated app/controllers/user_controller.rb as specified in Listing 6.28. (p.162).
- 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
- 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
- START REFACTORING. (p.163)
- Then updated app/helpers/application_helper.rb as specified on Listing 6.31. (p.165)
- 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)
- Skipped 6.33. No Change.
- 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)
- Then updated app/views/layouts/application.rhtml as specified on Listing 6.35 . (p.167)
- Then updated app/views/layouts/application.rhtml as specified on Listing 6.36 . (p.167)
- 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">. - 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)
- 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)
- Then updated app/controllers/user_controller.rb as specified in Listing 6.39. (p.169).
- 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)
- 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)
- 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)
- 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
- 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
- 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
- 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
- Then updated app/controllers/user_controller.rb as specified in Listing 6.47, 6.47.5. (p.174).
- 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
- 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
- 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
- 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
- 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
- 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" - Unclear why I have [13, 68, 0, 0] instead of [17, 78, 0, 0] on page 179.
- End of Chapter 6.
Monday, May 4, 2009
My RailsSpace Journey - Day 3 and 4
- Abbreviation used throughout: asop ("as specified on page")
- RailsSpace: Start of Chapter 5 (Getting started with Testing) (p.97)
- Run 'db:test:prepare" using Netbeans. asop 99.
- Watched Chapter 5 screencast.
- Downloaded Listing 5.2 and ran "ruby test/functional/site_controller_test.rb". (p.100) First had to install older version of gem (2.1.0).
- Note the top project directory is $HOME/RAILSPASSION/rails_space.
- Successfully repeated step 3 "rake db:test:prepare" after deleting existing database and starting the database inside netbeans.
- Day 5 starts.
- Repeated step 3 "rake db:test:preapre" outside netbeans (worked after starting database). (p.99)
- Tried step 5 again and got same error message: "ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column 'name' in 'field list': INSERT INTO `users` (`name`, `updated_at`, `id`, `created_at` VALUES" (FIXED LATER)
- Continued on by replacing Listing 5.2 with 5.3 for test/functional/site_controller_test.rb. (p.101)
- Then by replacing Listing 5.3 with 5.4 for test/functional/site_controller_test.rb. (p.103)
- Tried step 10 again and got same error message. (FIXED LATER)
- Then replaced default user_controller_test.rb with Listing 5.5 and ran the test ("ruby user_controller_test.rb") and it worked. (p.g104-105)
- Then replaced default user_controller_test.rb with Listing 5.6 and ran the test ("ruby user_controller_test.rb") and it worked. (p.g106)
- Then replaced default user_controller_test.rb with Listing 5.7 and ran the test ("ruby user_controller_test.rb") and it worked. (p.107)
- Then replaced default user_controller_test.rb with Listing 5.8 and ran the test ("ruby user_controller_test.rb") and it worked. (p.109-110)
- Then replaced default test/unit/user_test.rb with Listing 5.9 and ran the test ("ruby user_test.rb") and it worked. (p.111)
- Then replace Listing 5.10 with Listing 5.11 and ran the test and it worked.
- So I tried "rake test:units" and got this: (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.233 seconds.
1 tests, 1 assertions, 0 failures, 0 errors - So I felt brave and ran and got this: $ rake test:functionals
(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/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.321 seconds.
6 tests, 30 assertions, 0 failures, 0 errors - Then replaced default test/unit/user_test.rb with Listing 5.12 and ran the test ("ruby user_test.rb") and it worked. (p.113)
- Then replaced default test/unit/user_test.rb with Listing 5.13 and ran the test ("ruby user_test.rb") and it worked. (p.114)
- Then replaced default test/unit/user_test.rb with Listing 5.15 and ran the test ("ruby user_test.rb") and it worked. (p.116)
- Then replaced default test/unit/user_test.rb with Listing 5.17 and ran the test ("ruby user_test.rb") and it worked. (p.117) Got this: Loaded suite test/unit/user_test
Started
.....
Finished in 0.269 seconds.
5 tests, 14 assertions, 0 failures, 0 errors - Then replaced default test/unit/user_test.rb with Listing 5.19 and ran the test ("ruby user_test.rb") and it worked. (p.120) Got this: 7 tests, 20 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.21 and ran the test ("ruby user_test.rb") and it worked. (p.121-122) Got this: 8 tests, 22 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.23 and ran the test ("ruby user_test.rb") and it worked. (p.122) Got this: 9 tests, 29 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.24 and ran the test ("ruby user_test.rb") and it worked. (p.123-124) Got this: 10 tests, 47 assertions, 0 failures, 0 errors
- Then replaced default test/unit/user_test.rb with Listing 5.26 (Listing 5.27 is the same) and ran the test ("ruby user_test.rb") and it worked. (p.124-125) Got this: 12 tests, 53 assertions, 0 failures, 0 errors
- Ran this: $ rake test:units (pg. 128)
(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.334 seconds.
12 tests, 53 assertions, 0 failures, 0 errors - Then ran this: $ rake (p.128-129)
(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.341 seconds.
12 tests, 53 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:/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.388 seconds.
6 tests, 30 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:/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/gems/rake-0.8.4/lib/rake/rake_test_loader.rb" - Then ran this: $ rake stats (p.129)
(in C:/cygwin/home/jasnow/RAILSPASSION/rails_space)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 47 | 30 | 3 | 5 | 1 | 4 |
| Helpers | 12 | 10 | 0 | 1 | 0 | 8 |
| Models | 32 | 23 | 1 | 0 | 0 | 0 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Integration tests | 0 | 0 | 0 | 0 | 0 | 0 |
| Functional tests | 129 | 104 | 4 | 10 | 2 | 8 |
| Unit tests | 163 | 113 | 1 | 13 | 13 | 6 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 383 | 280 | 9 | 29 | 3 | 7 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 63 Test LOC: 217 Code to Test Ratio: 1:3.4 - Done with Chapter 5.
Sunday, May 3, 2009
My RailsSpace Journey - Day 2
- May 2nd: Read the first 33 pages of RailsSpace.
- Book URL on page 5.
- NOTE THAT ALL PAGE NUMBERS ARE FROM RailsSpace Book unless otherwise.
- Ran "rails.bat ralis_space" on my Vista/PC and it created the project under my RAILSPASSION directory. (pg.16)
- Ran "cd rails_space ; ruby script/server" and got this. (pg.18) : => Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server - I checked "localhost:3000" and got default screen as seen on page 19.
- Then I did this: $ ruby script/generate controller site index about help and got this: (p.21)
exists app/controllers/
exists app/helpers/
create app/views/site
exists test/functional/
create test/unit/helpers/
create app/controllers/site_controller.rb
create test/functional/site_controller_test.rb
create app/helpers/site_helper.rb
create test/unit/helpers/site_helper_test.rb
create app/views/site/index.html.erb
create app/views/site/about.html.erb
create app/views/site/help.html.erb - Then I did this: "gem rdoc --all" - Got a few, then errored out. (p.24)
- Edited routes.rb as specificed on page 26. Deleted Public/index.html and edited views/site/index.rhtml as specificed on page 26. Then refreshed web page and got the screen as shown on top of page 27.
- Then i edited aobut.rhtml and help.rhtml as specified on page 28. Then created site.rhtml as specified on page 29.
- Then I edited/shortened index.rhtml on bottom of page 29. Refresh web page and saw that it worked. Also shorten about.rhtml and help.rhtml web pages on specified on page 30.
- Set up Netbeans for RailsSpace and moved 1st 11 steps of data under Netbeans directiory. After a few bumps, it worked as seen (the web page) on bottom of page 33.
- Then I modified (removed extra curly braces/paras) site.rhtml as specificed on page 36 and refreshed web page. It worked.
- Then changed all "link_to" to "link_to_unless_current" as specified on page 37.
- Downloaded the RailsSpace files zip file from publisher and used "site.css" as specified on page 40. Restarted webserver and check all 3 web pages. They worked as seen on page 41.
- End of Chapter 2
- HAD TO REBUILD THE PROJECT/REPEAT CHAPTER 2 INSIDE NETBEANS to get NETBEANS to BUILD DATA
- Used netbeans to create:db (pg.43-45).
- Used netbeans to generate model for User (p.47).
- Then add 3 columns (screen_name, email, password) to migration file (p.48).
- Used netbeans to run db:migrate. (p.49)
- Enter one user using netbean's console. (p.52-53)
- Then added 5 validations to user model. (p.54)
- Then added constants to user model as specified on page 55-56.
- Then added validate method as specified on page 57.
- Then added "if" statemend as specified on top of page 58.
- Then added "full-strength" validations as specified on page 59.
- I skipped page 62 where it wanted me to add create_at and update_at since netbeans or rails already added them. (p.62)
- Finished Chapter 3.
- Chapter 4: Generated another controller, "user", with index and register views. (p.66)
- Then edited user_controller.rb as specified at bottom of page 67.
- Then copied site.rhtml into brand new application.rhtml view. (p.68)
- Then undid step 30. (smile) (p.g68).
- Then edited register.rhtml to add CSS. (p.68-69)
- Then edited site.css file as specified on page 69.
- WEB PAGE DISPLAY IS BROKEN (p.66,68,71,76) (get: Routing Error ;
No route matches "/user" with {:method=>:get}) UNCLEAR IF I SHOULD BE ABLE TO DISPLAY WEB PAGE.\
Fix step 36 by restarting the server.Then edited user.rb model as specified on bottom of page 73.- Then edited register.rb as specified on page 74.
- Then added debug lines to application.rhtml and site.css as on page 75-76.
- Then add processing code to user_controller as on page 78.
- Then edited register.rb as specified on page 84.
- Then edited site.css file as specified on page 85.
- Then edited applicaton.rhtml as specified on page 86.
- Then edited site.css file as specified on page 87.
- Then edited application.rhtml as specified on bottom of page 87.
- Then edited user_controller.rb as specified on page 88.
- Then edited index.rhtml view and user_controller.rb controller as specified on page 89.
- Then edited application.rhtml layout as specified on page 90-91.
- Then edited application.rhtml layout as specified on page 91.
- Then edited the application_helper.rb file as specified on page 92 and page 93.
- Then edited the application.rhtml layout file as specified on page 93.
- Finally for chapter 4, I dropped the tables and recreated the tables as specified on page 95 and then entered one user as specified on page 95. AND IT WORKED.
- End of Chapter 4. Testing next.
Subscribe to:
Posts (Atom)