diff options
Diffstat (limited to 'test/functional/content_controller_test.rb')
| -rw-r--r-- | test/functional/content_controller_test.rb | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/test/functional/content_controller_test.rb b/test/functional/content_controller_test.rb index 2e0ee0e..cb6ad04 100644 --- a/test/functional/content_controller_test.rb +++ b/test/functional/content_controller_test.rb | |||
| @@ -36,20 +36,15 @@ class ContentControllerTest < ActionController::TestCase | |||
| 36 | def test_page_containing_aggregator | 36 | def test_page_containing_aggregator |
| 37 | assert_not_nil Node.root | 37 | assert_not_nil Node.root |
| 38 | 38 | ||
| 39 | d1 = @first_child.find_or_create_draft @user1 | 39 | fill_pages_with_content |
| 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 | 40 | ||
| 46 | d2 = @second_child.find_or_create_draft @user1 | 41 | new_node = create_node_under_root "fnord" |
| 47 | d2.title = "two" | 42 | draft = new_node.find_or_create_draft @user1 |
| 48 | d2.tag_list = "update" | 43 | draft.body = '<aggregate tags="update" limit="20" />' |
| 49 | d2.save | 44 | draft.save |
| 50 | @second_child.publish_draft! | 45 | new_node.publish_draft! |
| 51 | 46 | ||
| 52 | get :render_page, :locale => 'de', :page_path => ["first_child"] | 47 | get :render_page, :locale => 'de', :page_path => ["fnord"] |
| 53 | assert_response :success | 48 | assert_response :success |
| 54 | 49 | ||
| 55 | assert_select("h2", "one") | 50 | assert_select("h2", "one") |
| @@ -60,7 +55,23 @@ class ContentControllerTest < ActionController::TestCase | |||
| 60 | 55 | ||
| 61 | protected | 56 | protected |
| 62 | 57 | ||
| 63 | def create_update | 58 | def create_node_under_root slug |
| 64 | 59 | node = Node.create! :slug => slug | |
| 60 | node.move_to_child_of Node.root | ||
| 61 | node | ||
| 62 | end | ||
| 63 | |||
| 64 | def fill_pages_with_content | ||
| 65 | d1 = @first_child.find_or_create_draft @user1 | ||
| 66 | d1.title = "one" | ||
| 67 | d1.tag_list = "update" | ||
| 68 | d1.save | ||
| 69 | @first_child.publish_draft! | ||
| 70 | |||
| 71 | d2 = @second_child.find_or_create_draft @user1 | ||
| 72 | d2.title = "two" | ||
| 73 | d2.tag_list = "update" | ||
| 74 | d2.save | ||
| 75 | @second_child.publish_draft! | ||
| 65 | end | 76 | end |
| 66 | end | 77 | end |
