2014-08-30 17:38:47 +00:00
|
|
|
require 'rails_helper'
|
2013-05-27 19:25:29 +00:00
|
|
|
|
|
|
|
feature "Asciicast page", :js => true do
|
|
|
|
|
2014-02-12 19:51:01 +00:00
|
|
|
let!(:user) { create(:user, username: 'aaron') }
|
2013-11-18 12:01:35 +00:00
|
|
|
let!(:asciicast) { create(:asciicast, user: user, title: 'the title') }
|
|
|
|
let!(:other_asciicast) { create(:asciicast, user: user) }
|
2013-05-27 19:25:29 +00:00
|
|
|
|
|
|
|
scenario 'Visiting as guest' do
|
|
|
|
visit asciicast_path(asciicast)
|
|
|
|
|
2013-11-18 12:01:35 +00:00
|
|
|
expect(page).to have_content('the title')
|
|
|
|
expect(page).to have_link('aaron')
|
|
|
|
expect(page).to have_link('Embed')
|
|
|
|
expect(page).to have_selector('.cinema .play-button')
|
2013-05-27 19:25:29 +00:00
|
|
|
end
|
|
|
|
|
2015-04-26 14:16:42 +00:00
|
|
|
scenario 'Visiting as guest when asciicast is private' do
|
|
|
|
asciicast.update(private: true)
|
|
|
|
|
|
|
|
visit asciicast_path(asciicast)
|
|
|
|
|
|
|
|
expect(page).to have_content('the title')
|
|
|
|
expect(page).to have_link('aaron')
|
|
|
|
expect(page).to have_link('Embed')
|
|
|
|
expect(page).to have_selector('.cinema .play-button')
|
|
|
|
end
|
|
|
|
|
2013-05-27 19:25:29 +00:00
|
|
|
end
|