require 'spec_helper' describe User do context "dynamic slug fields" do it "should create a slug based on the non-nil field(s)" do user = User.new(:login => "deckard") user.save! user.reload.slug.should == 'deckard' end end it "should preserve capitalization" do user = User.new(:login => "Batty") user.save! user.reload.slug.should == 'Batty' end end