2014-08-30 17:38:47 +00:00
|
|
|
require 'rails_helper'
|
2013-05-27 19:25:29 +00:00
|
|
|
|
2015-04-26 14:16:42 +00:00
|
|
|
describe 'Asciicast playback', js: true, slow: true do
|
2013-10-20 15:26:01 +00:00
|
|
|
|
|
|
|
describe "from fixture" do
|
|
|
|
before do
|
|
|
|
@old_wait_time = Capybara.default_wait_time
|
2014-07-01 19:53:29 +00:00
|
|
|
Capybara.default_wait_time = 15
|
2013-10-20 15:26:01 +00:00
|
|
|
end
|
2013-05-27 19:25:29 +00:00
|
|
|
|
2013-10-20 15:26:01 +00:00
|
|
|
after do
|
|
|
|
Capybara.default_wait_time = @old_wait_time
|
|
|
|
end
|
2013-05-27 19:25:29 +00:00
|
|
|
|
2015-04-26 14:16:42 +00:00
|
|
|
context "for public asciicast" do
|
|
|
|
let(:asciicast) { create(:asciicast, private: false) }
|
|
|
|
|
|
|
|
it "is successful" do
|
|
|
|
visit asciicast_path(asciicast, speed: 5)
|
|
|
|
find(".start-prompt .play-button").click
|
|
|
|
expect(page).to have_css('.time-remaining', visible: false, text: '-00:0')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "for private asciicast" do
|
|
|
|
let(:asciicast) { create(:asciicast, private: true) }
|
|
|
|
|
|
|
|
it "is successful" do
|
|
|
|
visit asciicast_path(asciicast, speed: 5)
|
|
|
|
find(".start-prompt .play-button").click
|
|
|
|
expect(page).to have_css('.time-remaining', visible: false, text: '-00:0')
|
|
|
|
end
|
2013-05-27 19:25:29 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|