test_spec_on_rails goes Git

The test_spec_on_rails plugin, which provides some nice helpers for testing Rails applications when using test/spec, has moved from Subversion to Git. Check out the profile page or clone the repository itself from this path: git://github.com/pelargir/test_spec_on_rails.git

Validation assertion added to test_spec_on_rails

I’ve added a new assertion to test_spec_on_rails that enables verification that validates_presence_of is being called correctly on your ActiveRecord models. For example, say you have a model like this: class User < ActiveRecord::Base validates_presence_of :first_name, :last_name end You would typically test this validation by leaving a field blank, calling valid? … Continue reading

raleigh.rb has a podcast

Did you realize that Raleigh’s own Ruby Brigade now has a podcast? Yes ladies and gents, it’s true. I’ve been recording the last few meetups on my MacBook. The audio quality isn’t half bad. I hope to expand the podcast in the future with non-meetup content. For now, it can … Continue reading

Using named routes in Streamlined addition files

For you Streamlined users out there, here’s an easy way to include named routes in your Streamlined addition modules. Previously, you had to hard code the URLs like so: module OrderAdditions def name_link link_to user.name, “/users/show/#{user.id}” end end Order.class_eval do include OrderAdditions include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper end Streamlined.ui_for(Order) do list_columns … Continue reading

Add layout checking to test_spec_on_rails

test_spec_on_rails is a plugin that adds Rails-specific assertions to test_spec, allowing you to do nifty things like this: it “should render with foo template” do get :some_action template.should.be “foo” # equivalent to assert_equal “foo”, @response.template end it “should display foo on page” do get :some_action page.should.select “p”, “foo” # equivalent … Continue reading