mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-29 19:26:30 -04:00
33 lines
823 B
Ruby
33 lines
823 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe 'posts/show.rss.haml' do
|
|
before do
|
|
controller.stub(:current_user) { nil }
|
|
@author = create(:member)
|
|
@post = create(:post)
|
|
create(:comment, author: @author, commentable: @post)
|
|
create(:comment, author: @author, commentable: @post)
|
|
assign(:post, @post)
|
|
render
|
|
end
|
|
|
|
it 'shows RSS feed title' do
|
|
rendered.should have_content "Recent comments on #{@post.subject}"
|
|
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.should have_content '<a href='
|
|
end
|
|
|
|
it 'shows content of comments' do
|
|
rendered.should have_content "OMG LOL"
|
|
end
|
|
end
|