Skip to content

Instantly share code, notes, and snippets.

@alkema
Created July 18, 2011 15:18
Show Gist options
  • Save alkema/1089830 to your computer and use it in GitHub Desktop.
Save alkema/1089830 to your computer and use it in GitHub Desktop.
akephalos-js-test
#!/usr/bin/env ruby
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
require 'akephalos'
Capybara.run_server = true
Capybara.current_driver = :akephalos
Capybara.app_host = 'http://localhost:8081'
module MyCapybaraTest
class Test
include Capybara
def join_group
p 'Logging in...'
visit('/')
within 'form[name=game]' do
fill_in 'name', with: 'jody'
end
click_button 'Start'
page.execute_script("x$('#friend').html('ruby')")
end
end
end
t = MyCapybaraTest::Test.new
t.join_group
puts t.page.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment