# 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) { 'hello' } it { is_expected.not_to include "<script" } end end