First steps for an own wiki.
* Scaffold for Page Objekt * Using textile for rendering html * Easy wiki-links with [[wikipage]]
This commit is contained in:
parent
37199bae1d
commit
f450070dbf
16 changed files with 252 additions and 1 deletions
11
test/fixtures/pages.yml
vendored
Normal file
11
test/fixtures/pages.yml
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
title: MyString
|
||||
body: MyText
|
||||
permalink: MyString
|
||||
|
||||
two:
|
||||
title: MyString
|
||||
body: MyText
|
||||
permalink: MyString
|
||||
45
test/functional/pages_controller_test.rb
Normal file
45
test/functional/pages_controller_test.rb
Normal file
|
|
@ -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
|
||||
8
test/unit/page_test.rb
Normal file
8
test/unit/page_test.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require 'test_helper'
|
||||
|
||||
class PageTest < ActiveSupport::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue