[deploy] fix podcast episode comment rendering and write a spec for it (#7547)
This commit is contained in:
parent
54519dbf4e
commit
8eb4612166
2 changed files with 18 additions and 1 deletions
|
|
@ -48,7 +48,7 @@
|
|||
<% end %>
|
||||
<h3 id="comments-header"><%= @commentable.title %></h3>
|
||||
<h4>
|
||||
<%= @commentable.user.name %>
|
||||
<%= @commentable.is_a?(PodcastEpisode) ? @commentable.podcast.name : @commentable.user.name %>
|
||||
<span class="published-at"><%= "on " + @commentable.published_at.strftime("%B %d, %Y") if @commentable.published_at %></span>
|
||||
</h4>
|
||||
</a>
|
||||
|
|
|
|||
17
spec/system/comments/user_views_podcast_comments_spec.rb
Normal file
17
spec/system/comments/user_views_podcast_comments_spec.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe "viewing podcast comments", type: :system, js: true do
|
||||
let(:user) { create(:user) }
|
||||
let(:podcast) { create(:podcast, creator: user) }
|
||||
let(:podcast_episode) { create(:podcast_episode, podcast: podcast) }
|
||||
let(:comment) { create(:comment, commentable: podcast_episode, user: user) }
|
||||
|
||||
before do
|
||||
sign_in user
|
||||
visit "/#{podcast.slug}/#{podcast_episode.slug}/comments"
|
||||
end
|
||||
|
||||
it "renders comment" do
|
||||
expect(page).to have_content(comment.body_html)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue