Files
growstuff/spec/views/posts/index.rss.markdown_spec.rb
T
Brenda Wallace 793759c7af Remove unused bluecloth gem (#4968)
* Remove unused bluecloth gem

Last released in 2011. It was only required, never called; kramdown
renders the markdown.

* Add specs for Tilt markdown rendering and posts markdown partial
2026-10-19 19:36:32 +10:30

35 lines
810 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe 'posts/index.rss.haml', type: "view" do
subject(:rendered_feed) do
assign(:posts, [post])
render
rendered
end
let(:post) { create(:post, body:) }
before { controller.stub(:current_user) { nil } }
context "with bold text" do
let(:body) { "This is **strong** text" }
it { is_expected.to include "<strong>strong</strong>" }
end
context "with a crop link" do
let(:crop) { create(:tomato) }
let(:body) { "Growing [#{crop.name}](crop)" }
it { is_expected.to include "<a href="#{crop_path(crop)}">#{crop.name}</a>" }
end
context "with raw html" do
let(:body) { '<script>alert(1)</script>hello' }
it { is_expected.not_to include "&lt;script" }
end
end