wagn 1.12.13 → 1.13.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +7 -8
- data/.rspec +1 -1
- data/.simplecov +23 -0
- data/.tm_properties +1 -0
- data/Gemfile +15 -13
- data/Guardfile +34 -0
- data/README.rdoc +4 -10
- data/VERSION +1 -1
- data/app/assets/images/smoothness/animated-overlay.gif +0 -0
- data/app/assets/images/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/smoothness/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/javascripts/application.js +9 -8
- data/app/assets/javascripts/jquery.ui.autocomplete.html.js +1 -1
- data/app/controllers/card_controller.rb +190 -23
- data/config/environments/development.rb +17 -12
- data/config/initializers/01_init_ruby_extensions.rb +1 -70
- data/config/routes.rb +21 -8
- data/config/version_cards.txt +1 -1
- data/db/bootstrap/card_references.yml +520 -352
- data/db/bootstrap/card_revisions.yml +1818 -1887
- data/db/bootstrap/cards.yml +2279 -1310
- data/db/migrate_cards/20130411191151_renaming_for_menu.rb +0 -5
- data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +0 -6
- data/db/migrate_cards/20130419215612_import_help_text.rb +0 -7
- data/db/migrate_cards/20130823192433_add_style_cards.rb +2 -6
- data/db/migrate_cards/20130910183318_move_styles_to_content.rb +0 -5
- data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +0 -6
- data/db/migrate_cards/20130920291703_update_stylesheets.rb +0 -5
- data/db/migrate_cards/20130927191728_account_events.rb +1 -6
- data/db/migrate_cards/20131016172445_common_css_patch.rb +0 -6
- data/db/migrate_cards/20140110193325_reset_account_request_type.rb +1 -6
- data/db/migrate_cards/20140307231621_user_data_to_cards.rb +78 -0
- data/db/migrate_cards/20140317035504_account_requests_to_signups.rb +45 -0
- data/db/migrate_cards/20140512155840_add_script_cards.rb +85 -0
- data/db/migrate_cards/data/1.12_stylesheets/common.scss +1 -1
- data/features/autonaming.feature +3 -3
- data/features/flexmail.feature +2 -2
- data/features/layouts.feature +1 -1
- data/features/navbox.feature +17 -0
- data/features/notifications.feature +4 -4
- data/features/pointer_inputs.feature +2 -2
- data/features/presetting_content.feature +1 -1
- data/features/reset_password.feature +34 -0
- data/features/{pattern_settings.feature → rules.feature} +7 -7
- data/features/setup.feature +32 -0
- data/features/signup.feature +47 -0
- data/features/step_definitions/email_steps.rb +24 -1
- data/features/step_definitions/wagn_steps.rb +66 -31
- data/features/step_definitions/web_steps.rb +1 -0
- data/features/{content_settings.feature → structure.feature} +3 -6
- data/features/support/env.rb +3 -0
- data/features/support/paths.rb +2 -2
- data/features/support/{wag_env.rb → wagn_env.rb} +1 -1
- data/features/table_of_contents.feature +1 -1
- data/features/update_includers.feature +3 -3
- data/features/watch.feature +2 -2
- data/lib/card.rb +12 -10
- data/lib/{active_record/quoting_and_matching.rb → card/active_record_ext.rb} +25 -20
- data/lib/card/auth.rb +205 -0
- data/lib/card/chunk.rb +70 -69
- data/lib/card/content.rb +1 -1
- data/lib/card/core_ext.rb +74 -0
- data/lib/card/env.rb +66 -0
- data/lib/card/flexmail.rb +43 -37
- data/lib/card/format.rb +42 -29
- data/lib/{generators → card/generators}/card_migration/USAGE +0 -0
- data/lib/{generators → card/generators}/card_migration/card_migration_generator.rb +0 -0
- data/lib/{generators → card/generators}/card_migration/templates/card_migration.erb +0 -6
- data/lib/{generators → card/generators}/format/USAGE +0 -0
- data/lib/{generators → card/generators}/format/format_generator.rb +0 -0
- data/lib/{generators → card/generators}/format/templates/format_spec_template.erb +1 -2
- data/lib/{generators → card/generators}/format/templates/format_template.erb +0 -0
- data/lib/{generators → card/generators}/set/USAGE +0 -0
- data/lib/{generators → card/generators}/set/set_generator.rb +0 -0
- data/lib/{generators → card/generators}/set/templates/set_spec_template.erb +1 -2
- data/lib/card/generators/set/templates/set_template.erb +1 -0
- data/lib/card/loader.rb +145 -0
- data/lib/card/mailer.rb +117 -0
- data/{app/views → lib/card}/mailer/change_notice.html.erb +2 -2
- data/lib/card/mailer/confirmation_email.html.erb +8 -0
- data/{app/views → lib/card}/mailer/flexmail.html.erb +0 -0
- data/lib/card/mailer/password_reset.html.erb +9 -0
- data/{app/views → lib/card}/mailer/signup_alert.html.erb +0 -0
- data/lib/card/name.rb +2 -3
- data/lib/card/query.rb +0 -3
- data/lib/card/query/card_spec.rb +4 -4
- data/lib/card/revision.rb +34 -32
- data/lib/card/set.rb +204 -180
- data/lib/card/set_pattern.rb +126 -101
- data/lib/wagn/all.rb +1 -8
- data/lib/wagn/application.rb +14 -7
- data/lib/wagn/commands/application.rb +1 -1
- data/lib/{generators → wagn/generators}/wagn/USAGE +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/Gemfile +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/Rakefile +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config.ru +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/application.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/boot.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/database.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/frontbase.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/ibm_db.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbc.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcmysql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcpostgresql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcsqlite3.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/mysql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/oracle.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/postgresql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/sqlite3.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/environment.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/gitignore +0 -0
- data/lib/wagn/generators/wagn/templates/public/files/htaccess +9 -0
- data/{public → lib/wagn/generators/wagn/templates/public}/robots.txt +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/script/wagn +0 -0
- data/lib/{generators → wagn/generators}/wagn/wagn_generator.rb +12 -0
- data/lib/wagn/location.rb +7 -11
- data/lib/wagn/migration_helper.rb +4 -1
- data/{app/mailers → lib/wagn/tasks}/.gitkeep +0 -0
- data/lib/{tasks → wagn/tasks}/cucumber.rake +0 -0
- data/lib/{tasks → wagn/tasks}/db.rake +0 -0
- data/lib/{tasks → wagn/tasks}/test.rake +5 -2
- data/lib/{tasks → wagn/tasks}/wagn.rake +29 -12
- data/mods/{standard → core}/chunks/include.rb +2 -0
- data/mods/{standard → core}/chunks/link.rb +3 -0
- data/mods/core/formats/html_format.rb +27 -35
- data/mods/core/sets/all/active_card.rb +15 -3
- data/mods/core/sets/all/attribute_tracking.rb +1 -1
- data/mods/core/sets/all/collection.rb +4 -5
- data/mods/core/sets/all/fetch.rb +98 -80
- data/mods/core/sets/all/initialize.rb +2 -0
- data/mods/core/sets/all/name.rb +13 -12
- data/mods/core/sets/all/pattern.rb +0 -9
- data/mods/core/sets/all/permissions.rb +56 -31
- data/mods/core/sets/all/phases.rb +63 -84
- data/mods/core/sets/all/references.rb +0 -1
- data/mods/core/sets/all/rules.rb +3 -4
- data/mods/core/sets/all/templating.rb +2 -3
- data/mods/core/sets/all/tracked_attributes.rb +26 -9
- data/mods/core/sets/all/trash.rb +1 -2
- data/mods/core/sets/all/type.rb +6 -1
- data/mods/core/sets/all/utils.rb +2 -3
- data/mods/standard/files/103/icon-6566.ico +0 -0
- data/mods/standard/files/103/large-6566.ico +0 -0
- data/mods/standard/files/103/medium-6566.ico +0 -0
- data/{public/favicon.ico → mods/standard/files/103/original-6566.ico} +0 -0
- data/mods/standard/files/103/small-6566.ico +0 -0
- data/mods/standard/files/79/icon-6556.png +0 -0
- data/mods/standard/files/79/large-6556.png +0 -0
- data/mods/standard/files/79/medium-6556.png +0 -0
- data/mods/standard/files/79/original-6556.png +0 -0
- data/mods/standard/files/79/small-6556.png +0 -0
- data/mods/standard/files/790/icon-6419.png +0 -0
- data/mods/standard/files/790/large-6419.png +0 -0
- data/mods/standard/files/790/medium-6419.png +0 -0
- data/mods/standard/files/790/original-6419.png +0 -0
- data/mods/standard/files/790/small-6419.png +0 -0
- data/mods/standard/lib/card/machine.rb +152 -0
- data/mods/standard/lib/card/machine_input.rb +40 -0
- data/{public/assets → mods/standard/lib/javascript}/html5shiv-printshiv.js +0 -0
- data/mods/standard/lib/javascript/jquery-ui.js +14913 -0
- data/mods/standard/lib/javascript/jquery.autosize.js +255 -0
- data/mods/standard/lib/javascript/jquery.fileupload.js +1112 -0
- data/mods/standard/lib/javascript/jquery.iframe-transport.js +157 -0
- data/mods/standard/lib/javascript/jquery.js +9473 -0
- data/mods/standard/lib/javascript/jquery.ui.autocomplete.html.js +41 -0
- data/mods/standard/lib/javascript/jquery_ujs.js +429 -0
- data/mods/standard/lib/javascript/jquerymobile.js +8800 -0
- data/mods/standard/lib/javascript/tinymce.js +13 -0
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn.js.coffee +10 -0
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_menu.js +3 -12
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_mod.js.coffee +18 -11
- data/mods/standard/lib/stylesheets/functional.scss +13 -9
- data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +922 -218
- data/mods/standard/lib/stylesheets/standard.scss +2 -2
- data/mods/standard/sets/all/account.rb +18 -205
- data/mods/standard/sets/all/all_css.rb +2 -3
- data/mods/standard/sets/all/all_csv.rb +0 -1
- data/mods/standard/sets/all/attach.rb +0 -1
- data/mods/standard/sets/all/base.rb +9 -7
- data/mods/standard/sets/all/comment.rb +5 -5
- data/mods/standard/sets/all/email_html.rb +0 -2
- data/mods/standard/sets/all/event_viz.rb +62 -0
- data/mods/standard/sets/all/file.rb +0 -1
- data/mods/standard/sets/all/follow.rb +13 -11
- data/mods/standard/sets/all/history.rb +2 -7
- data/mods/standard/sets/all/json.rb +6 -11
- data/mods/standard/sets/all/rich_html.rb +68 -52
- data/mods/standard/sets/all/rss.rb +4 -5
- data/mods/standard/sets/all/text.rb +0 -1
- data/mods/standard/sets/right/account.rb +100 -1
- data/mods/standard/sets/right/create.rb +8 -2
- data/mods/standard/sets/right/delete.rb +2 -0
- data/mods/standard/sets/right/email.rb +50 -2
- data/mods/standard/sets/right/machine_output.rb +12 -0
- data/mods/standard/sets/right/password.rb +39 -0
- data/mods/standard/sets/right/read.rb +2 -0
- data/mods/standard/sets/right/salt.rb +2 -1
- data/mods/standard/sets/right/script.rb +10 -0
- data/mods/standard/sets/right/stats.rb +35 -0
- data/mods/standard/sets/right/status.rb +9 -0
- data/mods/standard/sets/right/style.rb +7 -53
- data/mods/standard/sets/right/{crypted_password.rb → token.rb} +2 -1
- data/mods/standard/sets/right/update.rb +2 -0
- data/mods/standard/sets/rstar/rules.rb +7 -3
- data/mods/standard/sets/self/account_links.rb +16 -23
- data/mods/standard/sets/self/alerts.rb +0 -1
- data/mods/standard/sets/self/all.rb +21 -0
- data/mods/standard/sets/self/foot.rb +0 -1
- data/mods/standard/sets/self/head.rb +21 -24
- data/mods/standard/sets/self/navbox.rb +0 -1
- data/mods/standard/sets/self/now.rb +0 -1
- data/mods/standard/sets/self/recent.rb +38 -35
- data/mods/standard/sets/self/script_card_menu.rb +8 -0
- data/mods/standard/sets/self/script_html5shiv_printshiv.rb +7 -0
- data/mods/standard/sets/self/script_jquery.rb +8 -0
- data/mods/standard/sets/self/script_jquery_helper.rb +13 -0
- data/mods/standard/sets/self/script_slot.rb +9 -0
- data/mods/standard/sets/self/script_tinymce.rb +8 -0
- data/mods/standard/sets/self/search.rb +0 -1
- data/mods/standard/sets/self/signin.rb +111 -0
- data/mods/standard/sets/self/stats.rb +91 -0
- data/mods/standard/sets/self/style_functional.rb +1 -1
- data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +1 -1
- data/mods/standard/sets/self/style_standard.rb +1 -1
- data/mods/standard/sets/type/basic.rb +15 -14
- data/mods/standard/sets/type/cardtype.rb +2 -3
- data/mods/standard/sets/type/coffee_script.rb +46 -0
- data/mods/standard/sets/type/css.rb +16 -5
- data/mods/standard/sets/type/date.rb +0 -1
- data/mods/standard/sets/type/file.rb +0 -2
- data/mods/standard/sets/type/html.rb +0 -1
- data/mods/standard/sets/type/image.rb +1 -2
- data/mods/standard/sets/type/java_script.rb +32 -0
- data/mods/standard/sets/type/layout_type.rb +1 -1
- data/mods/standard/sets/type/number.rb +0 -1
- data/mods/standard/sets/type/pointer.rb +13 -8
- data/mods/standard/sets/type/scss.rb +17 -3
- data/mods/standard/sets/type/search_type.rb +36 -34
- data/mods/standard/sets/type/set.rb +1 -5
- data/mods/standard/sets/type/setting.rb +1 -2
- data/mods/standard/sets/type/signup.rb +92 -0
- data/mods/standard/sets/type/skin.rb +4 -5
- data/mods/standard/sets/type/toggle.rb +1 -1
- data/mods/standard/sets/type/user.rb +51 -4
- data/public/{404.html → assets/jasmine/404.html} +0 -0
- data/public/{500.html → assets/jasmine/500.html} +0 -0
- data/public/{jasmine → assets/jasmine}/card_form.html +0 -0
- data/public/assets/jquery-ui/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
- data/public/assets/jquery-ui/animated-overlay.gif +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/{app/assets/images/images/ui-icons_2e83ff_256x240.png → public/assets/jquery-ui/ui-icons_222222_256x240-b1eb177a51ea7925448318a26d988842.png} +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_222222_256x240.png +0 -0
- data/{app/assets/images/images/ui-icons_454545_256x240.png → public/assets/jquery-ui/ui-icons_2e83ff_256x240-49c2da9cac2dc565265586f716491298.png} +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_2e83ff_256x240.png +0 -0
- data/{app/assets/images/images/ui-icons_888888_256x240.png → public/assets/jquery-ui/ui-icons_454545_256x240-68b2fe3268f7604fb0767a0372e2db85.png} +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_454545_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_888888_256x240-8040cfcc88792375b7788feb59189eef.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_888888_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-d4a62216bf6f0cd0071149890763a5ff.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery.min-388372ef65cc311f6a3df4a6ceac8d22.map +1 -0
- data/public/assets/jquery.min.map +1 -1
- data/public/assets/manifest.yml +61 -31
- data/public/assets/smoothness/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
- data/public/assets/smoothness/animated-overlay.gif +0 -0
- data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100-31613497e63975a54520b7065b125dea.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100-f4b0e20e6f4c83b9f52cf062ed0f5284.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400-e3606d6e7ad67486ffdc83edca64d4c5.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400-dcec96932b90ff4cd4fea91284a6e9a3.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400-a2310f533684ede4f1216d7299b5cd58.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400-d872f3a0a02dea609e4b0321520236d9.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400-9ccaed8a65a3c285c16a73bdf03a69b3.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100-2ef1d227b5c0f33ce3c5e45afa953991.png +0 -0
- data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/assets/smoothness/ui-icons_222222_256x240-0675a996f0bdc78890f7b312c543b06a.png +0 -0
- data/public/assets/smoothness/ui-icons_222222_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_2e83ff_256x240-6aea736f81a417977efd77f183519a54.png +0 -0
- data/public/assets/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_454545_256x240-6f4361f45745fb0cd7b0cc2851dc1cc3.png +0 -0
- data/public/assets/smoothness/ui-icons_454545_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_888888_256x240-8f6818bd8631ba3489de718e26c7e6cf.png +0 -0
- data/public/assets/smoothness/ui-icons_888888_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_cd0a0a_256x240-2969ddba6d0a9c62603a4aa85a363cda.png +0 -0
- data/public/assets/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/controllers/card_controller_spec.rb +77 -61
- data/spec/controllers/location_spec.rb +3 -2
- data/spec/lib/card/auth_spec.rb +17 -0
- data/spec/lib/card/chunk_spec.rb +0 -1
- data/spec/lib/card/codename_spec.rb +12 -18
- data/spec/lib/card/content_spec.rb +0 -1
- data/spec/lib/card/diff_spec.rb +0 -1
- data/spec/lib/card/flexmail_spec.rb +19 -20
- data/spec/lib/card/format_spec.rb +0 -169
- data/spec/lib/{wagn → card}/loader_spec.rb +1 -2
- data/spec/lib/card/name_spec.rb +3 -5
- data/spec/lib/card/query_spec.rb +5 -8
- data/spec/{models → lib}/card/reference_spec.rb +6 -7
- data/spec/lib/card/revision_spec.rb +30 -0
- data/spec/lib/card/set_pattern_spec.rb +0 -1
- data/spec/lib/card/set_spec.rb +9 -9
- data/spec/lib/wagn/cache_spec.rb +0 -1
- data/spec/mailers/mailer_spec.rb +4 -9
- data/spec/models/card/cardtype_spec.rb +12 -14
- data/spec/models/card/create_spec.rb +3 -4
- data/spec/models/card/trash_spec.rb +24 -23
- data/spec/models/card/type_transition_spec.rb +3 -4
- data/spec/models/card/validation_spec.rb +0 -1
- data/spec/models/card_spec.rb +10 -11
- data/spec/mods/core/chunks/literal_spec.rb +0 -1
- data/spec/mods/core/chunks/uri_spec.rb +0 -1
- data/spec/mods/core/formats/data_format_spec.rb +0 -1
- data/spec/mods/core/formats/html_format_spec.rb +17 -18
- data/spec/mods/core/formats/text_format_spec.rb +0 -1
- data/spec/mods/core/sets/all/active_card_spec.rb +1 -2
- data/spec/mods/core/sets/all/attribute_tracking_spec.rb +1 -2
- data/spec/mods/core/sets/all/collection_spec.rb +1 -5
- data/spec/mods/core/sets/all/content_spec.rb +0 -1
- data/spec/mods/core/sets/all/fetch_spec.rb +7 -10
- data/spec/mods/core/sets/all/initialize_spec.rb +0 -1
- data/spec/mods/core/sets/all/name_spec.rb +34 -3
- data/spec/mods/core/sets/all/pattern_spec.rb +6 -9
- data/spec/mods/core/sets/all/permissions_spec.rb +61 -62
- data/spec/mods/core/sets/all/phases_spec.rb +1 -2
- data/spec/mods/core/sets/all/references_spec.rb +0 -1
- data/spec/mods/core/sets/all/rules2_spec.rb +31 -31
- data/spec/mods/core/sets/all/rules_spec.rb +3 -4
- data/spec/mods/core/sets/all/states_spec.rb +1 -2
- data/spec/mods/core/sets/all/templating_spec.rb +11 -12
- data/spec/mods/core/sets/all/tracked_attributes_spec.rb +18 -8
- data/spec/mods/core/sets/all/trash_spec.rb +1 -2
- data/spec/mods/core/sets/all/type_spec.rb +6 -5
- data/spec/mods/core/sets/all/utils_spec.rb +1 -2
- data/spec/mods/standard/chunks/include_spec.rb +14 -15
- data/spec/mods/standard/chunks/link_spec.rb +0 -1
- data/spec/mods/standard/formats/css_format_spec.rb +1 -2
- data/spec/mods/standard/formats/csv_format_spec.rb +0 -1
- data/spec/mods/standard/formats/email_html_format_spec.rb +1 -2
- data/spec/mods/standard/formats/file_format_spec.rb +0 -1
- data/spec/mods/standard/formats/js_format_spec.rb +3 -0
- data/spec/mods/standard/formats/json_format_spec.rb +0 -1
- data/spec/mods/standard/formats/rss_format_spec.rb +1 -2
- data/spec/mods/standard/formats/xml_format_spec.rb +0 -1
- data/spec/mods/standard/lib/machine_input_spec.rb +48 -0
- data/spec/mods/standard/lib/machine_spec.rb +110 -0
- data/spec/mods/standard/sets/all/account_spec.rb +50 -30
- data/spec/mods/standard/sets/all/all_css_spec.rb +0 -1
- data/spec/mods/standard/sets/all/all_csv_spec.rb +0 -1
- data/spec/mods/standard/sets/all/attach_spec.rb +0 -1
- data/spec/mods/standard/sets/all/base_spec.rb +5 -6
- data/spec/mods/standard/sets/all/comment_spec.rb +5 -0
- data/spec/mods/standard/sets/all/email_html_spec.rb +2 -3
- data/spec/mods/standard/sets/all/event_viz_spec.rb +7 -0
- data/spec/mods/standard/sets/all/file_spec.rb +0 -1
- data/spec/mods/standard/sets/all/flexmail_spec.rb +0 -1
- data/spec/mods/standard/sets/all/follow_spec.rb +10 -11
- data/spec/mods/standard/sets/all/history_spec.rb +10 -0
- data/spec/mods/standard/sets/all/json_spec.rb +5 -6
- data/spec/mods/standard/sets/all/rich_html_spec.rb +16 -13
- data/spec/mods/standard/sets/all/rss_spec.rb +4 -2
- data/spec/mods/standard/sets/all/text_spec.rb +1 -2
- data/spec/mods/standard/sets/right/account_spec.rb +86 -2
- data/spec/mods/standard/sets/right/add_help_spec.rb +0 -1
- data/spec/mods/standard/sets/right/comment_spec.rb +37 -2
- data/spec/mods/standard/sets/right/create_spec.rb +6 -2
- data/spec/mods/standard/sets/right/default_spec.rb +0 -1
- data/spec/mods/standard/sets/right/delete_spec.rb +0 -1
- data/spec/mods/standard/sets/right/email_spec.rb +43 -15
- data/spec/mods/standard/sets/right/help_spec.rb +0 -1
- data/spec/mods/standard/sets/right/machine_output_spec.rb +20 -0
- data/spec/mods/standard/sets/right/password_spec.rb +45 -0
- data/spec/mods/standard/sets/right/read_spec.rb +0 -1
- data/spec/mods/standard/sets/right/salt_spec.rb +0 -1
- data/spec/mods/standard/sets/right/script_spec.rb +20 -0
- data/spec/mods/standard/sets/right/stats_spec.rb +13 -0
- data/spec/mods/standard/sets/right/status_spec.rb +5 -0
- data/spec/mods/standard/sets/right/structure_spec.rb +2 -3
- data/spec/mods/standard/sets/right/style_spec.rb +19 -2
- data/spec/mods/standard/sets/right/token_spec.rb +5 -0
- data/spec/mods/standard/sets/right/update_spec.rb +0 -1
- data/spec/mods/standard/sets/right/when_created_spec.rb +0 -1
- data/spec/mods/standard/sets/right/when_last_edited_spec.rb +0 -1
- data/spec/mods/standard/sets/rstar/rules_spec.rb +3 -4
- data/spec/mods/standard/sets/self/account_links_spec.rb +0 -1
- data/spec/mods/standard/sets/self/alerts_spec.rb +0 -1
- data/spec/mods/standard/sets/self/all_spec.rb +47 -0
- data/spec/mods/standard/sets/self/foot_spec.rb +0 -1
- data/spec/mods/standard/sets/self/head_spec.rb +0 -1
- data/spec/mods/standard/sets/self/navbox_spec.rb +0 -1
- data/spec/mods/standard/sets/self/now_spec.rb +0 -1
- data/spec/mods/standard/sets/self/recent_spec.rb +1 -2
- data/spec/mods/standard/sets/self/search_spec.rb +1 -2
- data/spec/mods/standard/sets/self/signin_spec.rb +73 -0
- data/spec/mods/standard/sets/self/stats_spec.rb +12 -0
- data/spec/mods/standard/sets/self/style_functional_spec.rb +1 -2
- data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +1 -2
- data/spec/mods/standard/sets/self/style_standard_spec.rb +1 -2
- data/spec/mods/standard/sets/self/version_spec.rb +0 -1
- data/spec/mods/standard/sets/type/basic_spec.rb +1 -2
- data/spec/mods/standard/sets/type/cardtype_spec.rb +1 -2
- data/spec/mods/standard/sets/type/coffeescript_spec.rb +28 -0
- data/spec/mods/standard/sets/type/css_spec.rb +31 -4
- data/spec/mods/standard/sets/type/date_spec.rb +0 -1
- data/spec/mods/standard/sets/type/file_spec.rb +1 -2
- data/spec/mods/standard/sets/type/html_spec.rb +3 -4
- data/spec/mods/standard/sets/type/image_spec.rb +1 -2
- data/spec/mods/standard/sets/type/javascript_spec.rb +28 -0
- data/spec/mods/standard/sets/type/layout_type_spec.rb +0 -1
- data/spec/mods/standard/sets/type/number_spec.rb +0 -1
- data/spec/mods/standard/sets/type/phrase_spec.rb +0 -1
- data/spec/mods/standard/sets/type/plain_text_spec.rb +0 -1
- data/spec/mods/standard/sets/type/pointer_spec.rb +1 -2
- data/spec/mods/standard/sets/type/scss_spec.rb +47 -2
- data/spec/mods/standard/sets/type/search_type_spec.rb +14 -3
- data/spec/mods/standard/sets/type/set_spec.rb +0 -1
- data/spec/mods/standard/sets/type/setting_spec.rb +6 -2
- data/spec/mods/standard/sets/type/signup_spec.rb +93 -0
- data/spec/mods/standard/sets/type/skin_spec.rb +23 -2
- data/spec/mods/standard/sets/type/toggle_spec.rb +0 -1
- data/spec/mods/standard/sets/type/user_spec.rb +1 -2
- data/{lib/wagn → spec}/spec_helper.rb +59 -14
- data/test/1.10.0-data-dump.sql +327 -0
- data/test/fixtures/card_references.yml +777 -581
- data/test/fixtures/card_revisions.yml +2737 -2488
- data/test/fixtures/cards.yml +4037 -2184
- data/test/performance/card_create_test.rb +1 -1
- data/test/performance/render_test.rb +1 -1
- data/test/seed.rb +36 -63
- data/test/test_helper.rb +1 -1
- data/wagn.gemspec +9 -9
- metadata +257 -237
- data/app/assets/javascripts/html5shiv-printshiv.js +0 -499
- data/app/controllers/account_controller.rb +0 -61
- data/app/controllers/admin_controller.rb +0 -124
- data/app/controllers/stub_card_controller.rb +0 -9
- data/app/controllers/wagn_controller.rb +0 -165
- data/app/mailers/mailer.rb +0 -109
- data/app/models/.gitkeep +0 -0
- data/app/models/account.rb +0 -198
- data/app/models/user.rb +0 -123
- data/app/views/mailer/account_info.text.erb +0 -17
- data/config/initializers/backtrace_silencers.rb +0 -8
- data/config/initializers/schema_views.rb +0 -59
- data/config/initializers/wrap_parameters.rb +0 -15
- data/config/samples/database.yml.erb +0 -34
- data/db/bootstrap/users.yml +0 -29
- data/features/account_requests.feature +0 -22
- data/features/google_maps.feature +0 -31
- data/features/hello_wagn.feature +0 -31
- data/features/step_definitions/notification_steps.rb +0 -23
- data/features/templates.feature +0 -30
- data/features/virtual_cards.feature +0 -11
- data/lib/active_record/foreign_keys.rb +0 -80
- data/lib/card/constant.rb +0 -20
- data/lib/generators/set/templates/set_template.erb +0 -1
- data/lib/tasks/.gitkeep +0 -0
- data/lib/wagn/authenticated_system.rb +0 -38
- data/lib/wagn/env.rb +0 -42
- data/lib/wagn/loader.rb +0 -135
- data/mods/standard/formats/kml_format.rb +0 -6
- data/mods/standard/lib/google_maps_addon.rb +0 -30
- data/mods/standard/sets/all/admin.rb +0 -53
- data/mods/standard/sets/all/geocode.rb +0 -16
- data/mods/standard/sets/all/kml.rb +0 -49
- data/mods/standard/sets/type/account_request.rb +0 -74
- data/mods/standard/sets/type/ruby_and_script.rb +0 -31
- data/public/assets/application-058913c45d4f3262667bad443a03eb45.js +0 -144
- data/public/assets/application-058913c45d4f3262667bad443a03eb45.js.gz +0 -0
- data/public/assets/application.js +0 -144
- data/public/assets/application.js.gz +0 -0
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +0 -1
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
- data/public/assets/html5shiv-printshiv.js.gz +0 -0
- data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240.png +0 -0
- data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
- data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
- data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery.min-8b58c0fbf303b938d8e749262f7e50dd.map +0 -1
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +0 -13
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
- data/public/assets/tinymce.js +0 -13
- data/public/assets/tinymce.js.gz +0 -0
- data/spec/controllers/account_controller_spec.rb +0 -42
- data/spec/controllers/admin_controller_spec.rb +0 -23
- data/spec/controllers/captcha_spec.rb +0 -103
- data/spec/controllers/sets_spec.rb +0 -97
- data/spec/controllers/wagn_controller_spec.rb +0 -5
- data/spec/mailers/account_spec.rb +0 -66
- data/spec/models/account_spec.rb +0 -19
- data/spec/models/card/comment_spec.rb +0 -38
- data/spec/models/card/revision_spec.rb +0 -58
- data/spec/models/user_spec.rb +0 -95
- data/spec/mods/standard/formats/kml_format_spec.rb +0 -6
- data/spec/mods/standard/sets/all/admin_spec.rb +0 -6
- data/spec/mods/standard/sets/all/geocode_spec.rb +0 -37
- data/spec/mods/standard/sets/all/kml_spec.rb +0 -6
- data/spec/mods/standard/sets/right/crypted_password_spec.rb +0 -6
- data/spec/mods/standard/sets/type/account_request_spec.rb +0 -160
- data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +0 -6
- data/spec/spec.opts +0 -6
- data/test/fixtures/users.yml +0 -169
@@ -1,16 +1,15 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require 'wagn/spec_helper'
|
3
2
|
|
4
3
|
class ::Card
|
5
4
|
def writeable_by(user)
|
6
|
-
|
7
|
-
#warn "writeable #{
|
5
|
+
Card::Auth.as(user.id) do
|
6
|
+
#warn "writeable #{Card::Auth.as_id}, #{user.inspect}"
|
8
7
|
ok? :update
|
9
8
|
end
|
10
9
|
end
|
11
10
|
|
12
11
|
def readable_by(user)
|
13
|
-
|
12
|
+
Card::Auth.as(user.id) do
|
14
13
|
ok? :read
|
15
14
|
end
|
16
15
|
end
|
@@ -20,19 +19,19 @@ end
|
|
20
19
|
module PermissionSpecHelper
|
21
20
|
|
22
21
|
def assert_hidden_from( user, card, msg='')
|
23
|
-
|
22
|
+
Card::Auth.as(user.id) { assert_hidden( card, msg ) }
|
24
23
|
end
|
25
24
|
|
26
25
|
def assert_not_hidden_from( user, card, msg='')
|
27
|
-
|
26
|
+
Card::Auth.as(user.id) { assert_not_hidden( card, msg ) }
|
28
27
|
end
|
29
28
|
|
30
29
|
def assert_locked_from( user, card, msg='')
|
31
|
-
|
30
|
+
Card::Auth.as(user.id) { assert_locked( card, msg ) }
|
32
31
|
end
|
33
32
|
|
34
33
|
def assert_not_locked_from( user, card, msg='')
|
35
|
-
|
34
|
+
Card::Auth.as(user.id) { assert_not_locked( card, msg ) }
|
36
35
|
end
|
37
36
|
|
38
37
|
def assert_hidden( card, msg='' )
|
@@ -69,37 +68,37 @@ describe Card::Set::All::Permissions do
|
|
69
68
|
card = Card.fetch('Home')
|
70
69
|
card.read_rule_id.should == Card.fetch('*all+*read').id
|
71
70
|
card.who_can(:read).should == [Card::AnyoneID]
|
72
|
-
|
71
|
+
Card::Auth.as(:anonymous){ card.ok?(:read).should be_true }
|
73
72
|
end
|
74
73
|
|
75
74
|
it "should update to role ('Anyone Signed In')" do
|
76
75
|
|
77
76
|
name = @perm_card.name
|
78
|
-
|
77
|
+
Card::Auth.as_bot { @perm_card.save! }
|
79
78
|
pc = Card[name]
|
80
79
|
card = Card['Home']
|
81
80
|
#warn "card #{name}, #{card.inspect}, #{pc.inspect}"
|
82
81
|
pc.should be
|
83
82
|
card.read_rule_id.should == pc.id
|
84
|
-
card.who_can(:read).should == [Card::
|
85
|
-
|
83
|
+
card.who_can(:read).should == [Card::AnyoneSignedInID]
|
84
|
+
Card::Auth.as(:anonymous){ card.ok?(:read).should be_false }
|
86
85
|
end
|
87
86
|
|
88
87
|
it "should update to user ('Joe Admin')" do
|
89
88
|
@perm_card.content = '[[Joe Admin]]'
|
90
|
-
|
89
|
+
Card::Auth.as_bot { @perm_card.save! }
|
91
90
|
|
92
91
|
card = Card.fetch('Home')
|
93
92
|
card.read_rule_id.should == @perm_card.id
|
94
93
|
card.who_can(:read).should == [Card['joe_admin'].id]
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
94
|
+
Card::Auth.as(:anonymous) { card.ok?(:read).should be_false }
|
95
|
+
Card::Auth.as(:joe_user) { card.ok?(:read).should be_false }
|
96
|
+
Card::Auth.as(:joe_admin) { card.ok?(:read).should be_true }
|
97
|
+
Card::Auth.as_bot { card.ok?(:read).should be_true }
|
99
98
|
end
|
100
99
|
|
101
100
|
it "should revert to more general rule when more specific (self) rule is deleted" do
|
102
|
-
|
101
|
+
Card::Auth.as_bot do
|
103
102
|
@perm_card.save!
|
104
103
|
@perm_card.delete!
|
105
104
|
end
|
@@ -109,21 +108,21 @@ describe Card::Set::All::Permissions do
|
|
109
108
|
|
110
109
|
it "should revert to more general rule when more specific (right) rule is deleted" do
|
111
110
|
pc = nil
|
112
|
-
|
111
|
+
Card::Auth.as_bot do
|
113
112
|
pc=Card.create(:name=>'B+*right+*read', :type=>'Pointer', :content=>'[[Anyone Signed In]]')
|
114
113
|
end
|
115
114
|
pc.should be
|
116
115
|
card = Card.fetch('A+B')
|
117
116
|
card.read_rule_id.should == pc.id
|
118
117
|
pc = Card.fetch(pc.name) #important to re-fetch to catch issues with detecting change in trash status.
|
119
|
-
|
118
|
+
Card::Auth.as_bot { pc.delete }
|
120
119
|
card = Card.fetch('A+B')
|
121
120
|
card.read_rule_id.should == Card.fetch('*all+*read').id
|
122
121
|
end
|
123
122
|
|
124
123
|
it "should revert to more general rule when more specific rule is renamed" do
|
125
124
|
|
126
|
-
|
125
|
+
Card::Auth.as_bot do
|
127
126
|
@perm_card.save!
|
128
127
|
@perm_card = Card[@perm_card.name]
|
129
128
|
@perm_card.name = 'Something else+*self+*read'
|
@@ -135,7 +134,7 @@ describe Card::Set::All::Permissions do
|
|
135
134
|
end
|
136
135
|
|
137
136
|
it "should not be overruled by a more general rule added later" do
|
138
|
-
|
137
|
+
Card::Auth.as_bot do
|
139
138
|
@perm_card.save!
|
140
139
|
c= Card.fetch('Home')
|
141
140
|
c.type_id = Card::PhraseID
|
@@ -149,7 +148,7 @@ describe Card::Set::All::Permissions do
|
|
149
148
|
|
150
149
|
it "should get updated when trunk type change makes type-plus-right apply / unapply" do
|
151
150
|
@perm_card.name = "Phrase+B+*type plus right+*read"
|
152
|
-
|
151
|
+
Card::Auth.as_bot { @perm_card.save! }
|
153
152
|
Card.fetch('A+B').read_rule_id.should == Card.fetch('*all+*read').id
|
154
153
|
c = Card.fetch('A')
|
155
154
|
c.type_id = Card::PhraseID
|
@@ -158,20 +157,20 @@ describe Card::Set::All::Permissions do
|
|
158
157
|
end
|
159
158
|
|
160
159
|
it "should work with relative settings" do
|
161
|
-
|
160
|
+
Card::Auth.as_bot do
|
162
161
|
@perm_card.save!
|
163
162
|
all_plus = Card.fetch '*all plus+*read', :new=>{:content=>'_left'}
|
164
163
|
all_plus.save
|
165
164
|
end
|
166
165
|
c = Card.new(:name=>'Home+Heart')
|
167
|
-
c.who_can(:read).should == [Card::
|
166
|
+
c.who_can(:read).should == [Card::AnyoneSignedInID]
|
168
167
|
c.permission_rule_card(:read).first.id.should == @perm_card.id
|
169
168
|
c.save
|
170
169
|
c.read_rule_id.should == @perm_card.id
|
171
170
|
end
|
172
171
|
|
173
172
|
it "should get updated when relative settings change" do
|
174
|
-
|
173
|
+
Card::Auth.as_bot do
|
175
174
|
all_plus = Card.fetch '*all plus+*read', :new=>{:content=>'_left'}
|
176
175
|
all_plus.save
|
177
176
|
end
|
@@ -180,21 +179,21 @@ describe Card::Set::All::Permissions do
|
|
180
179
|
c.permission_rule_card(:read).first.id.should == Card.fetch('*all+*read').id
|
181
180
|
c.save
|
182
181
|
c.read_rule_id.should == Card.fetch('*all+*read').id
|
183
|
-
|
182
|
+
Card::Auth.as_bot { @perm_card.save! }
|
184
183
|
c2 = Card.fetch('Home+Heart')
|
185
|
-
c2.who_can(:read).should == [Card::
|
184
|
+
c2.who_can(:read).should == [Card::AnyoneSignedInID]
|
186
185
|
c2.read_rule_id.should == @perm_card.id
|
187
186
|
Card.fetch('Home+Heart').read_rule_id.should == @perm_card.id
|
188
|
-
|
187
|
+
Card::Auth.as_bot{ @perm_card.delete }
|
189
188
|
Card.fetch('Home').read_rule_id.should == Card.fetch('*all+*read').id
|
190
189
|
Card.fetch('Home+Heart').read_rule_id.should == Card.fetch('*all+*read').id
|
191
190
|
end
|
192
191
|
|
193
192
|
it "should insure that class overrides work with relative settings" do
|
194
|
-
|
193
|
+
Card::Auth.as_bot do
|
195
194
|
all_plus = Card.fetch '*all plus+*read', :new => { :content=>'_left' }
|
196
195
|
all_plus.save
|
197
|
-
|
196
|
+
Card::Auth.as_bot { @perm_card.save! }
|
198
197
|
c = Card.create(:name=>'Home+Heart')
|
199
198
|
c.read_rule_id.should == @perm_card.id
|
200
199
|
r = Card.create(:name=>'Heart+*right+*read', :type=>'Pointer', :content=>'[[Administrator]]')
|
@@ -213,8 +212,8 @@ describe Card::Set::All::Permissions do
|
|
213
212
|
|
214
213
|
context '??' do
|
215
214
|
before do
|
216
|
-
|
217
|
-
#
|
215
|
+
Card::Auth.as_bot do
|
216
|
+
# Card::Auth.cache.reset
|
218
217
|
@u1, @u2, @u3, @r1, @r2, @r3, @c1, @c2, @c3 =
|
219
218
|
%w( u1 u2 u3 r1 r2 r3 c1 c2 c3 ).map do |x| Card[x] end
|
220
219
|
end
|
@@ -222,19 +221,19 @@ describe Card::Set::All::Permissions do
|
|
222
221
|
|
223
222
|
|
224
223
|
it "checking ok read should not add to errors" do
|
225
|
-
|
226
|
-
|
224
|
+
Card::Auth.as_bot do
|
225
|
+
Card::Auth.always_ok?.should == true
|
227
226
|
end
|
228
|
-
|
229
|
-
|
227
|
+
Card::Auth.as(:joe_user) do
|
228
|
+
Card::Auth.always_ok?.should == false
|
230
229
|
end
|
231
|
-
|
232
|
-
|
230
|
+
Card::Auth.as(:joe_admin) do
|
231
|
+
Card::Auth.always_ok?.should == true
|
233
232
|
Card.create! :name=>"Hidden"
|
234
233
|
Card.create(:name=>'Hidden+*self+*read', :type=>'Pointer', :content=>'[[Anyone Signed In]]')
|
235
234
|
end
|
236
235
|
|
237
|
-
|
236
|
+
Card::Auth.as(:anonymous) do
|
238
237
|
h = Card.fetch('Hidden')
|
239
238
|
h.ok?(:read).should == false
|
240
239
|
h.errors.empty?.should_not == nil
|
@@ -242,7 +241,7 @@ describe Card::Set::All::Permissions do
|
|
242
241
|
end
|
243
242
|
|
244
243
|
it "should be granted to admin if to anybody" do
|
245
|
-
|
244
|
+
Card::Auth.as_bot do
|
246
245
|
c1 = Card['c1']
|
247
246
|
Card.create! :name=>'c1+*self+*comment', :type=>'Pointer', :content=>'[[r1]]'
|
248
247
|
c1.who_can( :comment ).should == [Card['r1'].id]
|
@@ -261,7 +260,7 @@ describe Card::Set::All::Permissions do
|
|
261
260
|
|
262
261
|
|
263
262
|
it "write user permissions" do
|
264
|
-
|
263
|
+
Card::Auth.as_bot do
|
265
264
|
@u1.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2]
|
266
265
|
@u2.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r3]
|
267
266
|
@u3.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2, @r3]
|
@@ -283,7 +282,7 @@ describe Card::Set::All::Permissions do
|
|
283
282
|
end
|
284
283
|
|
285
284
|
it "read group permissions" do
|
286
|
-
|
285
|
+
Card::Auth.as_bot do
|
287
286
|
@u1.fetch(:trait=>:roles).items = [@r1, @r2]
|
288
287
|
@u2.fetch(:trait=>:roles).items = [@r1, @r3]
|
289
288
|
|
@@ -302,7 +301,7 @@ describe Card::Set::All::Permissions do
|
|
302
301
|
end
|
303
302
|
|
304
303
|
it "write group permissions" do
|
305
|
-
|
304
|
+
Card::Auth.as_bot do
|
306
305
|
[1,2,3].each do |num|
|
307
306
|
Card.create(:name=>"c#{num}+*self+*update", :type=>'Pointer', :content=>"[[r#{num}]]")
|
308
307
|
end
|
@@ -328,7 +327,7 @@ describe Card::Set::All::Permissions do
|
|
328
327
|
end
|
329
328
|
|
330
329
|
it "read user permissions" do
|
331
|
-
|
330
|
+
Card::Auth.as_bot {
|
332
331
|
@u1.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2]
|
333
332
|
@u2.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r3]
|
334
333
|
@u3.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2, @r3]
|
@@ -351,14 +350,14 @@ describe Card::Set::All::Permissions do
|
|
351
350
|
|
352
351
|
context "create permissions" do
|
353
352
|
before do
|
354
|
-
|
353
|
+
Card::Auth.as_bot do
|
355
354
|
Card.create! :name=>'*structure+*right+*create', :type=>'Pointer', :content=>'[[Anyone Signed In]]'
|
356
355
|
Card.create! :name=>'*self+*right+*create', :type=>'Pointer', :content=>'[[Anyone Signed In]]'
|
357
356
|
end
|
358
357
|
end
|
359
358
|
|
360
359
|
it "should inherit" do
|
361
|
-
|
360
|
+
Card::Auth.as(:anyone_signed_in) do
|
362
361
|
Card.fetch( 'A+*self' ).ok?(:create).should be_true #explicitly granted above
|
363
362
|
Card.fetch( 'A+*right').ok?(:create).should be_false #by default restricted
|
364
363
|
|
@@ -372,17 +371,17 @@ describe Card::Set::All::Permissions do
|
|
372
371
|
|
373
372
|
it "private wql" do
|
374
373
|
# set up cards of type TestType, 2 with nil reader, 1 with role1 reader
|
375
|
-
|
374
|
+
Card::Auth.as_bot do
|
376
375
|
[@c1,@c2,@c3].each do |c|
|
377
376
|
c.update_attributes :content => 'WeirdWord'
|
378
377
|
end
|
379
378
|
Card.create(:name=>"c1+*self+*read", :type=>'Pointer', :content=>"[[u1]]")
|
380
379
|
end
|
381
380
|
|
382
|
-
|
381
|
+
Card::Auth.as(@u1) do
|
383
382
|
Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c1 c2 c3 )
|
384
383
|
end
|
385
|
-
|
384
|
+
Card::Auth.as(@u2) do
|
386
385
|
Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c2 c3 )
|
387
386
|
end
|
388
387
|
end
|
@@ -391,18 +390,18 @@ describe Card::Set::All::Permissions do
|
|
391
390
|
#warn "u1 roles #{Card[ @u1.id ].fetch(:trait=>:roles).item_names.inspect}"
|
392
391
|
|
393
392
|
# set up cards of type TestType, 2 with nil reader, 1 with role1 reader
|
394
|
-
|
393
|
+
Card::Auth.as_bot do
|
395
394
|
[@c1,@c2,@c3].each do |c|
|
396
395
|
c.update_attributes :content => 'WeirdWord'
|
397
396
|
end
|
398
397
|
Card.create(:name=>"c1+*self+*read", :type=>'Pointer', :content=>"[[r3]]")
|
399
398
|
end
|
400
399
|
|
401
|
-
|
400
|
+
Card::Auth.as(@u1) do
|
402
401
|
Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c1 c2 c3 )
|
403
402
|
end
|
404
|
-
|
405
|
-
|
403
|
+
Card::Auth.current_id =nil # for Card::Auth.as to be effective, you can't have a logged in user
|
404
|
+
Card::Auth.as(@u2) do
|
406
405
|
Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c2 c3 )
|
407
406
|
end
|
408
407
|
end
|
@@ -443,13 +442,13 @@ describe Card::Set::All::Permissions do
|
|
443
442
|
end
|
444
443
|
|
445
444
|
it "should let anonymous users view basic cards" do
|
446
|
-
|
445
|
+
Card::Auth.as :anonymous do
|
447
446
|
@c.ok?(:read).should be_true
|
448
447
|
end
|
449
448
|
end
|
450
449
|
|
451
450
|
it "should let joe user basic cards" do
|
452
|
-
|
451
|
+
Card::Auth.as :joe_user do
|
453
452
|
@c.ok?(:read).should be_true
|
454
453
|
end
|
455
454
|
end
|
@@ -460,7 +459,7 @@ describe Card::Set::All::Permissions do
|
|
460
459
|
end
|
461
460
|
|
462
461
|
it "should not allow someone not signed in to create Basic Cards" do
|
463
|
-
|
462
|
+
Card::Auth.as :anonymous do
|
464
463
|
Card.new.ok?(:create).should_not be_true
|
465
464
|
end
|
466
465
|
end
|
@@ -469,7 +468,7 @@ describe Card::Set::All::Permissions do
|
|
469
468
|
|
470
469
|
context "settings based permissions" do
|
471
470
|
before do
|
472
|
-
|
471
|
+
Card::Auth.as_bot do
|
473
472
|
@delete_rule_card = Card.fetch '*all+*delete', :new=>{}
|
474
473
|
@delete_rule_card.type_id = Card::PointerID
|
475
474
|
@delete_rule_card.content = '[[Joe_User]]'
|
@@ -480,16 +479,16 @@ describe Card::Set::All::Permissions do
|
|
480
479
|
it "should handle delete as a setting" do
|
481
480
|
c = Card.new :name=>'whatever'
|
482
481
|
c.who_can(:delete).should == [Card['joe_user'].id]
|
483
|
-
|
482
|
+
Card::Auth.as(:joe_user) do
|
484
483
|
c.ok?(:delete).should == true
|
485
484
|
end
|
486
|
-
|
485
|
+
Card::Auth.as(:u1) do
|
487
486
|
c.ok?(:delete).should == false
|
488
487
|
end
|
489
|
-
|
488
|
+
Card::Auth.as(:anonymous) do
|
490
489
|
c.ok?(:delete).should == false
|
491
490
|
end
|
492
|
-
|
491
|
+
Card::Auth.as_bot do
|
493
492
|
c.ok?(:delete).should == true #because administrator
|
494
493
|
end
|
495
494
|
end
|
@@ -1,14 +1,16 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require 'wagn/spec_helper'
|
3
2
|
|
4
3
|
|
5
4
|
#FIXME - this seems like a LOT of testing but it doesn't cover a ton of ground
|
6
5
|
# I think we should move the rendering tests into basic and trim this to about a quarter of its current length
|
7
6
|
|
8
7
|
describe Card do
|
9
|
-
context 'when there is a general toc
|
8
|
+
context 'when there is a general toc rule of 2' do
|
10
9
|
|
11
10
|
before do
|
11
|
+
Card::Auth.as_bot do
|
12
|
+
Card.create! :name=>'Basic+*type+*table of contents', :content=>'2'
|
13
|
+
end
|
12
14
|
(@c1 = Card['Onne Heading']).should be
|
13
15
|
(@c2 = Card['Twwo Heading']).should be
|
14
16
|
(@c3 = Card['Three Heading']).should be
|
@@ -25,13 +27,13 @@ describe Card do
|
|
25
27
|
|
26
28
|
describe "renders with/without toc" do
|
27
29
|
it "should not render for 'Onne Heading'" do
|
28
|
-
|
30
|
+
@c1.format.render_open_content.should_not match /Table of Contents/
|
29
31
|
end
|
30
32
|
it "should render for 'Twwo Heading'" do
|
31
|
-
|
33
|
+
@c2.format.render_open_content.should match /Table of Contents/
|
32
34
|
end
|
33
35
|
it "should render for 'Three Heading'" do
|
34
|
-
|
36
|
+
@c3.format.render_open_content.should match /Table of Contents/
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
@@ -51,12 +53,12 @@ describe Card do
|
|
51
53
|
sets.should == ['Cardtype A+*type', 'Cardtype A+*self', 'Cardtype A+*right']
|
52
54
|
end
|
53
55
|
# it "should show type plus right sets when they exist" do
|
54
|
-
#
|
56
|
+
# Card::Auth.as_bot { Card.create :name=>'Basic+A+*type plus right', :content=>'' }
|
55
57
|
# sets = Card['A'].related_sets
|
56
58
|
# sets.should == ['A+*self', 'A+*right', 'Basic+A+*type plus right']
|
57
59
|
# end
|
58
60
|
# it "should show type plus right sets when they exist, and type" do
|
59
|
-
#
|
61
|
+
# Card::Auth.as_bot { Card.create :name=>'Basic+Cardtype A+*type plus right', :content=>'' }
|
60
62
|
# sets = Card['Cardtype A'].related_sets
|
61
63
|
# sets.should == ['Cardtype A+*self', 'Cardtype A+*type', 'Cardtype A+*right', 'Basic+Cardtype A+*type plus right']
|
62
64
|
# end
|
@@ -65,14 +67,14 @@ describe Card do
|
|
65
67
|
sets.should == ['A+B+*self']
|
66
68
|
end
|
67
69
|
end
|
68
|
-
|
70
|
+
=begin
|
69
71
|
# class methods
|
70
72
|
describe ".default_rule" do
|
71
73
|
it 'should have default rule' do
|
72
74
|
Card.default_rule(:table_of_contents).should == '0'
|
73
75
|
end
|
74
76
|
end
|
75
|
-
|
77
|
+
=end
|
76
78
|
end
|
77
79
|
|
78
80
|
context "when I change the general toc setting to 1" do
|
@@ -94,15 +96,15 @@ describe Card do
|
|
94
96
|
|
95
97
|
describe "renders with/without toc" do
|
96
98
|
it "should not render toc for 'Onne Heading'" do
|
97
|
-
|
99
|
+
@c1.format.render_open_content.should match /Table of Contents/
|
98
100
|
end
|
99
101
|
it "should render toc for 'Twwo Heading'" do
|
100
|
-
|
102
|
+
@c2.format.render_open_content.should match /Table of Contents/
|
101
103
|
end
|
102
104
|
it "should not render for 'Twwo Heading' when changed to 3" do
|
103
105
|
@rule_card.content = "3"
|
104
106
|
@c2.rule(:table_of_contents).should == "3"
|
105
|
-
|
107
|
+
@c2.format.render_open_content.should_not match /Table of Contents/
|
106
108
|
end
|
107
109
|
end
|
108
110
|
|
@@ -111,7 +113,7 @@ describe Card do
|
|
111
113
|
context 'when I use CardtypeE cards' do
|
112
114
|
|
113
115
|
before do
|
114
|
-
|
116
|
+
Card::Auth.as_bot do
|
115
117
|
@c1 = Card.create :name=>'toc1', :type=>"CardtypeE",
|
116
118
|
:content=>Card['Onne Heading'].content
|
117
119
|
@c2 = Card.create :name=>'toc2', :type=>"CardtypeE",
|
@@ -137,13 +139,13 @@ describe Card do
|
|
137
139
|
|
138
140
|
describe "renders without toc" do
|
139
141
|
it "should not render for 'Onne Heading'" do
|
140
|
-
|
142
|
+
@c1.format.render_open_content.should_not match /Table of Contents/
|
141
143
|
end
|
142
144
|
it "should render for 'Twwo Heading'" do
|
143
|
-
|
145
|
+
@c2.format.render_open_content.should_not match /Table of Contents/
|
144
146
|
end
|
145
147
|
it "should render for 'Three Heading'" do
|
146
|
-
|
148
|
+
@c3.format.render_open_content.should_not match /Table of Contents/
|
147
149
|
end
|
148
150
|
end
|
149
151
|
|
@@ -158,25 +160,23 @@ describe Card do
|
|
158
160
|
end
|
159
161
|
end
|
160
162
|
|
163
|
+
=begin
|
161
164
|
# class methods
|
162
165
|
describe ".default_rule" do
|
163
166
|
it 'should have default rule' do
|
164
167
|
Card.default_rule(:table_of_contents).should == '0'
|
165
168
|
end
|
166
169
|
end
|
167
|
-
|
170
|
+
=end
|
168
171
|
end
|
169
172
|
|
170
173
|
context "when I create a new rule" do
|
171
174
|
before do
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
@
|
177
|
-
:content=>Card['Twwo Heading'].content
|
178
|
-
@c3 = Card.create :name=>'toc3', #:type=>"CardtypeE",
|
179
|
-
:content=>Card['Three Heading'].content
|
175
|
+
Card::Auth.as_bot do
|
176
|
+
Card.create! :name=>'Basic+*type+*table of contents', :content=>'2'
|
177
|
+
@c1 = Card.create! :name=>'toc1', :type=>"CardtypeE", :content=>Card['Onne Heading'].content
|
178
|
+
@c2 = Card.create! :name=>'toc2', :content=>Card['Twwo Heading'].content
|
179
|
+
@c3 = Card.create! :name=>'toc3', :content=>Card['Three Heading'].content
|
180
180
|
@c1.type_name.should == 'Cardtype E'
|
181
181
|
@rule_card = @c1.rule_card(:table_of_contents)
|
182
182
|
|
@@ -200,14 +200,14 @@ describe Card do
|
|
200
200
|
|
201
201
|
describe "renders with/without toc" do
|
202
202
|
it "should not render for 'Onne Heading'" do
|
203
|
-
|
203
|
+
@c1.format.render_open_content.should_not match /Table of Contents/
|
204
204
|
end
|
205
205
|
it "should render for 'Twwo Heading'" do
|
206
206
|
@c2.rule(:table_of_contents).should == "2"
|
207
|
-
|
207
|
+
@c2.format.render_open_content.should match /Table of Contents/
|
208
208
|
end
|
209
209
|
it "should render for 'Three Heading'" do
|
210
|
-
|
210
|
+
@c3.format.render_open_content.should match /Table of Contents/
|
211
211
|
end
|
212
212
|
end
|
213
213
|
end
|
@@ -234,14 +234,14 @@ describe Card do
|
|
234
234
|
|
235
235
|
describe "renders with/without toc" do
|
236
236
|
it "should not render toc for 'Onne Heading'" do
|
237
|
-
|
237
|
+
@c1.format.render_open_content.should match /Table of Contents/
|
238
238
|
end
|
239
239
|
it "should render toc for 'Twwo Heading'" do
|
240
|
-
|
240
|
+
@c2.format.render_open_content.should match /Table of Contents/
|
241
241
|
end
|
242
242
|
it "should not render for 'Twwo Heading' when changed to 3" do
|
243
243
|
@rule_card.content = "3"
|
244
|
-
|
244
|
+
@c2.format.render_open_content.should_not match /Table of Contents/
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|