From 2c8c227493509175fcdbcba3e6a85f8b954a169e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 15 Jan 2022 12:10:26 -0500 Subject: init --- test/system/machines_test.rb | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/system/machines_test.rb (limited to 'test/system/machines_test.rb') 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 -- cgit 1.4.1