Files
growstuff/spec/views/comments/index.rss.haml_spec.rb
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30

34 lines
857 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe 'comments/index.rss.haml' do
before do
controller.stub(:current_user) { nil }
@author = create(:member)
@post = create(:post)
assign(:comments, [
create(:comment, author: @author, commentable: @post),
create(:comment, author: @author, commentable: @post)
])
render
end
it 'shows RSS feed title' do
rendered.should have_content "Recent comments on all posts"
end
it 'shows item title' do
rendered.should have_content "Comment by #{@author.login_name}"
end
it 'escapes html for link to post' do
# it's then unescaped by 'render' so we don't actually look for <
rendered.to_s.should have_content '<a href='
end
it 'shows content of comments' do
rendered.should have_content "OMG LOL"
end
end