workbench: Add VM integration tests.
authorBrett Smith <brett@curoverse.com>
Wed, 19 Mar 2014 16:10:51 +0000 (12:10 -0400)
committerBrett Smith <brett@curoverse.com>
Wed, 19 Mar 2014 16:25:27 +0000 (12:25 -0400)
This is the "start test" that Ward suggested I implement to start off.
It's easy but not trivial: it requires JavaScript support and filling
out a form.

apps/workbench/test/integration/virtual_machines_test.rb [new file with mode: 0644]

diff --git a/apps/workbench/test/integration/virtual_machines_test.rb b/apps/workbench/test/integration/virtual_machines_test.rb
new file mode 100644 (file)
index 0000000..541a7aa
--- /dev/null
@@ -0,0 +1,17 @@
+require 'integration_helper'
+
+class VirtualMachinesTest < ActionDispatch::IntegrationTest
+  test "make and name a new virtual machine" do
+    Capybara.current_driver = Capybara.javascript_driver
+    visit page_with_token('admin_trustedclient')
+    click_link 'Virtual machines'
+    assert page.has_text? 'testvm.shell'
+    click_on 'Add a new virtual machine'
+    assert page.has_text? 'none'
+    click_link 'none'
+    assert page.has_text? 'Update hostname'
+    fill_in 'editable-text', with: 'testname'
+    click_button 'editable-submit'
+    assert page.has_text? 'testname'
+  end
+end