mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-19 06:15:44 -04:00
Fix growstuff markdown specs to expect path only links
This commit is contained in:
committed by
always-be-closing[bot]
parent
408e8388f2
commit
addb9a48cf
@@ -7,7 +7,7 @@ def input_link(name)
|
||||
end
|
||||
|
||||
def output_link(crop, name = nil)
|
||||
url = Rails.application.routes.url_helpers.crop_url(crop, host: Rails.application.config.host)
|
||||
url = Rails.application.routes.url_helpers.crop_url(crop, only_path: true)
|
||||
return "<a href=\"#{url}\">#{name}</a>" if name
|
||||
|
||||
"<a href=\"#{url}\">#{crop.name}</a>"
|
||||
@@ -62,7 +62,7 @@ describe 'Haml::Filters::Growstuff_Markdown' do
|
||||
end
|
||||
|
||||
it "finds crops case insensitively" do
|
||||
@crop = FactoryBot.create(:crop, name: 'tomato')
|
||||
@crop = FactoryBot.create(:crop, name: 'tomato', slug: 'tomato')
|
||||
rendered = Haml::Filters::GrowstuffMarkdown.render(input_link('ToMaTo'))
|
||||
expect(rendered).to match(/#{output_link(@crop, 'ToMaTo')}/)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user