mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 11:21:06 -04:00
* 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
35 lines
810 B
Ruby
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 "<script" }
|
|
end
|
|
end
|