about summary refs log tree commit diff
path: root/test/system/machines_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/machines_test.rb')
-rw-r--r--test/system/machines_test.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/system/machines_test.rb b/test/system/machines_test.rb
new file mode 100644
index 0000000..552b188
--- /dev/null
+++ b/test/system/machines_test.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+require 'application_system_test_case'
+
+class MachinesTest < ApplicationSystemTestCase
+  setup do
+    @machine = machines(:one)
+  end
+
+  test 'visiting the index' do
+    visit machines_url
+    assert_selector 'h1', text: 'Machines'
+  end
+
+  test 'should create machine' do
+    visit machines_url
+    click_on 'New machine'
+
+    fill_in 'Edition', with: @machine.edition
+    fill_in 'Name', with: @machine.name
+    click_on 'Create Machine'
+
+    assert_text 'Machine was successfully created'
+    click_on 'Back'
+  end
+
+  test 'should update Machine' do
+    visit machine_url(@machine)
+    click_on 'Edit this machine', match: :first
+
+    fill_in 'Edition', with: @machine.edition
+    fill_in 'Name', with: @machine.name
+    click_on 'Update Machine'
+
+    assert_text 'Machine was successfully updated'
+    click_on 'Back'
+  end
+
+  test 'should destroy Machine' do
+    visit machine_url(@machine)
+    click_on 'Destroy this machine', match: :first
+
+    assert_text 'Machine was successfully destroyed'
+  end
+end