From d4dfdb40329b8e15e6bba022b966984a8a994a87 Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 29 Jan 2009 21:40:04 +0100 Subject: added the content controller which will be responsible for rendering all public pages later on. added a new custom route for the public url schema as well as a functional test which tests the correct mapping of the custom route --- test/functional/content_controller_test.rb | 21 +++++++++++++++++++++ test/unit/helpers/content_helper_test.rb | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 test/functional/content_controller_test.rb create mode 100644 test/unit/helpers/content_helper_test.rb (limited to 'test') diff --git a/test/functional/content_controller_test.rb b/test/functional/content_controller_test.rb new file mode 100644 index 0000000..c44b221 --- /dev/null +++ b/test/functional/content_controller_test.rb @@ -0,0 +1,21 @@ +require 'test_helper' + +class ContentControllerTest < ActionController::TestCase + + def test_custom_page_route + assert_recognizes({ :controller => 'content', :action => 'render_page', :language => 'de', :pagepath => ['foo', 'bar'] }, '/de/foo/bar') + assert_recognizes({ :controller => 'content', :action => 'render_page', :language => 'en', :pagepath => ['home'] }, '/en/home') + end + + # def test_rendering_a_page + # Page.destroy_all + # load_atp 'content_controller' + # Page.all.each {|x| x.update_unique_name; x.save} + # assert Page.valid? + # assert_not_nil Page.find_by_title("short name yo") + # get :render_page, :language => 'de', :pagepath => ["shortname","barfoo"] + # assert_response :success + # assert_template 'wtp_eins' + # assert_equal "page_templates/layouts/screen", @response.layout + # end +end diff --git a/test/unit/helpers/content_helper_test.rb b/test/unit/helpers/content_helper_test.rb new file mode 100644 index 0000000..2da82d7 --- /dev/null +++ b/test/unit/helpers/content_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ContentHelperTest < ActionView::TestCase +end -- cgit v1.3