summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhukl <hukl@eight.local>2009-01-31 13:04:29 +0100
committerhukl <hukl@eight.local>2009-01-31 13:04:29 +0100
commit89d3dc4a676ee82cc6bad4d9d00535897318f1c3 (patch)
tree193c17723e67a2140323bbc9d68985a7f5545b0f /test
parent71f70cca407fa0dad84c3b8babc63e42e40d8ea2 (diff)
Added Page model scaffold
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/pages.yml15
-rw-r--r--test/functional/pages_controller_test.rb45
-rw-r--r--test/unit/helpers/pages_helper_test.rb4
-rw-r--r--test/unit/page_test.rb5
4 files changed, 69 insertions, 0 deletions
diff --git a/test/fixtures/pages.yml b/test/fixtures/pages.yml
new file mode 100644
index 0000000..2b1cad1
--- /dev/null
+++ b/test/fixtures/pages.yml
@@ -0,0 +1,15 @@
1# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
3one:
4 node_id: 1
5 title: MyString
6 abstract: MyText
7 body: MyText
8 revision: 1
9
10two:
11 node_id: 1
12 title: MyString
13 abstract: MyText
14 body: MyText
15 revision: 1
diff --git a/test/functional/pages_controller_test.rb b/test/functional/pages_controller_test.rb
new file mode 100644
index 0000000..97ca1b6
--- /dev/null
+++ b/test/functional/pages_controller_test.rb
@@ -0,0 +1,45 @@
1require 'test_helper'
2
3class PagesControllerTest < ActionController::TestCase
4 test "should get index" do
5 get :index
6 assert_response :success
7 assert_not_nil assigns(:pages)
8 end
9
10 test "should get new" do
11 get :new
12 assert_response :success
13 end
14
15 test "should create page" do
16 assert_difference('Page.count') do
17 post :create, :page => { }
18 end
19
20 assert_redirected_to page_path(assigns(:page))
21 end
22
23 test "should show page" do
24 get :show, :id => pages(:one).id
25 assert_response :success
26 end
27
28 test "should get edit" do
29 get :edit, :id => pages(:one).id
30 assert_response :success
31 end
32
33 test "should update page" do
34 put :update, :id => pages(:one).id, :page => { }
35 assert_redirected_to page_path(assigns(:page))
36 end
37
38 test "should destroy page" do
39 assert_difference('Page.count', -1) do
40 delete :destroy, :id => pages(:one).id
41 end
42
43 assert_redirected_to pages_path
44 end
45end
diff --git a/test/unit/helpers/pages_helper_test.rb b/test/unit/helpers/pages_helper_test.rb
new file mode 100644
index 0000000..535dfe1
--- /dev/null
+++ b/test/unit/helpers/pages_helper_test.rb
@@ -0,0 +1,4 @@
1require 'test_helper'
2
3class PagesHelperTest < ActionView::TestCase
4end
diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb
new file mode 100644
index 0000000..af62e93
--- /dev/null
+++ b/test/unit/page_test.rb
@@ -0,0 +1,5 @@
1require 'test_helper'
2
3class PageTest < ActiveSupport::TestCase
4
5end