docbrown/spec/features/user_visits_podcast_show_spec.rb
rhymes e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00

35 lines
1.3 KiB
Ruby

require "rails_helper"
describe "User visits podcast show page" do
let(:podcast) { create(:podcast) }
let(:podcast_episode) { create(:podcast_episode, podcast_id: podcast.id) }
let(:user) { create(:user) }
let(:comment) do
create(:comment, user_id: user.id,
commentable_id: podcast_episode.id,
commentable_type: "Article")
end
let(:comment2) do
create(:comment,
user_id: user.id,
commentable_id: article.id,
parent_id: podcast_episode.id,
commentable_type: "Article")
end
it "they see the content of the hero" do
visit podcast_episode.path.to_s
expect(page).to have_text(podcast_episode.title)
expect(page).to have_css ".record"
end
it "see the new comment box on the page" do
visit podcast_episode.path.to_s
expect(page).to have_css "form#new_comment"
expect(find("#comment_commentable_type", visible: false).value).to eq("PodcastEpisode")
expect(find("#comment_commentable_id", visible: false).value).to eq(podcast_episode.id.to_s)
end
# scenario 'see comments on the page' do
# visit "#{podcast_episode.path}"
# expect(page).to have_css '#comment-node-'+comment.id
# end
end