mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 13:38:24 -04:00
s/system_name/name
This commit is contained in:
@@ -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})"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user