summaryrefslogtreecommitdiff
path: root/test/functional/content_controller_test.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-27 16:53:11 +0100
committerhukl <contact@smyck.org>2009-02-27 16:53:11 +0100
commit69a37065f9f523c25bc4edb9c70a9b21578d46f6 (patch)
tree550e750f9c48dee36f472fa1c8bae54e5bd95f17 /test/functional/content_controller_test.rb
parent463da8c96569f4ef9450f0eb75c7209f6a25b84b (diff)
more tests and fixes. always write tests - they are so good!
Diffstat (limited to 'test/functional/content_controller_test.rb')
-rw-r--r--test/functional/content_controller_test.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/content_controller_test.rb b/test/functional/content_controller_test.rb
index d64de60..2e0ee0e 100644
--- a/test/functional/content_controller_test.rb
+++ b/test/functional/content_controller_test.rb
@@ -2,6 +2,15 @@ require 'test_helper'
2 2
3class ContentControllerTest < ActionController::TestCase 3class ContentControllerTest < ActionController::TestCase
4 4
5 def setup
6 @root = Node.find(1)
7 @first_child = Node.find(2)
8 @second_child = Node.find(3)
9
10 @user1 = User.create :login => 'demo', :email => "f@b.com", :password => 'foobar', :password_confirmation => 'foobar'
11 @user2 = User.create :login => 'show', :email => "f@b.com", :password => 'foobar', :password_confirmation => 'foobar'
12 end
13
5 def test_custom_page_route 14 def test_custom_page_route
6 assert_recognizes({ :controller => 'content', :action => 'render_page', :locale => 'de', :page_path => ['foo', 'bar'] }, '/de/foo/bar') 15 assert_recognizes({ :controller => 'content', :action => 'render_page', :locale => 'de', :page_path => ['foo', 'bar'] }, '/de/foo/bar')
7 assert_recognizes({ :controller => 'content', :action => 'render_page', :locale => 'en', :page_path => ['home'] }, '/en/home') 16 assert_recognizes({ :controller => 'content', :action => 'render_page', :locale => 'en', :page_path => ['home'] }, '/en/home')
@@ -23,4 +32,35 @@ class ContentControllerTest < ActionController::TestCase
23 assert_response :success 32 assert_response :success
24 assert_equal "layouts/application", @response.layout 33 assert_equal "layouts/application", @response.layout
25 end 34 end
35
36 def test_page_containing_aggregator
37 assert_not_nil Node.root
38
39 d1 = @first_child.find_or_create_draft @user1
40 d1.title = "one"
41 d1.tag_list = "update"
42 d1.body = '<aggregate tags="update" limit="20" />'
43 d1.save
44 @first_child.publish_draft!
45
46 d2 = @second_child.find_or_create_draft @user1
47 d2.title = "two"
48 d2.tag_list = "update"
49 d2.save
50 @second_child.publish_draft!
51
52 get :render_page, :locale => 'de', :page_path => ["first_child"]
53 assert_response :success
54
55 assert_select("h2", "one")
56 assert_select("h2", "two")
57 end
58
59
60
61 protected
62
63 def create_update
64
65 end
26end 66end