s/system_name/name

This commit is contained in:
Miles Gould
2013-11-07 11:55:19 +00:00
parent f3779cd2c9
commit 4add2f3dcf
2 changed files with 3 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ module Haml::Filters
# turn [tomato](crop) into [tomato](http://growstuff.org/crops/tomato)
return orig.gsub(/\[(.*?)\]\(crop\)/) do |m|
crop_str = $1
crop = Crop.find_by_system_name(crop_str)
crop = Crop.find_by_name(crop_str)
if crop
url = url_for(crop_path(crop))
"[#{crop_str}](#{url})"

View File

@@ -8,7 +8,7 @@ def input_link(name)
end
def output_link(crop)
return "[#{crop.system_name}](#{crop_path(crop)})"
return "[#{crop.name}](#{crop_path(crop)})"
end
describe 'Haml::Filters::Growstuff_Markdown' do
@@ -19,7 +19,7 @@ describe 'Haml::Filters::Growstuff_Markdown' do
it 'converts quick crop links' do
@crop = FactoryGirl.create(:crop)
rendered = Haml::Filters::GrowstuffMarkdown.render(input_link(@crop.system_name))
rendered = Haml::Filters::GrowstuffMarkdown.render(input_link(@crop.name))
rendered.should eq output_link(@crop)
end