blob: 7afd166a270a277a5d42063c472ae80502a1b598 (
plain)
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
46
47
48
|
require "test_helper"
class BedsControllerTest < ActionDispatch::IntegrationTest
setup do
@bed = beds(:one)
end
test "should get index" do
get beds_url
assert_response :success
end
test "should get new" do
get new_bed_url
assert_response :success
end
test "should create bed" do
assert_difference("Bed.count") do
post beds_url, params: { bed: {} }
end
assert_redirected_to bed_url(Bed.last)
end
test "should show bed" do
get bed_url(@bed)
assert_response :success
end
test "should get edit" do
get edit_bed_url(@bed)
assert_response :success
end
test "should update bed" do
patch bed_url(@bed), params: { bed: {} }
assert_redirected_to bed_url(@bed)
end
test "should destroy bed" do
assert_difference("Bed.count", -1) do
delete bed_url(@bed)
end
assert_redirected_to beds_url
end
end
|