From 89d3dc4a676ee82cc6bad4d9d00535897318f1c3 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 31 Jan 2009 13:04:29 +0100 Subject: Added Page model scaffold --- test/fixtures/pages.yml | 15 +++++++++++ test/functional/pages_controller_test.rb | 45 ++++++++++++++++++++++++++++++++ test/unit/helpers/pages_helper_test.rb | 4 +++ test/unit/page_test.rb | 5 ++++ 4 files changed, 69 insertions(+) create mode 100644 test/fixtures/pages.yml create mode 100644 test/functional/pages_controller_test.rb create mode 100644 test/unit/helpers/pages_helper_test.rb create mode 100644 test/unit/page_test.rb (limited to 'test') 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 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +one: + node_id: 1 + title: MyString + abstract: MyText + body: MyText + revision: 1 + +two: + node_id: 1 + title: MyString + abstract: MyText + body: MyText + 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 @@ +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 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 @@ +require 'test_helper' + +class PagesHelperTest < ActionView::TestCase +end 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 @@ +require 'test_helper' + +class PageTest < ActiveSupport::TestCase + +end -- cgit v1.3