Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 06/13/2007

Joe Moore
Wednesday, June 13, 2007

Interesting Things

  • Rails gotcha: Date.parse and Time.parse do not react the same when passed data that can’t be parsed:
<code>
$ script/console
Loading development environment.
>> Time.parse "monkey"
=> Thu Jun 14 08:43:10 PDT 2007
>> Date.parse "monkey"
ArgumentError: 3 elements of civil date are necessary
        from /usr/local/lib/ruby/1.8/date.rb:650:in `new_with_hash'
        from /usr/local/lib/ruby/1.8/date.rb:695:in `parse'
        from (irb):2
>>
</code>
  • Rails gotcha #2: in functional tests, assert_redirected_to can fail if you are not consistent in your “strings vs symbols” notation. Example:
<code>
class MonkeyWranglersController < ActionController
    def index
            redirect_to :controller "monkey_wranglers", :action => :list
    end
end
</code>

Now, the assertions:

<code>
get :index
assert_redirected_to :controller => "monkey_wranglers", :action => :list # passes
###
get :index
assert_redirected_to :controller => "monkey_wranglers", :action => "list" # fails
</code>
  • More View helpers: ActionView::Helpers::TextHelper::cycle helps you with the “every-other-row-should-be-a-different-color” pattern usually seen in tabular data.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Joe Moore

Joe Moore
New York

Recent Posts

  • How We Use tmux for Remote Pair Programming
  • Integrating Remote Developers: Intuitive, Flexible Video Conferencing
  • Pair Programming Matrix
Subscribe to Joe's Feed

Author Topics

agile (117)
pair programming (6)
remote (4)
remote pair programming (3)
tmux (1)
android (10)
mobile (10)
robolectric (4)
java (4)
c2dm (2)
testing (8)
apple (1)
ipad (1)
pivotal tracker (6)
sf.tug (2)
desert (2)
ruby on rails (13)
javascript (2)
capistrano (1)
palmpre (1)
active record (3)
activerecord (6)
mysql (1)
rubymine (1)
fun (4)
acts_as_fu (1)
rspec (2)
xp (1)
flash (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >