Interesting Things
- One pair had this reinforced: you should not generate random data in your test case to be the subject of your assertions. In their case they were generating random usernames to test an “allowed characters” filter, but their tests would intermittently succeed or fail because the test was not deterministic.
- “A
privatedeclaration in a Helper doesn’t do jack crap!” Truer words were never spoken:privateandprotecteddeclarations are not enforced in Rails View Helpers due to how that code is injected into View instances. - A developer suggested that we attempt to do “RESTful CSS.” An explanation and debate is due soon.
- We are officially changing Wiki technologies from Twiki to Trac.
- Rails Gotcha: You can use Named routes to generate a URL for a link with
my_named_route_url, but watch out: that URL is fully qualified! If you want a relative “URL”, usemy_named_route_path. Example:
<code> # config/routes.rb login "/login", :controller => "user_management", :action => "login" </code>
And in a any RHTML template:
<code> login_url # generates http://example.com/login login_path # generates /login </code>
- People need to take more time to… blog! We have a laundry list of topics but no free time.
quote: “A private declaration in a Helper doesn’t do jack crap!”
One interesting side note to this… a call to a private helper method called from a test will in fact throw an error.
For example…
December 12, 2007 at 11:50 pm