Files
grecia/spec/system/banners_spec.rb
taitus 85611a5103 Adding consistency for post_started_at and post_ended_at on specs
These two fields are of type Date and in some specs they are being
filled as Time or DateTime.
2021-04-08 17:23:33 +02:00

20 lines
535 B
Ruby

require "rails_helper"
describe "Banner" do
scenario "Only renders banners in the right section" do
create(:banner,
web_sections: [WebSection.find_by!(name: "homepage")],
description: "Banner description",
post_started_at: (Date.current - 4.days),
post_ended_at: (Date.current + 10.days))
visit root_path
within(".banner") { expect(page).to have_content("Banner description") }
visit debates_path
expect(page).not_to have_content("Banner description")
end
end