2012-11-18 23:19:42 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2013-05-27 19:25:29 +00:00
|
|
|
feature "Asciicast lists" do
|
2012-11-21 22:53:48 +00:00
|
|
|
|
2013-11-18 13:29:18 +00:00
|
|
|
let!(:asciicast) { create(:asciicast, title: 'foo bar') }
|
|
|
|
let!(:featured_asciicast) { create(:asciicast, title: 'qux', featured: true) }
|
2012-11-18 23:19:42 +00:00
|
|
|
|
2013-05-27 19:25:29 +00:00
|
|
|
scenario 'Visiting all' do
|
|
|
|
visit browse_path
|
2012-11-20 17:47:22 +00:00
|
|
|
|
2013-05-27 19:25:29 +00:00
|
|
|
expect(page).to have_content(/All Asciicasts/i)
|
2013-05-27 20:04:52 +00:00
|
|
|
expect_browse_links
|
2013-11-18 13:29:18 +00:00
|
|
|
expect(page).to have_link("foo bar")
|
|
|
|
expect(page).to have_selector('.asciicast-list .play-button')
|
2012-11-21 22:53:48 +00:00
|
|
|
end
|
2012-11-18 23:19:42 +00:00
|
|
|
|
2013-11-18 13:29:18 +00:00
|
|
|
scenario 'Visiting featured' do
|
2013-08-04 21:09:48 +00:00
|
|
|
visit asciicast_path(asciicast)
|
2013-11-18 13:29:18 +00:00
|
|
|
visit category_path(:featured)
|
2012-11-21 23:06:22 +00:00
|
|
|
|
2013-11-18 13:29:18 +00:00
|
|
|
expect(page).to have_content(/Featured Asciicasts/i)
|
2013-05-27 20:04:52 +00:00
|
|
|
expect_browse_links
|
2013-11-18 13:29:18 +00:00
|
|
|
expect(page).to have_link("qux")
|
|
|
|
expect(page).to have_selector('.asciicast-list .play-button')
|
2012-11-18 23:19:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|