browsercms 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/cms/content_block_controller.rb +2 -2
- data/app/controllers/cms/section_nodes_controller.rb +6 -1
- data/app/controllers/cms/sections_controller.rb +1 -1
- data/app/helpers/cms/application_helper.rb +1 -1
- data/app/helpers/cms/content_block_helper.rb +27 -0
- data/app/helpers/cms/section_nodes_helper.rb +43 -5
- data/app/models/abstract_file_block.rb +16 -1
- data/app/models/attachment.rb +17 -35
- data/app/models/file_block.rb +0 -12
- data/app/models/image_block.rb +0 -12
- data/app/models/link.rb +4 -21
- data/app/models/page.rb +31 -34
- data/app/models/section.rb +82 -44
- data/app/models/section_node.rb +39 -24
- data/app/models/user.rb +5 -0
- data/app/views/cms/blocks/index.html.erb +4 -4
- data/app/views/cms/file_blocks/_form.html.erb +1 -1
- data/app/views/cms/image_blocks/_form.html.erb +1 -1
- data/app/views/cms/section_nodes/_link.html.erb +6 -3
- data/app/views/cms/section_nodes/_node.html.erb +11 -1
- data/app/views/cms/section_nodes/_page.html.erb +13 -7
- data/app/views/cms/section_nodes/_section.html.erb +24 -8
- data/app/views/cms/section_nodes/index.html.erb +28 -16
- data/app/views/layouts/templates/default.html.erb +17 -0
- data/browsercms.gemspec +28 -1413
- data/db/migrate/20120117144039_browsercms315.rb +94 -0
- data/db/migrate/{20081114172307_load_seed_data.rb → 20121114172307_load_seeds.rb} +8 -1
- data/lib/acts_as_list.rb +1 -1
- data/lib/browsercms.rb +2 -0
- data/lib/cms/addressable.rb +83 -0
- data/lib/cms/behaviors/attaching.rb +44 -24
- data/lib/cms/behaviors/connecting.rb +2 -1
- data/lib/cms/behaviors/publishing.rb +12 -3
- data/lib/cms/behaviors/versioning.rb +83 -53
- data/lib/cms/content_rendering_support.rb +3 -3
- data/lib/cms/error_pages.rb +8 -0
- data/lib/cms/init.rb +5 -3
- data/lib/cms/version.rb +1 -1
- data/templates/blank.rb +2 -0
- data/templates/demo.rb +2 -0
- data/templates/module.rb +2 -0
- data/test/custom_assertions.rb +7 -1
- data/test/factories.rb +3 -1
- data/test/factories/sitemap_factories.rb +28 -0
- data/test/fixtures/connectors.yml +97 -0
- data/test/fixtures/content_type_groups.yml +13 -0
- data/test/fixtures/content_types.yml +50 -0
- data/test/fixtures/dynamic_view_versions.yml +26 -0
- data/test/fixtures/dynamic_views.yml +26 -0
- data/test/fixtures/group_permissions.yml +16 -0
- data/test/fixtures/group_sections.yml +31 -0
- data/test/fixtures/group_type_permissions.yml +11 -0
- data/test/fixtures/group_types.yml +25 -0
- data/test/fixtures/groups.yml +25 -0
- data/test/fixtures/html_block_versions.yml +67 -0
- data/test/fixtures/html_blocks.yml +63 -0
- data/test/fixtures/page_versions.yml +265 -0
- data/test/fixtures/pages.yml +85 -0
- data/test/fixtures/permissions.yml +28 -0
- data/test/fixtures/section_nodes.yml +46 -0
- data/test/fixtures/sections.yml +19 -0
- data/test/fixtures/sites.yml +9 -0
- data/test/fixtures/user_group_memberships.yml +11 -0
- data/test/fixtures/users.yml +15 -0
- data/test/functional/cms/content_controller_test.rb +6 -1
- data/test/functional/cms/file_blocks_controller_test.rb +1 -0
- data/test/functional/cms/html_blocks_controller_test.rb +1 -0
- data/test/functional/cms/image_blocks_controller_test.rb +39 -32
- data/test/functional/cms/section_nodes_controller_test.rb +48 -20
- data/test/functional/cms/sections_controller_test.rb +3 -1
- data/test/functional/tests/pretend_controller_test.rb +6 -3
- data/test/integration/cms/ckeditor_test.rb +5 -2
- data/test/integration/sitemap_performance_test.rb +26 -0
- data/test/selenium-core/Blank.html +7 -0
- data/test/selenium-core/InjectedRemoteRunner.html +8 -0
- data/test/selenium-core/RemoteRunner.html +110 -0
- data/test/selenium-core/SeleniumLog.html +109 -0
- data/test/selenium-core/TestPrompt.html +145 -0
- data/test/selenium-core/TestRunner-splash.html +55 -0
- data/test/selenium-core/TestRunner.hta +176 -0
- data/test/selenium-core/TestRunner.html +176 -0
- data/test/selenium-core/domviewer/butmin.gif +0 -0
- data/test/selenium-core/domviewer/butplus.gif +0 -0
- data/test/selenium-core/domviewer/domviewer.css +298 -0
- data/test/selenium-core/domviewer/domviewer.html +16 -0
- data/test/selenium-core/domviewer/selenium-domviewer.js +205 -0
- data/test/selenium-core/icons/all.png +0 -0
- data/test/selenium-core/icons/continue.png +0 -0
- data/test/selenium-core/icons/continue_disabled.png +0 -0
- data/test/selenium-core/icons/pause.png +0 -0
- data/test/selenium-core/icons/pause_disabled.png +0 -0
- data/test/selenium-core/icons/selected.png +0 -0
- data/test/selenium-core/icons/step.png +0 -0
- data/test/selenium-core/icons/step_disabled.png +0 -0
- data/test/selenium-core/iedoc-core.xml +1515 -0
- data/test/selenium-core/iedoc.xml +1469 -0
- data/test/selenium-core/lib/cssQuery/cssQuery-p.js +6 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level2.js +142 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level3.js +150 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-standard.js +53 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery.js +356 -0
- data/test/selenium-core/lib/prototype.js +2006 -0
- data/test/selenium-core/lib/scriptaculous/builder.js +101 -0
- data/test/selenium-core/lib/scriptaculous/controls.js +815 -0
- data/test/selenium-core/lib/scriptaculous/dragdrop.js +915 -0
- data/test/selenium-core/lib/scriptaculous/effects.js +958 -0
- data/test/selenium-core/lib/scriptaculous/scriptaculous.js +47 -0
- data/test/selenium-core/lib/scriptaculous/slider.js +283 -0
- data/test/selenium-core/lib/scriptaculous/unittest.js +383 -0
- data/test/selenium-core/scripts/find_matching_child.js +69 -0
- data/test/selenium-core/scripts/htmlutils.js +894 -0
- data/test/selenium-core/scripts/injection.html +72 -0
- data/test/selenium-core/scripts/js2html.js +70 -0
- data/test/selenium-core/scripts/narcissus-defs.js +175 -0
- data/test/selenium-core/scripts/narcissus-exec.js +1054 -0
- data/test/selenium-core/scripts/narcissus-parse.js +1003 -0
- data/test/selenium-core/scripts/se2html.js +63 -0
- data/test/selenium-core/scripts/selenium-api.js +2409 -0
- data/test/selenium-core/scripts/selenium-browserbot.js +2203 -0
- data/test/selenium-core/scripts/selenium-browserdetect.js +150 -0
- data/test/selenium-core/scripts/selenium-commandhandlers.js +377 -0
- data/test/selenium-core/scripts/selenium-executionloop.js +175 -0
- data/test/selenium-core/scripts/selenium-logging.js +147 -0
- data/test/selenium-core/scripts/selenium-remoterunner.js +571 -0
- data/test/selenium-core/scripts/selenium-testrunner.js +1333 -0
- data/test/selenium-core/scripts/selenium-version.js +5 -0
- data/test/selenium-core/scripts/user-extensions.js +3 -0
- data/test/selenium-core/scripts/user-extensions.js.sample +75 -0
- data/test/selenium-core/scripts/xmlextras.js +153 -0
- data/test/selenium-core/selenium-logo.png +0 -0
- data/test/selenium-core/selenium-test.css +43 -0
- data/test/selenium-core/selenium.css +299 -0
- data/test/selenium-core/xpath/dom.js +428 -0
- data/test/selenium-core/xpath/misc.js +252 -0
- data/test/selenium-core/xpath/xpath.js +2223 -0
- data/test/selenium/_login_as_cmsadmin.rsel +4 -0
- data/test/selenium/dashboard.rsel +5 -0
- data/test/selenium/html_blocks.rsel +4 -0
- data/test/selenium/login/failed_login.rsel +8 -0
- data/test/selenium/login/successful_login.rsel +9 -0
- data/test/selenium/page_templates.rsel +12 -0
- data/test/selenium/pages/edit_properties.rsel +5 -0
- data/test/selenium/site/view_home_page.rsel +4 -0
- data/test/selenium/sitemap/move_page.rsel +9 -0
- data/test/selenium/sitemap/open_section.rsel +6 -0
- data/test/selenium/sitemap/select_page.rsel +12 -0
- data/test/selenium/sitemap/select_section.rsel +17 -0
- data/test/test_helper.rb +30 -12
- data/test/unit/behaviors/attaching_test.rb +4 -6
- data/test/unit/behaviors/connectable_test.rb +29 -0
- data/test/unit/behaviors/publishable_test.rb +40 -9
- data/test/unit/behaviors/versioning_test.rb +36 -0
- data/test/unit/helpers/menu_helper_test.rb +5 -2
- data/test/unit/helpers/page_helper_test.rb +2 -0
- data/test/unit/lib/cms/sitemap_test.rb +206 -0
- data/test/unit/models/attachment_test.rb +51 -31
- data/test/unit/models/file_block_test.rb +74 -55
- data/test/unit/models/link_test.rb +44 -0
- data/test/unit/models/page_test.rb +290 -224
- data/test/unit/models/sections_test.rb +144 -44
- data/test/unit/models/user_test.rb +28 -18
- metadata +581 -350
- data/app/views/cms/section_nodes/_section_node.html.erb +0 -10
- data/test/unit/models/section_node_test.rb +0 -92
@@ -1,10 +0,0 @@
|
|
1
|
-
<% r = defined?(root) %>
|
2
|
-
<% if section_node.node && %w[Link Page Section].include?(section_node.node_type) %>
|
3
|
-
<%= render :partial => section_node.node_type.underscore, :locals => {
|
4
|
-
:section_node => section_node,
|
5
|
-
:node => section_node.node,
|
6
|
-
:display => display,
|
7
|
-
:root => r
|
8
|
-
}
|
9
|
-
%>
|
10
|
-
<% end %>
|
@@ -1,92 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '/../../test_helper')
|
2
|
-
|
3
|
-
class SectionNodeTest < ActiveSupport::TestCase
|
4
|
-
def setup
|
5
|
-
@parent = Factory(:section, :parent => root_section, :name => "Parent")
|
6
|
-
@a = Factory(:section, :parent => @parent, :name => "A")
|
7
|
-
@a1 = Factory(:page, :section => @a, :name => "A1")
|
8
|
-
@a2 = Factory(:page, :section => @a, :name => "A2")
|
9
|
-
@a3 = Factory(:page, :section => @a, :name => "A3")
|
10
|
-
@b = Factory(:section, :parent => @parent, :name => "B")
|
11
|
-
@b1 = Factory(:page, :section => @b, :name => "B1")
|
12
|
-
@b2 = Factory(:page, :section => @b, :name => "B2")
|
13
|
-
@b3 = Factory(:page, :section => @b, :name => "B3")
|
14
|
-
|
15
|
-
@node_a = @a.node
|
16
|
-
@node_b = @b.node
|
17
|
-
@node_a1 = @a1.section_node
|
18
|
-
@node_a2 = @a2.section_node
|
19
|
-
@node_a3 = @a3.section_node
|
20
|
-
@node_b1 = @b1.section_node
|
21
|
-
@node_b2 = @b2.section_node
|
22
|
-
@node_b3 = @b3.section_node
|
23
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
24
|
-
end
|
25
|
-
def test_reorder_nodes_within_same_section
|
26
|
-
@node_a2.move_to(@a, 1)
|
27
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
28
|
-
log_table_without_stamps(SectionNode)
|
29
|
-
assert_properties(@node_a, :section_id => @parent.id, :node_type => "Section", :node_id => @a.id, :position => 1)
|
30
|
-
assert_properties(@node_b, :section_id => @parent.id, :node_type => "Section", :node_id => @b.id, :position => 2)
|
31
|
-
assert_properties(@node_a1, :section_id => @a.id, :node_type => "Page", :node_id => @a1.id, :position => 2)
|
32
|
-
assert_properties(@node_a2, :section_id => @a.id, :node_type => "Page", :node_id => @a2.id, :position => 1)
|
33
|
-
assert_properties(@node_a3, :section_id => @a.id, :node_type => "Page", :node_id => @a3.id, :position => 3)
|
34
|
-
assert_properties(@node_b1, :section_id => @b.id, :node_type => "Page", :node_id => @b1.id, :position => 1)
|
35
|
-
assert_properties(@node_b2, :section_id => @b.id, :node_type => "Page", :node_id => @b2.id, :position => 2)
|
36
|
-
assert_properties(@node_b3, :section_id => @b.id, :node_type => "Page", :node_id => @b3.id, :position => 3)
|
37
|
-
end
|
38
|
-
def test_move_nodes_to_different_section
|
39
|
-
@node_a2.move_to(@b, 2)
|
40
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
41
|
-
assert_properties(@node_a, :section_id => @parent.id, :node_type => "Section", :node_id => @a.id, :position => 1)
|
42
|
-
assert_properties(@node_b, :section_id => @parent.id, :node_type => "Section", :node_id => @b.id, :position => 2)
|
43
|
-
assert_properties(@node_a1, :section_id => @a.id, :node_type => "Page", :node_id => @a1.id, :position => 1)
|
44
|
-
assert_properties(@node_a2, :section_id => @b.id, :node_type => "Page", :node_id => @a2.id, :position => 2)
|
45
|
-
assert_properties(@node_a3, :section_id => @a.id, :node_type => "Page", :node_id => @a3.id, :position => 2)
|
46
|
-
assert_properties(@node_b1, :section_id => @b.id, :node_type => "Page", :node_id => @b1.id, :position => 1)
|
47
|
-
assert_properties(@node_b2, :section_id => @b.id, :node_type => "Page", :node_id => @b2.id, :position => 3)
|
48
|
-
assert_properties(@node_b3, :section_id => @b.id, :node_type => "Page", :node_id => @b3.id, :position => 4)
|
49
|
-
end
|
50
|
-
def test_move_nodes_to_beginning_of_different_section
|
51
|
-
@node_a2.move_to(@b, 1)
|
52
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
53
|
-
assert_properties(@node_a, :section_id => @parent.id, :node_type => "Section", :node_id => @a.id, :position => 1)
|
54
|
-
assert_properties(@node_b, :section_id => @parent.id, :node_type => "Section", :node_id => @b.id, :position => 2)
|
55
|
-
assert_properties(@node_a1, :section_id => @a.id, :node_type => "Page", :node_id => @a1.id, :position => 1)
|
56
|
-
assert_properties(@node_a2, :section_id => @b.id, :node_type => "Page", :node_id => @a2.id, :position => 1)
|
57
|
-
assert_properties(@node_a3, :section_id => @a.id, :node_type => "Page", :node_id => @a3.id, :position => 2)
|
58
|
-
assert_properties(@node_b1, :section_id => @b.id, :node_type => "Page", :node_id => @b1.id, :position => 2)
|
59
|
-
assert_properties(@node_b2, :section_id => @b.id, :node_type => "Page", :node_id => @b2.id, :position => 3)
|
60
|
-
assert_properties(@node_b3, :section_id => @b.id, :node_type => "Page", :node_id => @b3.id, :position => 4)
|
61
|
-
end
|
62
|
-
def test_move_nodes_to_end_of_different_section
|
63
|
-
@node_a2.move_to(@b, 99)
|
64
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
65
|
-
assert_properties(@node_a, :section_id => @parent.id, :node_type => "Section", :node_id => @a.id, :position => 1)
|
66
|
-
assert_properties(@node_b, :section_id => @parent.id, :node_type => "Section", :node_id => @b.id, :position => 2)
|
67
|
-
assert_properties(@node_a1, :section_id => @a.id, :node_type => "Page", :node_id => @a1.id, :position => 1)
|
68
|
-
assert_properties(@node_a2, :section_id => @b.id, :node_type => "Page", :node_id => @a2.id, :position => 4)
|
69
|
-
assert_properties(@node_a3, :section_id => @a.id, :node_type => "Page", :node_id => @a3.id, :position => 2)
|
70
|
-
assert_properties(@node_b1, :section_id => @b.id, :node_type => "Page", :node_id => @b1.id, :position => 1)
|
71
|
-
assert_properties(@node_b2, :section_id => @b.id, :node_type => "Page", :node_id => @b2.id, :position => 2)
|
72
|
-
assert_properties(@node_b3, :section_id => @b.id, :node_type => "Page", :node_id => @b3.id, :position => 3)
|
73
|
-
end
|
74
|
-
def test_put_page_at_the_bottom_when_section_is_changed
|
75
|
-
@a2.update_attributes(:section_id => @b.id)
|
76
|
-
reset(:node_a, :node_a1, :node_a2, :node_a3, :node_b, :node_b1, :node_b2, :node_b3)
|
77
|
-
assert_properties(@node_a, :section_id => @parent.id, :node_type => "Section", :node_id => @a.id, :position => 1)
|
78
|
-
assert_properties(@node_b, :section_id => @parent.id, :node_type => "Section", :node_id => @b.id, :position => 2)
|
79
|
-
assert_properties(@node_a1, :section_id => @a.id, :node_type => "Page", :node_id => @a1.id, :position => 1)
|
80
|
-
assert_properties(@node_a2, :section_id => @b.id, :node_type => "Page", :node_id => @a2.id, :position => 4)
|
81
|
-
assert_properties(@node_a3, :section_id => @a.id, :node_type => "Page", :node_id => @a3.id, :position => 2)
|
82
|
-
assert_properties(@node_b1, :section_id => @b.id, :node_type => "Page", :node_id => @b1.id, :position => 1)
|
83
|
-
assert_properties(@node_b2, :section_id => @b.id, :node_type => "Page", :node_id => @b2.id, :position => 2)
|
84
|
-
assert_properties(@node_b3, :section_id => @b.id, :node_type => "Page", :node_id => @b3.id, :position => 3)
|
85
|
-
end
|
86
|
-
def test_find_ancestors
|
87
|
-
assert root_section.ancestors.empty?
|
88
|
-
assert_equal [root_section], @parent.ancestors
|
89
|
-
assert_equal [root_section, @parent], @a.ancestors
|
90
|
-
assert_equal [root_section, @parent, @a], @a1.ancestors
|
91
|
-
end
|
92
|
-
end
|