-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlunchboxes_controller_test.rb
More file actions
48 lines (38 loc) · 1.03 KB
/
lunchboxes_controller_test.rb
File metadata and controls
48 lines (38 loc) · 1.03 KB
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 Admin::LunchboxesControllerTest < ActionDispatch::IntegrationTest
setup do
@lunchbox = lunchboxes(:one)
end
test "should get index" do
get lunchboxes_url
assert_response :success
end
test "should get new" do
get new_lunchbox_url
assert_response :success
end
test "should create lunchbox" do
assert_difference('Lunchbox.count') do
post lunchboxes_url, params: { lunchbox: { } }
end
assert_redirected_to lunchbox_url(Lunchbox.last)
end
test "should show lunchbox" do
get lunchbox_url(@lunchbox)
assert_response :success
end
test "should get edit" do
get edit_lunchbox_url(@lunchbox)
assert_response :success
end
test "should update lunchbox" do
patch lunchbox_url(@lunchbox), params: { lunchbox: { } }
assert_redirected_to lunchbox_url(@lunchbox)
end
test "should destroy lunchbox" do
assert_difference('Lunchbox.count', -1) do
delete lunchbox_url(@lunchbox)
end
assert_redirected_to lunchboxes_url
end
end