You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/spec/features/asciicasts_spec.rb

28 lines
739 B
Ruby

require 'rails_helper'
feature "Asciicast lists" do
let!(:asciicast) { create(:asciicast, title: 'foo bar') }
let!(:featured_asciicast) { create(:asciicast, title: 'qux', featured: true) }
scenario 'Visiting all' do
visit browse_path
expect(page).to have_content(/All Asciicasts/i)
expect_browse_links
expect(page).to have_link("foo bar")
expect(page).to have_selector('.asciicast-list .play-button')
end
scenario 'Visiting featured' do
visit asciicast_path(asciicast)
visit category_path(:featured)
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')
end
end