From addb9a48cf266e9db1faa6d5fce41c7a982cc47c Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 11 Jul 2019 23:32:29 +1200 Subject: [PATCH] Fix growstuff markdown specs to expect path only links --- spec/lib/haml/filters/growstuff_markdown_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index 597137f6d..cc27bd560 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -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 "#{name}" if name "#{crop.name}" @@ -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