diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixtures/nodes.yml | 8 | ||||
| -rw-r--r-- | test/functional/content_controller_test.rb | 23 | ||||
| -rw-r--r-- | test/unit/node_test.rb | 8 |
3 files changed, 28 insertions, 11 deletions
diff --git a/test/fixtures/nodes.yml b/test/fixtures/nodes.yml new file mode 100644 index 0000000..9879d9f --- /dev/null +++ b/test/fixtures/nodes.yml | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
| 2 | |||
| 3 | one: | ||
| 4 | id: 1 | ||
| 5 | lft: 1 | ||
| 6 | rgt: 2 | ||
| 7 | slug: my_first_page | ||
| 8 | unique_name: root/my_first_page | ||
diff --git a/test/functional/content_controller_test.rb b/test/functional/content_controller_test.rb index c44b221..15e1299 100644 --- a/test/functional/content_controller_test.rb +++ b/test/functional/content_controller_test.rb | |||
| @@ -7,15 +7,16 @@ class ContentControllerTest < ActionController::TestCase | |||
| 7 | assert_recognizes({ :controller => 'content', :action => 'render_page', :language => 'en', :pagepath => ['home'] }, '/en/home') | 7 | assert_recognizes({ :controller => 'content', :action => 'render_page', :language => 'en', :pagepath => ['home'] }, '/en/home') |
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | # def test_rendering_a_page | 10 | def test_render_404_when_no_page_was_found |
| 11 | # Page.destroy_all | 11 | get :render_page, :language => 'de', :page_path => ["wrong_path"] |
| 12 | # load_atp 'content_controller' | 12 | assert_response 404 |
| 13 | # Page.all.each {|x| x.update_unique_name; x.save} | 13 | end |
| 14 | # assert Page.valid? | 14 | |
| 15 | # assert_not_nil Page.find_by_title("short name yo") | 15 | def test_rendering_a_page |
| 16 | # get :render_page, :language => 'de', :pagepath => ["shortname","barfoo"] | 16 | assert Node.valid? |
| 17 | # assert_response :success | 17 | assert_not_nil Node.find_by_slug("my_first_page") |
| 18 | # assert_template 'wtp_eins' | 18 | get :render_page, :language => 'de', :page_path => ["root", "my_first_page"] |
| 19 | # assert_equal "page_templates/layouts/screen", @response.layout | 19 | assert_response :success |
| 20 | # end | 20 | assert_equal "layouts/application", @response.layout |
| 21 | end | ||
| 21 | end | 22 | end |
diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb new file mode 100644 index 0000000..a311b84 --- /dev/null +++ b/test/unit/node_test.rb | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | require 'test_helper' | ||
| 2 | |||
| 3 | class NodeTest < ActiveSupport::TestCase | ||
| 4 | # Replace this with your real tests. | ||
| 5 | test "the truth" do | ||
| 6 | assert true | ||
| 7 | end | ||
| 8 | end | ||
