diff options
| author | hukl <hukl@eight.local> | 2009-01-31 13:04:29 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-01-31 13:04:29 +0100 |
| commit | 89d3dc4a676ee82cc6bad4d9d00535897318f1c3 (patch) | |
| tree | 193c17723e67a2140323bbc9d68985a7f5545b0f /test/functional | |
| parent | 71f70cca407fa0dad84c3b8babc63e42e40d8ea2 (diff) | |
Added Page model scaffold
Diffstat (limited to 'test/functional')
| -rw-r--r-- | test/functional/pages_controller_test.rb | 45 |
1 files changed, 45 insertions, 0 deletions
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 @@ | |||
| 1 | require 'test_helper' | ||
| 2 | |||
| 3 | class 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 | ||
| 45 | end | ||
