zena 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +80 -25
- data/Rakefile +2 -2
- data/app/controllers/columns_controller.rb +2 -2
- data/app/controllers/nodes_controller.rb +22 -29
- data/app/controllers/user_sessions_controller.rb +35 -10
- data/app/controllers/users_controller.rb +2 -2
- data/app/controllers/versions_controller.rb +2 -2
- data/app/models/group.rb +15 -1
- data/app/models/node.rb +109 -8
- data/app/models/role.rb +4 -0
- data/app/models/site.rb +64 -58
- data/app/models/template.rb +1 -1
- data/app/models/user.rb +135 -29
- data/app/models/user_session.rb +0 -1
- data/app/models/virtual_class.rb +11 -6
- data/app/views/columns/_form.html.erb +3 -1
- data/app/views/columns/_li.html.erb +1 -1
- data/app/views/columns/create.rjs +1 -1
- data/app/views/groups/_form.rhtml +16 -13
- data/app/views/relations/_form.erb +18 -6
- data/app/views/sites/_form.erb +12 -6
- data/app/views/users/_form.rhtml +23 -8
- data/app/views/users/_li.rhtml +14 -3
- data/app/views/users/index.rhtml +1 -1
- data/app/views/virtual_classes/_form.erb +12 -2
- data/app/views/zafu/default/Node-+login.zafu +8 -1
- data/app/views/zafu/default/Node-+search.zafu +1 -1
- data/bricks/acls/lib/bricks/acls.rb +1 -0
- data/bricks/acls/zena/migrate/20130903150356_longer_names_for_acl.rb +9 -0
- data/bricks/acls/zena/test/integration/acl_integration_test.rb +2 -2
- data/bricks/currency/lib/bricks/currency.rb +120 -0
- data/bricks/currency/zena/test/unit/currency_test.rb +43 -0
- data/bricks/fs_skin/lib/bricks/fs_skin.rb +1 -1
- data/bricks/fs_skin/zena/skins/blog/Node-+search.zafu +1 -1
- data/bricks/fs_skin/zena/skins/blog/Node.zafu +1 -1
- data/bricks/fs_skin/zena/test/unit/fs_skin_view_test.rb +35 -0
- data/bricks/pdf/lib/bricks/pdf.rb +1 -1
- data/bricks/sphinx/lib/bricks/sphinx.rb +2 -0
- data/bricks/sphinx/zena/init.rb +14 -0
- data/bricks/tags/zena/test/zafu/tags.yml +5 -1
- data/bricks/worker/lib/bricks/worker.rb +3 -2
- data/bricks/zena/zena/migrate/20130829093753_add_versioned_flag_to_column.rb +10 -0
- data/bricks/zena/zena/migrate/20130903084909_count_login_attempts.rb +11 -0
- data/bricks/zena/zena/migrate/20131104153126_index_fullpath.rb +10 -0
- data/bricks/zena/zena/migrate/20131104210011_rebuild_fullpath_after_change.rb +10 -0
- data/bricks/zena/zena/migrate/20131105160420_add_skin_id_to_sites.rb +9 -0
- data/bricks/zena/zena/migrate/20131105175822_add_profile_to_users.rb +11 -0
- data/bricks/zena/zena/migrate/20140213120038_fix_idx_scope.rb +13 -0
- data/bricks/zena/zena/migrate/20140628140247_add_site_readonly.rb +9 -0
- data/config/bricks.yml +8 -4
- data/config/gems.yml +5 -3
- data/db/init/base/skins/default/Node-+login.zafu +8 -1
- data/db/init/base/skins/default/Node-+search.zafu +1 -1
- data/lib/bricks/loader.rb +5 -5
- data/lib/gettext_strings.rb +3 -0
- data/lib/tasks/zena.rake +25 -22
- data/lib/zafu/process/context.rb +4 -0
- data/lib/zena/acts/secure_node.rb +3 -3
- data/lib/zena/app.rb +1 -0
- data/lib/zena/deploy.rb +1 -1
- data/lib/zena/deploy/template.rb +1 -1
- data/lib/zena/foxy_parser.rb +5 -2
- data/lib/zena/info.rb +1 -1
- data/lib/zena/site_worker.rb +2 -2
- data/lib/zena/test_controller.rb +5 -2
- data/lib/zena/use/action.rb +9 -2
- data/lib/zena/use/ajax.rb +20 -4
- data/lib/zena/use/ancestry.rb +89 -15
- data/lib/zena/use/authlogic.rb +8 -2
- data/lib/zena/use/context.rb +1 -0
- data/lib/zena/use/display.rb +1 -97
- data/lib/zena/use/forms.rb +28 -8
- data/lib/zena/use/html_tags.rb +16 -7
- data/lib/zena/use/i18n.rb +1 -1
- data/lib/zena/use/prop_eval.rb +6 -1
- data/lib/zena/use/query_node.rb +69 -4
- data/lib/zena/use/recursion.rb +1 -1
- data/lib/zena/use/refactor.rb +5 -2
- data/lib/zena/use/relations.rb +1 -0
- data/lib/zena/use/rendering.rb +7 -4
- data/lib/zena/use/test_helper.rb +8 -4
- data/lib/zena/use/upload.rb +14 -0
- data/lib/zena/use/urls.rb +39 -23
- data/lib/zena/use/version_hash.rb +5 -2
- data/lib/zena/use/workflow.rb +116 -70
- data/lib/zena/use/zafu_eval.rb +41 -0
- data/lib/zena/use/zafu_safe_definitions.rb +1 -0
- data/lib/zena/use/zafu_templates.rb +32 -26
- data/lib/zena/use/zazen.rb +8 -7
- data/locale/app.pot +5 -1
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +385 -281
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.po +378 -271
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.po +387 -272
- data/locale/it/LC_MESSAGES/zena.mo +0 -0
- data/locale/it/zena.po +433 -404
- data/locale/zena.pot +362 -268
- data/public/javascripts/grid.js +280 -104
- data/public/javascripts/zena.js +43 -15
- data/public/stylesheets/admin.css +8 -2
- data/public/stylesheets/grid.css +5 -2
- data/public/stylesheets/popup.css +1 -1
- data/test/fixtures/files/TestNode.zafu +51 -0
- data/test/functional/nodes_controller_test.rb +20 -5
- data/test/functional/user_sessions_controller_test.rb +41 -6
- data/test/functional/users_controller_test.rb +1 -2
- data/test/integration/navigation_test.rb +22 -4
- data/test/integration/query_node/basic.yml +7 -0
- data/test/integration/query_node/complex.yml +1 -1
- data/test/integration/query_node/errors.yml +1 -1
- data/test/integration/query_node/filters.yml +34 -1
- data/test/integration/query_node/relations.yml +6 -13
- data/test/integration/query_node_test.rb +22 -3
- data/test/integration/zafu_compiler/action.yml +1 -1
- data/test/integration/zafu_compiler/alias_site.yml +52 -0
- data/test/integration/zafu_compiler/complex.yml +1 -1
- data/test/integration/zafu_compiler/complex_ok.yml +5 -5
- data/test/integration/zafu_compiler/context.yml +1 -1
- data/test/integration/zafu_compiler/display.yml +56 -5
- data/test/integration/zafu_compiler/forms.yml +35 -2
- data/test/integration/zafu_compiler/meta.yml +4 -0
- data/test/integration/zafu_compiler/rubyless.yml +1 -1
- data/test/integration/zafu_compiler/safe_definitions.yml +4 -0
- data/test/integration/zafu_compiler/security.yml +10 -0
- data/test/integration/zafu_compiler/site.yml +5 -1
- data/test/integration/zafu_compiler/urls.yml +8 -2
- data/test/integration/zafu_compiler/zafu_attributes.yml +2 -1
- data/test/integration/zafu_compiler/zazen.yml +4 -0
- data/test/integration/zafu_compiler_test.rb +47 -4
- data/test/selenium/Grid/grid1.rsel +8 -8
- data/test/sites/complex/sites.yml +2 -2
- data/test/sites/complex/users.yml +1 -0
- data/test/sites/zena/columns.yml +4 -0
- data/test/sites/zena/sites.yml +1 -0
- data/test/sites/zena/users.yml +1 -0
- data/test/unit/node_test.rb +53 -5
- data/test/unit/note_test.rb +1 -1
- data/test/unit/relation_proxy_test.rb +20 -0
- data/test/unit/role_test.rb +2 -0
- data/test/unit/site_test.rb +28 -6
- data/test/unit/user_test.rb +332 -1
- data/test/unit/virtual_class_test.rb +55 -0
- data/test/unit/workflow_test.rb +175 -0
- data/test/unit/zena/use/ancestry_test.rb +52 -10
- data/test/unit/zena/use/prop_eval_test.rb +44 -0
- data/test/unit/zena/use/rendering_test.rb +48 -2
- data/test/unit/zena/use/upload_test.rb +15 -13
- data/test/unit/zena/use/urls_test.rb +1 -0
- data/vendor/plugins/ar_mysql_full_text/lib/ar_mysql_full_text.rb +39 -25
- data/zena.gemspec +69 -307
- metadata +143 -368
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run 2.tmCommand +0 -24
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Context.tmCommand +0 -58
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Focused Should.tmCommand +0 -88
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run.tmCommand +0 -27
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/YAML to Shoulda.tmCommand +0 -23
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Context.tmPreferences +0 -19
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Should.tmPreferences +0 -19
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory attributes for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory build.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define with class.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_next.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_sequence.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_bad_value.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_contains.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_does_not_contain.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_good_value.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_same_elements.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_save.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_sent_email.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_valid.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/association.tmSnippet +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/attribute.tmSnippet +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/before_should block.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block get.tmSnippet +0 -22
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block post.tmSnippet +0 -23
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block with setup.tmSnippet +0 -25
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/setup.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block with before proc.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_allow_values_for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_assign_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful denied.tmSnippet +0 -20
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful.tmSnippet +0 -20
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_belong_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change by.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change from to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_at_least.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_in_range.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_is.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_value_in_range.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_eventually.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_filter_params.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_and_belong_to_many.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_class_methods.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_column.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_columns.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_index.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_indices.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_instance_methods.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_many.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_named_scope.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_one.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_readonly_attributes.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_mass_assignment_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_values_for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_assign_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_change.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_set_the_flash.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_redirect_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_a_form.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_template.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_with_layout.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_without_layout.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with_content_type.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_return_from_session.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_route.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_set_the_flash_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_acceptance_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_numericality_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_presence_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of with scope.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/run_script.rb +0 -104
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/test.rb +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/todo.txt +0 -13
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/bin/yaml_to_shoulda.rb +0 -25
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Syntaxes/Ruby on Rails (Shoulda).tmLanguage +0 -166
- data/vendor/TextMate/Ruby Shoulda.tmbundle/info.plist +0 -304
- data/vendor/TextMate/Zena.tmbundle/Commands/Run all yaml tests.tmCommand +0 -37
- data/vendor/TextMate/Zena.tmbundle/Commands/Run focused yaml test.tmCommand +0 -52
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/run_script.rb +0 -118
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
- data/vendor/TextMate/Zena.tmbundle/info.plist +0 -17
- data/vendor/plugins/selenium-on-rails/CHANGELOG +0 -125
- data/vendor/plugins/selenium-on-rails/LICENSE-2.0.txt +0 -202
- data/vendor/plugins/selenium-on-rails/README.md +0 -202
- data/vendor/plugins/selenium-on-rails/Rakefile +0 -38
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html +0 -265
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html +0 -148
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html +0 -126
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html +0 -231
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html +0 -195
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html +0 -295
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html +0 -219
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html +0 -156
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html +0 -179
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html +0 -223
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html +0 -441
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html +0 -3098
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html +0 -2080
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserAccessors.html +0 -116
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserActions.html +0 -116
- data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html +0 -150
- data/vendor/plugins/selenium-on-rails/doc/files/CHANGELOG.html +0 -422
- data/vendor/plugins/selenium-on-rails/doc/files/README.html +0 -321
- data/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html +0 -108
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html +0 -101
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html +0 -222
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html +0 -109
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html +0 -111
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html +0 -101
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html +0 -101
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html +0 -118
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html +0 -101
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html +0 -101
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html +0 -114
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html +0 -113
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html +0 -120
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html +0 -108
- data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html +0 -115
- data/vendor/plugins/selenium-on-rails/doc/fr_class_index.html +0 -42
- data/vendor/plugins/selenium-on-rails/doc/fr_file_index.html +0 -43
- data/vendor/plugins/selenium-on-rails/doc/fr_method_index.html +0 -182
- data/vendor/plugins/selenium-on-rails/doc/index.html +0 -24
- data/vendor/plugins/selenium-on-rails/doc/rdoc-style.css +0 -208
- data/vendor/plugins/selenium-on-rails/generators/selenium/USAGE +0 -19
- data/vendor/plugins/selenium-on-rails/generators/selenium/selenium_generator.rb +0 -50
- data/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml +0 -16
- data/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml +0 -14
- data/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml +0 -11
- data/vendor/plugins/selenium-on-rails/init.rb +0 -15
- data/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb +0 -122
- data/vendor/plugins/selenium-on-rails/lib/controllers/switch_environment_controller.rb +0 -16
- data/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb +0 -8
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb +0 -11
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb +0 -215
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb +0 -57
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb +0 -36
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb +0 -61
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb +0 -20
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb +0 -44
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb +0 -87
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb +0 -56
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb +0 -116
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb +0 -1002
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb +0 -514
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_accessors.rb.example +0 -91
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_actions.rb.example +0 -24
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb +0 -30
- data/vendor/plugins/selenium-on-rails/lib/views/layouts/layout.rhtml +0 -18
- data/vendor/plugins/selenium-on-rails/lib/views/record.rhtml +0 -5
- data/vendor/plugins/selenium-on-rails/lib/views/selenium_helper.rb +0 -9
- data/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml +0 -67
- data/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml +0 -26
- data/vendor/plugins/selenium-on-rails/routes.rb +0 -24
- data/vendor/plugins/selenium-on-rails/selenium-core/Blank.html +0 -7
- data/vendor/plugins/selenium-on-rails/selenium-core/InjectedRemoteRunner.html +0 -8
- data/vendor/plugins/selenium-on-rails/selenium-core/RemoteRunner.html +0 -110
- data/vendor/plugins/selenium-on-rails/selenium-core/SeleniumLog.html +0 -109
- data/vendor/plugins/selenium-on-rails/selenium-core/TestPrompt.html +0 -145
- data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner-splash.html +0 -55
- data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.hta +0 -177
- data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.html +0 -177
- data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butmin.gif +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butplus.gif +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.css +0 -298
- data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.html +0 -16
- data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/selenium-domviewer.js +0 -205
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/all.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/continue.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/continue_disabled.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/pause.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/pause_disabled.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/selected.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/step.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/icons/step_disabled.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/iedoc-core.xml +0 -1759
- data/vendor/plugins/selenium-on-rails/selenium-core/iedoc.xml +0 -1800
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/cssQuery-p.js +0 -6
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level2.js +0 -142
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level3.js +0 -150
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-standard.js +0 -53
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery.js +0 -356
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/prototype.js +0 -2006
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/builder.js +0 -101
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/controls.js +0 -815
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/dragdrop.js +0 -915
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/effects.js +0 -958
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/scriptaculous.js +0 -47
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/slider.js +0 -283
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/unittest.js +0 -383
- data/vendor/plugins/selenium-on-rails/selenium-core/lib/snapsie.js +0 -91
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/find_matching_child.js +0 -69
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/htmlutils.js +0 -1616
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/injection.html +0 -72
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-api.js +0 -3184
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserbot.js +0 -2300
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserdetect.js +0 -153
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-commandhandlers.js +0 -377
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-executionloop.js +0 -175
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-logging.js +0 -148
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-remoterunner.js +0 -695
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-testrunner.js +0 -1362
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-version.js +0 -5
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-doc.html +0 -803
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-element.js +0 -1537
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-map-sample.js +0 -979
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js +0 -3
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js.sample +0 -75
- data/vendor/plugins/selenium-on-rails/selenium-core/scripts/xmlextras.js +0 -153
- data/vendor/plugins/selenium-on-rails/selenium-core/selenium-logo.png +0 -0
- data/vendor/plugins/selenium-on-rails/selenium-core/selenium-test.css +0 -43
- data/vendor/plugins/selenium-on-rails/selenium-core/selenium.css +0 -316
- data/vendor/plugins/selenium-on-rails/selenium-core/xpath/dom.js +0 -566
- data/vendor/plugins/selenium-on-rails/selenium-core/xpath/javascript-xpath-0.1.11.js +0 -2816
- data/vendor/plugins/selenium-on-rails/selenium-core/xpath/util.js +0 -549
- data/vendor/plugins/selenium-on-rails/selenium-core/xpath/xmltoken.js +0 -149
- data/vendor/plugins/selenium-on-rails/selenium-core/xpath/xpath.js +0 -2450
- data/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake +0 -8
- data/vendor/plugins/selenium-on-rails/test/fixtures/config.yml +0 -37
- data/vendor/plugins/selenium-on-rails/test/fixtures/selenium.yml +0 -27
- data/vendor/plugins/selenium-on-rails/test/paths_test.rb +0 -72
- data/vendor/plugins/selenium-on-rails/test/renderer_test.rb +0 -157
- data/vendor/plugins/selenium-on-rails/test/rselenese_test.rb +0 -708
- data/vendor/plugins/selenium-on-rails/test/selenese_test.rb +0 -242
- data/vendor/plugins/selenium-on-rails/test/selenium_controller_test.rb +0 -67
- data/vendor/plugins/selenium-on-rails/test/selenium_on_rails_config_test.rb +0 -43
- data/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb +0 -35
- data/vendor/plugins/selenium-on-rails/test/setup_test.rb +0 -31
- data/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb +0 -109
- data/vendor/plugins/selenium-on-rails/test/switch_environment_controller_test.rb +0 -17
- data/vendor/plugins/selenium-on-rails/test/test_builder_functions_authortest.rb +0 -51
- data/vendor/plugins/selenium-on-rails/test/test_helper.rb +0 -101
- data/vendor/plugins/selenium-on-rails/test_data/_partial.rsel +0 -1
- data/vendor/plugins/selenium-on-rails/test_data/own_layout.html +0 -12
- data/vendor/plugins/selenium-on-rails/test_data/partials/_html.html +0 -6
- data/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel +0 -2
- data/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml +0 -6
- data/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel +0 -1
- data/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel +0 -5
- data/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel +0 -5
- data/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml +0 -7
- data/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel +0 -8
- data/vendor/plugins/selenium-on-rails/test_data/selenese.sel +0 -7
- data/vendor/plugins/selenium-on-rails/test_data/suite_one/subsuite/suite_one_subsuite_testcase.sel +0 -1
- data/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase1.sel +0 -1
- data/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase2.sel +0 -1
- data/vendor/plugins/selenium-on-rails/test_data/suite_two/suite_two_testcase.sel +0 -1
@@ -163,7 +163,8 @@ show_attr_anchor:
|
|
163
163
|
res: "<a class='anchor' name='node22'></a>status title"
|
164
164
|
|
165
165
|
anchor_in_link:
|
166
|
-
|
166
|
+
old_src: "<r:link class='xx' anchor='true'/>"
|
167
|
+
src: "<a class='xx' href='#node#{id}' do='title'/>"
|
167
168
|
res: "<a class='xx' href='#node22'>status title</a>"
|
168
169
|
|
169
170
|
anchor_tag:
|
@@ -15,6 +15,10 @@ link_anchor:
|
|
15
15
|
tem: "<%= zazen('see \"\":22#') %>"
|
16
16
|
res: "<p>see <a href=\"#node22\">status title</a></p>"
|
17
17
|
|
18
|
+
link_anchor_remote:
|
19
|
+
tem: "<%= zazen('see \"\":18#foo') %>"
|
20
|
+
res: "<p>see <a href=\"/oo/page18.html#foo\">projects list</a></p>"
|
21
|
+
|
18
22
|
link_anchor_attribute:
|
19
23
|
tem: "<%= zazen('see \"\":22#[title]') %>"
|
20
24
|
res: "<p>see <a href=\"#status-title\">status title</a></p>"
|
@@ -5,6 +5,7 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
5
5
|
OK = [
|
6
6
|
'action',
|
7
7
|
'asset',
|
8
|
+
'alias_site',
|
8
9
|
'conditional',
|
9
10
|
'calendar',
|
10
11
|
'dates',
|
@@ -98,18 +99,19 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
98
99
|
end
|
99
100
|
|
100
101
|
context = yt_get('context', file, test)
|
101
|
-
site = Site.setup_master(
|
102
|
-
|
102
|
+
site = Site.setup_master(Site.find_by_host(context.delete('host') || 'test.host'))
|
103
|
+
# This is used to find fixtures: returns master name (not alias)
|
104
|
+
$_test_site = site.name
|
103
105
|
@request.host = site.host
|
104
106
|
|
105
107
|
# set context
|
106
108
|
params = {}
|
107
109
|
#params[:user_id] = users_id(context.delete('visitor').to_sym)
|
108
|
-
params['user']
|
110
|
+
params['user'] = context.delete 'visitor'
|
109
111
|
params['node_id'] = nodes_id(context.delete('node').to_sym)
|
110
112
|
params['prefix'] = context.delete('lang')
|
111
113
|
params['date'] = context['ref_date'] ? context.delete('ref_date').to_s : nil
|
112
|
-
params['url']
|
114
|
+
params['url'] = "#{file}/#{test.to_s.gsub('_', '/')}"
|
113
115
|
params.merge!(context) # merge the rest of the context as query parameters
|
114
116
|
|
115
117
|
compiled_files = {}
|
@@ -381,5 +383,46 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
381
383
|
yt_do_test('display', 'with_a_custom_img_tag_field_with_JS')
|
382
384
|
end
|
383
385
|
|
386
|
+
def test_alias_site_from_home
|
387
|
+
login(:lion)
|
388
|
+
node = secure(Page) { Page.create(:title => 'one', :parent_id => nodes_id(:wiki))}
|
389
|
+
sub = secure(Page) { Page.create(:title => 'two', :parent_id => node.id)}
|
390
|
+
secure(Page) { Page.create(:title => 'three', :parent_id => sub.id)}
|
391
|
+
yt_do_test('alias_site', 'from_home')
|
392
|
+
end
|
393
|
+
|
394
|
+
def test_alias_site_in_home
|
395
|
+
login(:lion)
|
396
|
+
node = secure(Page) { Page.create(:title => 'one', :parent_id => nodes_id(:wiki))}
|
397
|
+
sub = secure(Page) { Page.create(:title => 'two', :parent_id => node.id)}
|
398
|
+
secure(Page) { Page.create(:title => 'three', :parent_id => sub.id)}
|
399
|
+
yt_do_test('alias_site', 'in_home')
|
400
|
+
end
|
401
|
+
|
402
|
+
def test_alias_site_link_with_custom_base
|
403
|
+
login(:lion)
|
404
|
+
secure(Node) { nodes(:wiki) }.tap do |w|
|
405
|
+
w.update_attributes(:custom_base => true)
|
406
|
+
err w
|
407
|
+
end
|
408
|
+
node = secure(Page) { Page.create(:title => 'one', :parent_id => nodes_id(:wiki), :custom_base => true)}
|
409
|
+
sub = secure(Page) { Page.create(:title => 'two', :parent_id => node.id)}
|
410
|
+
secure(Page) { Page.create(:title => 'three', :parent_id => sub.id)}
|
411
|
+
yt_do_test('alias_site', 'link_with_custom_base')
|
412
|
+
end
|
413
|
+
|
414
|
+
def test_forms_auth_profile
|
415
|
+
login(:lion)
|
416
|
+
tiger = users(:tiger)
|
417
|
+
assert tiger.update_attributes(:profile => :ant)
|
418
|
+
yt_do_test('forms', 'auth_profile')
|
419
|
+
end
|
420
|
+
|
421
|
+
def test_site_readonly
|
422
|
+
login(:lion)
|
423
|
+
current_site.update_attributes("site_readonly" => true)
|
424
|
+
yt_do_test('site', 'readonly')
|
425
|
+
end
|
426
|
+
|
384
427
|
yt_make
|
385
428
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# Add first element
|
2
2
|
open '/oo/testnode37.html?test=grid1'
|
3
|
-
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
#
|
10
|
-
# verify_text '
|
3
|
+
wait_for_text_present('grid setup done')
|
4
|
+
verify_text "//table[@class='grid']/tbody/tr[2]/th", 'type to edit'
|
5
|
+
# Change title
|
6
|
+
click "//table[@class='grid']/tbody/tr[3]/td"
|
7
|
+
type "//table[@class='grid']/tbody/tr[3]/td", 'some value'
|
8
|
+
click 'css=#grid1 input[type="submit"]'
|
9
|
+
# THIS DOES NOT WORK. CANNOT TYPE IN CONTENTEDITABLE.
|
10
|
+
# verify_text "//table[@class='grid']/tbody/tr[3]/td", 'some value'
|
11
11
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
complex:
|
2
2
|
host: complex.host
|
3
3
|
root: complex
|
4
|
-
anon:
|
4
|
+
anon: complex_anon
|
5
5
|
public_group: public
|
6
6
|
site_group: complex
|
7
7
|
authentication: yes
|
@@ -9,4 +9,4 @@ complex:
|
|
9
9
|
redit_time: 7200
|
10
10
|
languages: fr
|
11
11
|
default_lang: fr
|
12
|
-
formats_updated_at: 2003-02-01
|
12
|
+
formats_updated_at: 2003-02-01
|
data/test/sites/zena/columns.yml
CHANGED
data/test/sites/zena/sites.yml
CHANGED
data/test/sites/zena/users.yml
CHANGED
data/test/unit/node_test.rb
CHANGED
@@ -155,6 +155,25 @@ class NodeTest < Zena::Unit::TestCase
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
+
context 'destroying a node with failing before_destroy' do
|
159
|
+
::Page.send(:before_destroy, :test_before_destroy)
|
160
|
+
class ::Page
|
161
|
+
attr_accessor :fail_on_destroy
|
162
|
+
def test_before_destroy
|
163
|
+
return false if @fail_on_destroy
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
should 'not touch node versions' do
|
168
|
+
node = secure(Node) { nodes(:status) }
|
169
|
+
node.fail_on_destroy = true
|
170
|
+
assert_difference('Node.count', 0) do
|
171
|
+
assert_difference('Version.count', 0) do
|
172
|
+
node.destroy
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
158
177
|
end # on a node with write access
|
159
178
|
end # A logged in user
|
160
179
|
|
@@ -199,11 +218,12 @@ class NodeTest < Zena::Unit::TestCase
|
|
199
218
|
assert node.save , "Save succeeds"
|
200
219
|
end
|
201
220
|
|
202
|
-
def
|
221
|
+
def test_node_new_without_title
|
203
222
|
login(:tiger)
|
204
223
|
node = secure!(Node) { Node.new(:parent_id => nodes_id(:cleanWater)) }
|
205
|
-
|
206
|
-
|
224
|
+
node.save
|
225
|
+
assert !node.new_record?, 'Not a new record'
|
226
|
+
assert_equal 'Node', node.title
|
207
227
|
end
|
208
228
|
|
209
229
|
def test_new_set_section_id
|
@@ -247,12 +267,25 @@ class NodeTest < Zena::Unit::TestCase
|
|
247
267
|
assert node.save , "Save succeeds"
|
248
268
|
end
|
249
269
|
|
270
|
+
def test_set_hash_attribute
|
271
|
+
login(:lion)
|
272
|
+
node = secure!(Node) { nodes(:lake) }
|
273
|
+
assert node.update_attributes(:'cart' => {'foo' => 'hello', 'bar' => 'bye'})
|
274
|
+
ant = secure!(Node) { nodes(:ant) }
|
275
|
+
ant.cart = node.cart
|
276
|
+
assert ant.save
|
277
|
+
# reload
|
278
|
+
ant = secure!(Node) { nodes(:ant) }
|
279
|
+
assert_equal 'hello', ant.cart['foo']
|
280
|
+
assert_equal 'bye', ant.cart['bar']
|
281
|
+
end
|
282
|
+
|
250
283
|
def test_page_update_without_title
|
251
284
|
login(:tiger)
|
252
285
|
node = secure!(Node) { nodes(:status) }
|
253
286
|
node.title = nil
|
254
|
-
assert
|
255
|
-
assert_equal '
|
287
|
+
assert node.save
|
288
|
+
assert_equal 'Page', node.title
|
256
289
|
end
|
257
290
|
|
258
291
|
def test_update_set_section_id
|
@@ -1488,4 +1521,19 @@ done: \"I am done\""
|
|
1488
1521
|
assert_equal nodes_zip(:status).to_s, node.safe_send("id")
|
1489
1522
|
assert_equal nil, node.safe_send("object_id")
|
1490
1523
|
end
|
1524
|
+
|
1525
|
+
context 'a node with invalid properties' do
|
1526
|
+
setup do
|
1527
|
+
version = secure(Node) { nodes(:status) }.version
|
1528
|
+
Zena::Db.set_attribute(version, 'properties', '{"foo":')
|
1529
|
+
end
|
1530
|
+
|
1531
|
+
subject do
|
1532
|
+
secure(Node) { nodes(:status) }
|
1533
|
+
end
|
1534
|
+
|
1535
|
+
should 'return the failover property value' do
|
1536
|
+
assert_equal 'INVALID PROPERTY', subject.title
|
1537
|
+
end
|
1538
|
+
end
|
1491
1539
|
end
|
data/test/unit/note_test.rb
CHANGED
@@ -7,7 +7,7 @@ class NoteTest < Zena::Unit::TestCase
|
|
7
7
|
test_page = secure!(Note) { Note.create(:title => "yoba", :parent_id => nodes_id(:cleanWater), :inherit=>1 ) }
|
8
8
|
assert ! test_page.new_record? , "Not a new record"
|
9
9
|
assert_equal nodes_id(:cleanWater), test_page.parent[:id]
|
10
|
-
assert_equal "18/21/#{test_page.zip}", test_page.fullpath
|
10
|
+
assert_equal "11/18/21/#{test_page.zip}", test_page.fullpath
|
11
11
|
assert_equal '18/21', test_page.basepath
|
12
12
|
end
|
13
13
|
|
@@ -601,4 +601,24 @@ class RelationProxyTest < Zena::Unit::TestCase
|
|
601
601
|
end
|
602
602
|
end
|
603
603
|
end # With many links
|
604
|
+
|
605
|
+
context 'with a native writer' do
|
606
|
+
subject do
|
607
|
+
node = secure(Node) { nodes(:cleanWater)}
|
608
|
+
class << node
|
609
|
+
def reference_zips=(list)
|
610
|
+
@list=list
|
611
|
+
end
|
612
|
+
end
|
613
|
+
node
|
614
|
+
end
|
615
|
+
|
616
|
+
should 'update with string list of ids' do
|
617
|
+
login(:lion)
|
618
|
+
assert_difference('Link.count', 0) do
|
619
|
+
subject.update_attributes_with_transformation('reference_ids' => [:art, :menu, :bird_jpg].map {|s| nodes_zip(s)}.join(', '))
|
620
|
+
assert_equal '30,33,35', subject.instance_variable_get(:@list).sort.join(',')
|
621
|
+
end
|
622
|
+
end
|
623
|
+
end
|
604
624
|
end
|
data/test/unit/role_test.rb
CHANGED
data/test/unit/site_test.rb
CHANGED
@@ -289,19 +289,19 @@ class SiteTest < Zena::Unit::TestCase
|
|
289
289
|
opening = secure(Node) { nodes(:opening) }
|
290
290
|
cleanWater = secure(Node) { nodes(:cleanWater) }
|
291
291
|
art = secure(Node) { nodes(:art) }
|
292
|
-
assert_equal fullpath(:projects, :cleanWater, :status), status.fullpath
|
292
|
+
assert_equal fullpath(:zena, :projects, :cleanWater, :status), status.fullpath
|
293
293
|
assert_equal fullpath(:projects, :cleanWater), status.basepath
|
294
294
|
assert_equal false, status.custom_base
|
295
295
|
|
296
|
-
assert_equal fullpath(:projects, :cleanWater, :opening), opening.fullpath
|
296
|
+
assert_equal fullpath(:zena, :projects, :cleanWater, :opening), opening.fullpath
|
297
297
|
assert_equal fullpath(:projects, :cleanWater), opening.basepath
|
298
298
|
assert_equal false, opening.custom_base
|
299
299
|
|
300
|
-
assert_equal fullpath(:projects, :cleanWater), cleanWater.fullpath
|
300
|
+
assert_equal fullpath(:zena, :projects, :cleanWater), cleanWater.fullpath
|
301
301
|
assert_equal fullpath(:projects, :cleanWater), cleanWater.basepath
|
302
302
|
assert_equal true, cleanWater.custom_base
|
303
303
|
|
304
|
-
assert_equal fullpath(:collections, :art), art.fullpath
|
304
|
+
assert_equal fullpath(:zena, :collections, :art), art.fullpath
|
305
305
|
assert_equal '', art.basepath
|
306
306
|
assert_equal false, art.custom_base
|
307
307
|
end
|
@@ -317,10 +317,10 @@ class SiteTest < Zena::Unit::TestCase
|
|
317
317
|
|
318
318
|
should 'not alter fullpath' do
|
319
319
|
node = secure!(Node) { nodes(:status) }
|
320
|
-
assert_equal fullpath(:projects, :cleanWater, :status), node.fullpath
|
320
|
+
assert_equal fullpath(:zena, :projects, :cleanWater, :status), node.fullpath
|
321
321
|
subject.clear_cache
|
322
322
|
node = secure!(Node) { nodes(:status) }
|
323
|
-
assert_equal fullpath(:projects, :cleanWater, :status), node.fullpath
|
323
|
+
assert_equal fullpath(:zena, :projects, :cleanWater, :status), node.fullpath
|
324
324
|
end
|
325
325
|
end
|
326
326
|
|
@@ -406,6 +406,10 @@ class SiteTest < Zena::Unit::TestCase
|
|
406
406
|
should 'return alias home node' do
|
407
407
|
assert_equal nodes_id(:wiki), subject.home_id
|
408
408
|
end
|
409
|
+
|
410
|
+
should 'return alias skin node' do
|
411
|
+
assert_equal nodes_id(:wikiSkin), subject.skin_id
|
412
|
+
end
|
409
413
|
end
|
410
414
|
|
411
415
|
context 'Creating a site alias' do
|
@@ -434,6 +438,24 @@ class SiteTest < Zena::Unit::TestCase
|
|
434
438
|
end
|
435
439
|
end
|
436
440
|
|
441
|
+
context 'Editing a site alias skin' do
|
442
|
+
subject do
|
443
|
+
secure(Site) { sites(:alias) }
|
444
|
+
end
|
445
|
+
|
446
|
+
should 'allow setting skin' do
|
447
|
+
assert_equal nodes_id(:wikiSkin), subject.skin_id
|
448
|
+
assert subject.update_attributes(:skin_zip => nodes_zip(:default))
|
449
|
+
assert_equal nodes_id(:default), sites(:alias).skin.id
|
450
|
+
end
|
451
|
+
|
452
|
+
should 'allow setting skin to nil' do
|
453
|
+
assert_equal nodes_id(:wikiSkin), subject.skin_id
|
454
|
+
assert subject.update_attributes(:skin_zip => '')
|
455
|
+
assert_nil sites(:alias).skin_id
|
456
|
+
end
|
457
|
+
end
|
458
|
+
|
437
459
|
private
|
438
460
|
def fullpath(*args)
|
439
461
|
args.map {|sym| nodes_zip(sym).to_s}.join('/')
|
data/test/unit/user_test.rb
CHANGED
@@ -296,7 +296,7 @@ class UserTest < Zena::Unit::TestCase
|
|
296
296
|
login(:lion)
|
297
297
|
user = secure!(User) { users(:lion) }
|
298
298
|
assert !user.update_attributes(:status => User::Status[:user])
|
299
|
-
assert_equal 'You
|
299
|
+
assert_equal 'You cannot remove your own access rights.', user.errors[:status]
|
300
300
|
user = secure!(User) { users(:lion) }
|
301
301
|
assert user.update_attributes('status' => User::Status[:admin].to_s, 'time_zone' => 'Europe/Berlin')
|
302
302
|
end
|
@@ -468,4 +468,335 @@ class UserTest < Zena::Unit::TestCase
|
|
468
468
|
assert subject.api_authorized?
|
469
469
|
end
|
470
470
|
end # A user in the api_group
|
471
|
+
|
472
|
+
context 'Setting user profile' do
|
473
|
+
setup do
|
474
|
+
login(:lion)
|
475
|
+
secure(User) { users(:ant) }.update_attributes(:group_ids => [groups_id(:admin)])
|
476
|
+
end
|
477
|
+
|
478
|
+
subject do
|
479
|
+
secure(User) { User.create(:login => 'foobar', :password => 'foobar', :status => User::Status[:deleted]) }
|
480
|
+
end
|
481
|
+
|
482
|
+
should 'copy groups' do
|
483
|
+
assert_equal %w{public workers}, subject.groups.map(&:name).sort
|
484
|
+
assert subject.update_attributes(:profile => 'ant')
|
485
|
+
assert_equal %w{admin public workers}, subject.groups.map(&:name).sort
|
486
|
+
end
|
487
|
+
|
488
|
+
context 'changing profile' do
|
489
|
+
setup do
|
490
|
+
subject.update_attributes(:profile => 'ant')
|
491
|
+
end
|
492
|
+
|
493
|
+
should 'sync groups in dependant users' do
|
494
|
+
assert_equal %w{admin public workers}, subject.groups.map(&:name).sort
|
495
|
+
|
496
|
+
assert secure(User) { users(:ant) }.update_attributes(:group_ids => [])
|
497
|
+
# reload
|
498
|
+
user = User.find(subject.id)
|
499
|
+
assert_equal %w{public workers}, user.groups.map(&:name).sort
|
500
|
+
end
|
501
|
+
|
502
|
+
should 'sync status in dependant users' do
|
503
|
+
assert_equal %w{admin public workers}, subject.groups.map(&:name).sort
|
504
|
+
|
505
|
+
assert secure(User) { users(:ant) }.update_attributes(:status => User::Status[:deleted])
|
506
|
+
# reload
|
507
|
+
user = User.find(subject.id)
|
508
|
+
assert_equal User::Status[:deleted], user.status
|
509
|
+
end
|
510
|
+
|
511
|
+
context 'through group edit' do
|
512
|
+
should 'sync groups in dependant users' do
|
513
|
+
assert_equal %w{admin public workers}, subject.groups.map(&:name).sort
|
514
|
+
grp = secure(Group) { groups(:admin) }
|
515
|
+
assert grp.update_attributes(:user_ids => [])
|
516
|
+
# Remove user
|
517
|
+
# reload
|
518
|
+
user = User.find(subject.id)
|
519
|
+
assert_equal %w{public workers}, user.groups.map(&:name).sort
|
520
|
+
|
521
|
+
assert grp.update_attributes(:user_ids => [users_id(:ant)])
|
522
|
+
# Add user
|
523
|
+
# reload
|
524
|
+
user = User.find(subject.id)
|
525
|
+
assert_equal %w{admin public workers}, user.groups.map(&:name).sort
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
context 'removing is_profile' do
|
530
|
+
context 'with dependant users' do
|
531
|
+
should 'error on is_profile' do
|
532
|
+
subject
|
533
|
+
ant = secure(User) { users(:ant) }
|
534
|
+
assert !ant.update_attributes(:is_profile => false)
|
535
|
+
assert_equal 'Cannot be removed (profile used).', ant.errors.on(:is_profile)
|
536
|
+
end
|
537
|
+
end
|
538
|
+
end
|
539
|
+
end
|
540
|
+
end # Setting user profile
|
541
|
+
|
542
|
+
context 'reading through contact node' do
|
543
|
+
setup do
|
544
|
+
login(:lion)
|
545
|
+
end
|
546
|
+
|
547
|
+
subject do
|
548
|
+
secure(Node) { nodes(:ant) }
|
549
|
+
end
|
550
|
+
|
551
|
+
should 'read user settings' do
|
552
|
+
assert_equal 'ant', subject.auth_user.login
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
context 'updating through contact node' do
|
557
|
+
setup do
|
558
|
+
login(:lion)
|
559
|
+
end
|
560
|
+
|
561
|
+
subject do
|
562
|
+
secure(Node) { nodes(:ant) }
|
563
|
+
end
|
564
|
+
|
565
|
+
should 'update auth settings' do
|
566
|
+
assert subject.update_attributes('auth' => {'login' => 'antidote'})
|
567
|
+
assert_equal 'antidote', users(:ant).login
|
568
|
+
end
|
569
|
+
|
570
|
+
should 'update password' do
|
571
|
+
assert subject.update_attributes('auth' => {'password' => 'hello world'})
|
572
|
+
assert_equal Zena::CryptoProvider::Initial.encrypt('hello world'), users(:ant).crypted_password
|
573
|
+
end
|
574
|
+
|
575
|
+
should 'not update password if blank' do
|
576
|
+
assert subject.update_attributes('auth' => {'password' => ''})
|
577
|
+
assert_equal Zena::CryptoProvider::Initial.encrypt('ant'), users(:ant).crypted_password
|
578
|
+
end
|
579
|
+
|
580
|
+
should 'update profile' do
|
581
|
+
secure(User) { users(:tiger) }.update_attributes(:is_profile => true)
|
582
|
+
assert subject.update_attributes('auth' => {'profile' => 'tiger', 'is_profile' => false})
|
583
|
+
assert_equal users_id(:tiger), users(:ant).profile_id
|
584
|
+
end
|
585
|
+
|
586
|
+
should 'not update inaccessible fields' do
|
587
|
+
assert subject.update_attributes('auth' => {'site_id' => 5})
|
588
|
+
assert_equal sites_id(:zena), subject.reload.site_id
|
589
|
+
end
|
590
|
+
end
|
591
|
+
|
592
|
+
context 'creating through contact node' do
|
593
|
+
setup do
|
594
|
+
login(:lion)
|
595
|
+
end
|
596
|
+
|
597
|
+
subject do
|
598
|
+
secure(Node) { nodes(:people).new_child({
|
599
|
+
:first_name => 'My',
|
600
|
+
:name => 'Giraffe',
|
601
|
+
:klass => 'Contact',
|
602
|
+
:auth => {:password => 'long big neck', :profile => 'ant' }
|
603
|
+
})}.tap do |obj|
|
604
|
+
assert obj.save
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
608
|
+
should 'create user' do
|
609
|
+
err subject
|
610
|
+
assert !subject.new_record?
|
611
|
+
# Reload all
|
612
|
+
user = secure(User) { User.find_by_login('My Giraffe') }
|
613
|
+
node = user.node
|
614
|
+
assert_equal 'My Giraffe', node.title
|
615
|
+
assert_equal 'My Giraffe', user.login
|
616
|
+
assert_equal node.id, user.node_id
|
617
|
+
end
|
618
|
+
|
619
|
+
context 'with defined login' do
|
620
|
+
setup do
|
621
|
+
secure(Node) { nodes(:people).new_child({
|
622
|
+
:first_name => 'My',
|
623
|
+
:name => 'Giraffe',
|
624
|
+
:klass => 'Contact',
|
625
|
+
:auth => {:password => 'long big neck', :profile => 'ant', :login => 'giraffe' }
|
626
|
+
})}.tap do |obj|
|
627
|
+
assert obj.save
|
628
|
+
end
|
629
|
+
end
|
630
|
+
|
631
|
+
should 'use defined login' do
|
632
|
+
user = secure(User) { User.find_by_login('giraffe') }
|
633
|
+
assert_equal 'My Giraffe', user.node.title
|
634
|
+
end
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
context 'Destroying node' do
|
639
|
+
subject do
|
640
|
+
secure(Node) { nodes(:tiger) }
|
641
|
+
end
|
642
|
+
|
643
|
+
context 'as an admin' do
|
644
|
+
setup do
|
645
|
+
login(:lion)
|
646
|
+
end
|
647
|
+
|
648
|
+
should 'mark user as deleted' do
|
649
|
+
assert_difference('User.count', 0) do
|
650
|
+
assert_difference('Node.count', -1) do
|
651
|
+
subject.destroy
|
652
|
+
end
|
653
|
+
end
|
654
|
+
user = users(:tiger)
|
655
|
+
assert_nil user.node_id
|
656
|
+
assert_equal User::Status[:deleted], user.status
|
657
|
+
end
|
658
|
+
|
659
|
+
context 'from a user with profile' do
|
660
|
+
subject do
|
661
|
+
tiger = secure(Node) { nodes(:tiger) }
|
662
|
+
assert tiger.update_attributes('auth' => {'profile' => 'ant'})
|
663
|
+
secure(Node) { nodes(:tiger) }
|
664
|
+
end
|
665
|
+
|
666
|
+
should 'remove profile' do
|
667
|
+
assert_equal 'ant', subject.auth['profile']
|
668
|
+
assert_difference('User.count', 0) do
|
669
|
+
assert_difference('Node.count', -1) do
|
670
|
+
subject.destroy
|
671
|
+
end
|
672
|
+
end
|
673
|
+
user = users(:tiger)
|
674
|
+
assert_nil user.node_id
|
675
|
+
assert_nil user.profile_id
|
676
|
+
assert_equal User::Status[:deleted], user.status
|
677
|
+
end
|
678
|
+
end
|
679
|
+
end
|
680
|
+
|
681
|
+
context 'not as an admin' do
|
682
|
+
setup do
|
683
|
+
login(:tiger)
|
684
|
+
end
|
685
|
+
|
686
|
+
should 'refuse to delete contact node' do
|
687
|
+
assert_difference('User.count', 0) do
|
688
|
+
assert_difference('Node.count', 0) do
|
689
|
+
assert !subject.destroy
|
690
|
+
end
|
691
|
+
end
|
692
|
+
assert_equal 'Cannot destroy: node is a user', subject.errors[:base]
|
693
|
+
end
|
694
|
+
end
|
695
|
+
end
|
696
|
+
|
697
|
+
context 'not an admin' do
|
698
|
+
|
699
|
+
context 'updating through contact node' do
|
700
|
+
setup do
|
701
|
+
login(:tiger)
|
702
|
+
end
|
703
|
+
|
704
|
+
subject do
|
705
|
+
secure(Node) { nodes(:ant) }
|
706
|
+
end
|
707
|
+
|
708
|
+
should 'ignore user settings' do
|
709
|
+
assert subject.update_attributes('auth' => {'login' => 'antidote', 'password' => 'a fool is a fool'})
|
710
|
+
ant = users(:ant)
|
711
|
+
assert_equal 'ant', ant.login
|
712
|
+
assert_equal Zena::CryptoProvider::Initial.encrypt('ant'), ant.crypted_password
|
713
|
+
end
|
714
|
+
end
|
715
|
+
end
|
716
|
+
|
717
|
+
context 'a manager' do
|
718
|
+
setup do
|
719
|
+
login(:lion)
|
720
|
+
manager = secure(User) { User.create({
|
721
|
+
'lang' => 'fr',
|
722
|
+
'time_zone' => 'Europe/Zurich',
|
723
|
+
'status' => '55',
|
724
|
+
'password' => 'secret',
|
725
|
+
'login' => 'bolomey',
|
726
|
+
'group_ids' => [groups_id(:public), ''],
|
727
|
+
'node_attributes' => {
|
728
|
+
'name' => 'Dupont',
|
729
|
+
'first_name' => 'Paul',
|
730
|
+
'email' => 'paul.bolomey@brainfuck.com'
|
731
|
+
}
|
732
|
+
})
|
733
|
+
}
|
734
|
+
err manager
|
735
|
+
assert !manager.new_record?
|
736
|
+
login(manager.id)
|
737
|
+
end
|
738
|
+
|
739
|
+
context 'editing a user' do
|
740
|
+
subject do
|
741
|
+
users(:tiger)
|
742
|
+
end
|
743
|
+
|
744
|
+
should 'not be allowed to change groups' do
|
745
|
+
assert_equal %w{managers public workers}, subject.groups.map{|g| g.name}.sort
|
746
|
+
assert !subject.update_attributes(:group_ids => [])
|
747
|
+
assert_equal 'Only admin can change groups.', subject.errors[:group_ids]
|
748
|
+
assert_equal %w{managers public workers}, subject.reload.groups.map{|g| g.name}.sort
|
749
|
+
end
|
750
|
+
|
751
|
+
should 'be allowed to change profile' do
|
752
|
+
assert_equal %w{managers public workers}, subject.groups.map{|g| g.name}.sort
|
753
|
+
assert subject.update_attributes(:profile => 'ant')
|
754
|
+
assert_equal %w{public workers}, subject.reload.groups.map{|g| g.name}.sort
|
755
|
+
end
|
756
|
+
|
757
|
+
should 'be allowed to change status' do
|
758
|
+
assert subject.update_attributes(:status => User::Status[:reader])
|
759
|
+
assert_equal User::Status[:reader], subject.reload.status
|
760
|
+
end
|
761
|
+
|
762
|
+
should 'not be allowed to set admin status' do
|
763
|
+
assert subject.update_attributes(:profile => 'ant')
|
764
|
+
assert_equal %w{public workers}, subject.reload.groups.map{|g| g.name}.sort
|
765
|
+
end
|
766
|
+
|
767
|
+
context 'through node' do
|
768
|
+
subject do
|
769
|
+
secure(Node) { nodes(:tiger) }
|
770
|
+
end
|
771
|
+
|
772
|
+
should 'update auth settings' do
|
773
|
+
assert subject.update_attributes('auth' => {'login' => 'antidote'})
|
774
|
+
assert_equal 'antidote', users(:tiger).login
|
775
|
+
end
|
776
|
+
end
|
777
|
+
|
778
|
+
context 'on an admin' do
|
779
|
+
subject do
|
780
|
+
users(:lion)
|
781
|
+
end
|
782
|
+
|
783
|
+
should 'not be allowed to edit' do
|
784
|
+
assert !subject.update_attributes(:login => 'lionixbar')
|
785
|
+
assert_equal 'You cannot edit this user (high status).', subject.errors[:base]
|
786
|
+
end
|
787
|
+
end
|
788
|
+
|
789
|
+
context 'on self' do
|
790
|
+
subject do
|
791
|
+
visitor.reload
|
792
|
+
end
|
793
|
+
|
794
|
+
should 'be allowed to edit' do
|
795
|
+
assert subject.update_attributes(:login => 'lionixbar')
|
796
|
+
assert_equal 'lionixbar', subject.reload.login
|
797
|
+
end
|
798
|
+
end
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
471
802
|
end
|