blob: 97ca1b6211fbf3ee94f50ea541ed12266cc5188c (
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
|
require 'test_helper'
class PagesControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:pages)
end
test "should get new" do
get :new
assert_response :success
end
test "should create page" do
assert_difference('Page.count') do
post :create, :page => { }
end
assert_redirected_to page_path(assigns(:page))
end
test "should show page" do
get :show, :id => pages(:one).id
assert_response :success
end
test "should get edit" do
get :edit, :id => pages(:one).id
assert_response :success
end
test "should update page" do
put :update, :id => pages(:one).id, :page => { }
assert_redirected_to page_path(assigns(:page))
end
test "should destroy page" do
assert_difference('Page.count', -1) do
delete :destroy, :id => pages(:one).id
end
assert_redirected_to pages_path
end
end
|