asciinema.org/spec/features/asciicasts_spec.rb

28 lines
742 B
Ruby
Raw Normal View History

2014-08-30 17:38:47 +00:00
require 'rails_helper'
2012-11-18 23:19:42 +00:00
2013-05-27 19:25:29 +00:00
feature "Asciicast lists" do
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
2015-05-10 19:24:46 +00:00
expect(page).to have_content(/Public asciicasts/i)
expect_browse_links
expect(page).to have_link("foo bar")
expect(page).to have_selector('.asciicast-list .play-button')
end
2012-11-18 23:19:42 +00:00
scenario 'Visiting featured' do
visit asciicast_path(asciicast)
visit category_path(:featured)
2015-05-10 19:24:46 +00:00
expect(page).to have_content(/Featured asciicasts/i)
expect_browse_links
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