diff options
author | Ben Harris <ben@tilde.team> | 2022-01-15 12:10:26 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2022-01-15 12:10:26 -0500 |
commit | 2c8c227493509175fcdbcba3e6a85f8b954a169e (patch) | |
tree | 56c95cb471004fef1bfa4c99e93fdec1716e3840 /test/system/machines_test.rb |
init
Diffstat (limited to 'test/system/machines_test.rb')
-rw-r--r-- | test/system/machines_test.rb | 45 |
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 |