How do you mock out the validates :name, uniqueness: true
callback for an attribute?
I imagine it would work something like this:
describe "with duplicate name" do
before { mock(subject.name).unique? { false } }
it "should be invalid" do
subject.should have(1).error_on(:name)
end