moves featured debates to home page

This commit is contained in:
rgarcia
2015-08-10 21:25:04 +02:00
parent 2c88c6e07d
commit 4dd7e14ac4
14 changed files with 129 additions and 58 deletions

View File

@@ -2,4 +2,19 @@ require 'rails_helper'
feature "Home" do
scenario 'featured debates' do
featured_debates = [create(:debate), create(:debate), create(:debate)]
visit root_path
expect(page).to have_selector('#featured-debates .debate-featured', count: 3)
featured_debates.each do |debate|
within('#featured-debates') do
expect(page).to have_content debate.title
expect(page).to have_css("a[href='#{debate_path(debate)}']", text: debate.description)
end
end
end
end