blob: 03b68e499d0bc6294f81ad0369feb35328fa181e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# frozen_string_literal: true
require 'test_helper'
class MachinesControllerTest < ActionDispatch::IntegrationTest
setup do
@machine = machines(:one)
end
test 'should get index' do
get machines_url
assert_response :success
end
test 'should get new' do
get new_machine_url
assert_response :success
end
test 'should create machine' do
assert_difference('Machine.count') do
post machines_url, params: { machine: { edition: @machine.edition, name: @machine.name } }
end
assert_redirected_to machines_url
end
test 'should show machine' do
get machine_url(@machine)
assert_response :success
end
test 'should update machine' do
patch machine_url(@machine), params: { machine: { edition: @machine.edition, name: @machine.name } }
assert_redirected_to machines_url
end
test 'should destroy machine' do
assert_difference('Machine.count', -1) do
delete machine_url(@machine)
end
assert_redirected_to machines_url
end
end
|