asciinema.org/spec/features/playback_spec.rb
2013-10-20 17:26:01 +02:00

34 lines
778 B
Ruby

require 'spec_helper'
describe 'Asciicast playback', :js => true, :slow => true do
let(:asciicast) { create(:asciicast) }
describe "from fixture" do
def inject_on_finished_callback
page.execute_script(<<EOS)
window.player.movie.on('finished', function() {
$('body').append('<span class=\"finished\"></span>');
})
EOS
end
before do
@old_wait_time = Capybara.default_wait_time
Capybara.default_wait_time = 120
end
after do
Capybara.default_wait_time = @old_wait_time
end
it "is successful" do
visit asciicast_path(asciicast, speed: 5)
find(".play-button").find(".arrow").click
inject_on_finished_callback
page.should have_selector('body .finished')
end
end
end