Red Squirrel Reflections
Dave Hoover explores the psychology of software development

Dave Hoover
dave.hoover@gmail.com

Categories
All [Atom]
Craftsmanship [Atom]
Dynamic [Atom]
Intersection [Atom]
Learning [Atom]
Links [Atom]
Polyglot [Atom]
Projects [Atom]
XP [Atom]
Old Blog

Obtivian Blogs

Andy Maleh
Colin Harris
Fred Polgardy
Jake Scruggs
Kevin Taylor
Renzo Borgatti
Ryan Platte
Todd Webb
Tyler Jennings

Archives

June 2008 (4)
April 2008 (3)
March 2008 (1)
February 2008 (1)
August 2007 (1)
July 2007 (1)
June 2007 (1)
May 2007 (4)
April 2007 (3)
March 2007 (5)
February 2007 (6)
January 2007 (6)
December 2006 (10)
November 2006 (5)
October 2006 (8)
September 2006 (8)
August 2006 (5)
July 2006 (12)
June 2006 (7)
May 2006 (5)
April 2006 (5)
March 2006 (4)
February 2006 (2)
January 2006 (5)
December 2005 (5)
November 2005 (3)
October 2005 (3)
September 2005 (6)
August 2005 (4)
July 2005 (7)
June 2005 (14)
May 2005 (6)
April 2005 (8)
March 2005 (9)
February 2005 (11)
January 2005 (16)
Old Archives

 

Tue, 22 Aug 2006

Rails Integration Testing redirect_to :back

ActionController provies some ultra-convenient functionality via redirect_to :back. To get it to work in your Controller and Integration tests, you'll need to make sure that the HTTP_REFERER is set on the request. This is fairly straightforward for Controller tests:
  @request.env["HTTP_REFERER"] = "/babies/new"
  get :create, :baby => { ... }
  assert_redirected_to "babies/new"
For Integration tests, it's a little different:
  get "babies/create", { :baby => { ... } }, { "HTTP_REFERER" => "/babies/new" }
  assert_redirected_to "babies/new"
Unfortunately, this Integration test will fail. There is a bug in ActionController::Integration::Session (patched here) which can be worked around if you change the header to 'REFERER' => "/babies/new" or :referer => "/babies/new".

[/dynamic] permanent link

Malamidis on Java and Ruby

George provided an insightful post on Java and the trend toward dynamic languages:
I'd like to see focus shifted to the core characteristics of Java that made it such an interesting prospect at first, and these, in my opinion, boil down to good software design, powered by fundamental OO principles, not bells and whistles like Continuations, which, according to the Ruby FAQ, can be used to implement complex control structures, but are typically more useful as ways of confusing people.

[/links] permanent link


powered by blosxom