foodsoft/test/functional/pages_controller_test.rb
Benjamin Meichsner f450070dbf First steps for an own wiki.
* Scaffold for Page Objekt
* Using textile for rendering html
* Easy wiki-links with [[wikipage]]
2009-03-25 19:54:04 +01:00

45 lines
959 B
Ruby

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