Stringify gardens as their names.

This commit is contained in:
Miles Gould
2013-02-25 23:07:47 +00:00
parent d87a1ee4fd
commit b0ffd85326
2 changed files with 7 additions and 0 deletions

View File

@@ -27,7 +27,10 @@ class Garden < ActiveRecord::Base
end
return unique_plantings[0..3]
end
def to_s
name
end
end

View File

@@ -18,6 +18,10 @@ describe Garden do
@garden.owner.should be_an_instance_of Member
end
it "should stringify as its name" do
@garden.to_s.should == @garden.name
end
context "featured plantings" do
before :each do
@tomato = FactoryGirl.create(:tomato)