From 8a808e6677b6aa62bf388327cb5ff35af2d257dc Mon Sep 17 00:00:00 2001 From: Alex Abramov Date: Thu, 26 Dec 2024 20:42:08 +0700 Subject: [PATCH] new file: spec/features/podcasts/index_spec.rb --- spec/features/podcasts/index_spec.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/features/podcasts/index_spec.rb diff --git a/spec/features/podcasts/index_spec.rb b/spec/features/podcasts/index_spec.rb new file mode 100644 index 0000000..34d5c03 --- /dev/null +++ b/spec/features/podcasts/index_spec.rb @@ -0,0 +1,24 @@ +require 'rails_helper' + +RSpec.feature "Podcasts#index", type: :feature do + before do + 10.times { FactoryBot.create(:podcast) } + visit podcasts_path + end + + context do + context "podcast cards" do + scenario 'container frame' do + expect(page).to have_selector("turbo-frame#podcast_frame") + end + + scenario 'sees all podcast cards' do + expect(page).to have_css('.card', count: 10) + expect(page).to have_css('.card-title', count: 10) + expect(page).to have_css('a.text-decoration-none', count: 10) + expect(page).to have_css('.card-footer', count: 10) + expect(page).to have_css('img.card-img-top', count: 10) + end + end + end +end