card 1.98.3 → 1.99.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/config/locales/de.yml +7 -7
- data/config/locales/en.yml +7 -7
- data/config/locales/es.yml +7 -7
- data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +3 -3
- data/db/migrate_core_cards/20160801143221_change_bootstrap_card_type_to_scss.rb +1 -1
- data/db/migrate_core_cards/20160804112510_reorganize_scripts.rb +1 -1
- data/db/migrate_core_cards/20160908154210_add_trash_card.rb +1 -1
- data/db/migrate_core_cards/20180508210903_add_json_type.rb +3 -3
- data/db/migrate_core_cards/20180712042655_head_rule.rb +1 -1
- data/db/migrate_core_cards/{20180905061536_migrate_layouts.rb → 20180905061537_migrate_layouts.rb} +12 -1
- data/db/migrate_core_cards/20190204195039_add_rule_card.rb +3 -0
- data/db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb +5 -6
- data/db/migrate_core_cards/20190417142612_reorganize_scripts_2.rb +3 -3
- data/db/migrate_core_cards/20190502130029_add_shark_and_help_desk_role.rb +4 -5
- data/db/migrate_core_cards/20190618110446_add_dropdown_divider.rb +1 -1
- data/db/migrate_core_cards/20190710090209_homepage_tweaks.rb +17 -0
- data/db/migrate_core_cards/20190820155833_update_cardtype_type_structure.rb +7 -0
- data/db/migrate_core_cards/20190822093633_move_help_text_to_code.rb +38 -0
- data/db/migrate_core_cards/20190823220018_cleanup_for_decko_1_0.rb +21 -0
- data/db/migrate_core_cards/20190826132738_add_more_guides.rb +7 -0
- data/db/migrate_core_cards/20190829093961_cardtype_grouping.rb +16 -0
- data/db/migrate_core_cards/20190829205148_remove_add_help.rb +14 -0
- data/db/migrate_core_cards/20190830131820_setting_settings_aside.rb +17 -0
- data/db/migrate_core_cards/20190902161223_add_style_media.rb +7 -0
- data/db/migrate_core_cards/20190902193208_input_type.rb +22 -0
- data/db/migrate_core_cards/20190904174403_token_upgrade.rb +14 -0
- data/db/migrate_core_cards/20190909104250_add_cardtype_input_types.rb +10 -0
- data/db/migrate_core_cards/20190918200115_ensure_description_card.rb +13 -0
- data/db/migrate_core_cards/data/cards.yml +12 -8
- data/db/migrate_core_cards/data/cards/Xaccount +22 -0
- data/db/migrate_core_cards/data/cards/Xgetting_started +5 -5
- data/db/migrate_core_cards/data/cards/{Xgetting_started-link → Xgetting_started_link} +0 -0
- data/db/migrate_core_cards/data/cards/Xmain_menu +1 -1
- data/db/migrate_core_cards/data/cards/Xstructure-Xright-Xguide +12 -0
- data/db/migrate_core_cards/data/cards/administrator-dashboard +5 -0
- data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xguide +24 -0
- data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xstructure +3 -3
- data/db/migrate_core_cards/data/cards/shark-dashboard +2 -2
- data/db/migrate_core_cards/data/mailer/password_reset_email.html +6 -3
- data/db/migrate_core_cards/data/mailer/password_reset_email.txt +1 -1
- data/db/migrate_core_cards/data/mailer/verification_email.html +5 -2
- data/db/migrate_core_cards/data/mailer/verification_email.txt +2 -1
- data/db/seed/README.md +1 -1
- data/db/seed/new/card_actions.yml +2118 -2534
- data/db/seed/new/card_acts.yml +2 -2
- data/db/seed/new/card_references.yml +2326 -2466
- data/db/seed/new/cards.yml +2654 -3713
- data/db/seed/new/schema_migrations_core_cards.yml +77 -39
- data/db/seed/test/fixtures/card_actions.yml +3225 -3681
- data/db/seed/test/fixtures/card_acts.yml +503 -509
- data/db/seed/test/fixtures/card_changes.yml +66 -66
- data/db/seed/test/fixtures/card_references.yml +3135 -3275
- data/db/seed/test/fixtures/cards.yml +4187 -5516
- data/db/seed/test/fixtures/schema_migrations_core_cards.yml +77 -39
- data/db/{seed/test/seed.rb → test_seed.rb} +13 -11
- data/lib/card/auth.rb +1 -0
- data/lib/card/auth/current.rb +25 -27
- data/lib/card/auth/setup.rb +13 -12
- data/lib/card/auth/token.rb +38 -0
- data/lib/card/content.rb +34 -7
- data/lib/card/content/clean.rb +2 -1
- data/lib/card/content/truncate.rb +2 -0
- data/lib/card/env/success.rb +1 -14
- data/lib/card/error.rb +1 -0
- data/lib/card/format/content.rb +2 -2
- data/lib/card/format/error.rb +1 -1
- data/lib/card/format/nest.rb +1 -1
- data/lib/card/format/nesting.rb +2 -2
- data/lib/card/format/nesting/mode.rb +15 -15
- data/lib/card/mod/loader.rb +5 -0
- data/lib/card/model/save_helper.rb +2 -0
- data/lib/card/query.rb +1 -0
- data/lib/card/query/card_query/reference_attributes.rb +4 -2
- data/lib/card/seed_consts.rb +1 -1
- data/lib/card/set/format/abstract_format.rb +3 -5
- data/lib/card/set/format/abstract_format/view_opts.rb +1 -1
- data/lib/card/set/required_field.rb +8 -3
- data/lib/card/set_pattern.rb +10 -0
- data/lib/card/view/cache/stub.rb +3 -20
- data/lib/card/view/options.rb +4 -3
- data/lib/card/view/options/voo_api.rb +1 -1
- data/lib/cardio.rb +7 -1
- data/mod/Modfile +1 -0
- data/mod/account/set/abstract/account_field.rb +15 -0
- data/mod/account/set/abstract/accounted.rb +15 -0
- data/mod/account/set/all/account.rb +0 -4
- data/mod/account/set/right/account.rb +23 -151
- data/mod/account/set/right/account/events.rb +98 -0
- data/mod/account/set/right/account/views.rb +65 -0
- data/mod/account/set/right/api_key.rb +48 -0
- data/mod/account/set/right/email.rb +2 -2
- data/mod/account/set/right/password.rb +6 -9
- data/mod/account/set/right/salt.rb +5 -1
- data/mod/account/set/right/status.rb +10 -1
- data/mod/account/set/self/signin.rb +3 -3
- data/mod/account/set/type/role.rb +4 -0
- data/mod/account/set/type/signup.rb +31 -158
- data/mod/account/{template → set}/type/signup/core.haml +0 -0
- data/mod/account/set/type/signup/views.rb +93 -0
- data/mod/account/set/type/user.rb +16 -27
- data/mod/account/set/type/user/setup_help.haml +10 -0
- data/mod/account/spec/set/all/account_spec.rb +84 -98
- data/mod/account/spec/set/right/account_spec.rb +40 -33
- data/mod/account/spec/set/self/signin_spec.rb +2 -2
- data/mod/account/spec/set/type/signup_spec.rb +40 -78
- data/mod/ace_editor/db/migrate_core_cards/{20160805112548_delete_ace_help_card.rb → 20180805112548_delete_ace_help_card.rb} +1 -1
- data/mod/admin/set/self/debugger.rb +3 -0
- data/mod/admin/set/self/trash.rb +1 -1
- data/mod/basic_formats/set/all/all_css.rb +1 -1
- data/mod/basic_formats/set/all/all_csv.rb +1 -1
- data/mod/basic_formats/set/all/base.rb +19 -60
- data/mod/basic_formats/set/self/head.rb +1 -1
- data/mod/basic_types/set/type/html.rb +7 -3
- data/mod/basic_types/set/type/json.rb +1 -1
- data/mod/basic_types/set/type/plain_text.rb +1 -1
- data/mod/{standard → basic_types}/spec/set/type/html_spec.rb +6 -6
- data/mod/basic_types/spec/set/type/plain_text_spec.rb +7 -2
- data/mod/bootstrap/db/migrate_core_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +3 -3
- data/mod/bootstrap/db/migrate_core_cards/20180423160231_migrate_customized_bootstrap_skin.rb +2 -2
- data/mod/bootstrap/db/migrate_core_cards/20180423170283_add_type_bootswatch_skin.rb +1 -1
- data/mod/bootstrap/db/migrate_core_cards/lib/skin.rb +1 -1
- data/mod/bootstrap/lib/javascript/script_load_select2.js.coffee +26 -18
- data/mod/bootstrap/lib/stylesheets/style_bootstrap_cards.scss +18 -3
- data/mod/bootstrap/set/abstract/bootswatch_theme/html_views.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/helper.rb +9 -4
- data/mod/bootstrap/set/type/customized_bootswatch_skin.rb +1 -1
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors.rb +1 -1
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/{editor.haml → input.haml} +0 -0
- data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +2 -2
- data/mod/carrierwave/set/self/favicon.rb +5 -0
- data/mod/carrierwave/set/self/new_file.rb +1 -1
- data/mod/carrierwave/set/self/new_image.rb +1 -1
- data/mod/carrierwave/set/type/file.rb +1 -1
- data/mod/carrierwave/set/type/image.rb +2 -2
- data/mod/carrierwave/set/type/image/html_views.rb +0 -35
- data/mod/carrierwave/spec/set/type/image_spec.rb +1 -1
- data/mod/core/chunk/link.rb +4 -2
- data/mod/core/chunk/view_stub.rb +5 -4
- data/mod/core/set/abstract/code_file.rb +1 -1
- data/mod/core/set/all/codename.rb +2 -1
- data/mod/core/set/all/content.rb +59 -0
- data/mod/core/set/all/event_conditions.rb +17 -2
- data/mod/core/set/all/location_history.rb +1 -1
- data/mod/core/set/all/name.rb +1 -1
- data/mod/core/set/all/permissions.rb +6 -36
- data/mod/core/set/all/references.rb +9 -2
- data/mod/core/set/all/rules.rb +0 -5
- data/mod/core/set_pattern/03_type.rb +4 -0
- data/mod/core/set_pattern/07_right.rb +4 -0
- data/mod/core/set_pattern/08_type_plus_right.rb +4 -0
- data/mod/core/set_pattern/09_self.rb +4 -0
- data/mod/core/spec/chunk/link_spec.rb +6 -0
- data/mod/core/spec/chunk/nest_spec.rb +2 -2
- data/mod/core/spec/set/all/permissions_spec.rb +0 -10
- data/mod/core/spec/set/all/rules_spec.rb +6 -16
- data/mod/date/set/self/datepicker.rb +6 -0
- data/mod/date/set/type/date.rb +1 -1
- data/mod/date/spec/set/type/date_spec.rb +1 -1
- data/mod/edit/set/all/bridge/account_section.rb +16 -0
- data/mod/edit/set/all/bridge/bridge_pills.rb +47 -0
- data/mod/edit/set/all/bridge/related_section.rb +34 -0
- data/mod/edit/set/all/bridge/tab_views.rb +9 -40
- data/mod/edit/set/all/bridge/tab_visibility.rb +2 -2
- data/mod/edit/set/all/edit_content.rb +3 -3
- data/mod/edit/set/all/edit_inline.rb +15 -4
- data/mod/edit/set/all/edit_name.rb +5 -7
- data/mod/edit/set/all/edit_type.rb +25 -23
- data/mod/edit/set/all/editing.rb +5 -1
- data/mod/edit/set/all/editor.rb +28 -15
- data/mod/edit/set/all/form.rb +38 -17
- data/mod/edit/set/all/form_buttons.rb +11 -2
- data/mod/edit/set/all/formgroup.rb +5 -5
- data/mod/edit/set/all/nest_editor.rb +20 -4
- data/mod/edit/set/all/nest_editor/_help.haml +7 -0
- data/mod/edit/set/all/nest_editor/nest_editor.haml +3 -2
- data/mod/edit/set/all/new.rb +40 -23
- data/mod/edit/set/all/overlay_guide.haml +7 -0
- data/mod/edit/set/all/overlay_guide.rb +9 -0
- data/mod/edit/set/all/template_nest.rb +42 -0
- data/mod/edit/set/type/list.rb +15 -0
- data/mod/edit/set/type/plain_text.rb +13 -0
- data/mod/edit/set/type/pointer.rb +11 -0
- data/mod/edit/spec/set/all/bridge/tab_views_spec.rb +1 -1
- data/mod/email/set/all/email_html.rb +2 -2
- data/mod/email/set/all/email_text.rb +2 -2
- data/mod/follow/lib/card/follower_stash.rb +1 -1
- data/mod/follow/set/all/follow/followed_by.rb +1 -1
- data/mod/follow/set/all/notify/base_views.rb +3 -3
- data/mod/follow/set/right/following.rb +1 -1
- data/mod/follow/set/self/follow_defaults.rb +1 -1
- data/mod/follow/set/type/cardtype.rb +6 -0
- data/mod/follow/set/type_plus_right/user/follow.rb +1 -1
- data/mod/history/lib/card/act/act_renderer.rb +1 -1
- data/mod/history/lib/card/action.rb +2 -1
- data/mod/history/set/all/history_bridge.rb +0 -1
- data/mod/item/set/all/bar.rb +15 -7
- data/mod/machines/file/all_script_machine_output/file.js +38245 -69
- data/mod/machines/file/all_style_machine_output/file.css +4 -4
- data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +1 -1
- data/mod/machines/lib/javascript/decko/bridge.js.coffee +4 -0
- data/mod/machines/lib/javascript/decko/card_menu.js.coffee +11 -0
- data/mod/machines/lib/javascript/decko/name_editor.js.coffee +1 -1
- data/mod/machines/lib/javascript/decko/nest_editor.js.coffee +3 -1
- data/mod/machines/lib/javascript/decko/nest_editor_name.js.coffee +29 -6
- data/mod/machines/lib/javascript/decko/overlay.js.coffee +3 -2
- data/mod/machines/lib/javascript/decko/slot.js.coffee +12 -2
- data/mod/machines/lib/stylesheets/style_cards.scss +43 -53
- data/mod/machines/lib/stylesheets/style_jquery_ui_smoothness.css +13 -13
- data/mod/machines/set/abstract/script.rb +1 -1
- data/mod/machines/set/type/css.rb +1 -1
- data/mod/media/lib/stylesheets/style_image_box.scss +79 -0
- data/mod/{utility → media}/set/abstract/media.rb +0 -0
- data/mod/{utility → media}/set/abstract/media/media_snippet.haml +0 -0
- data/mod/media/set/self/style_media.rb +6 -0
- data/mod/media/set/type/image.rb +38 -0
- data/mod/{utility → media}/spec/set/abstract/media_spec.rb +0 -0
- data/mod/navbar/set/right/enabled_roles.rb +1 -1
- data/mod/pointer/lib/javascript/script_pointer_config.js.coffee +13 -0
- data/mod/pointer/lib/javascript/script_pointer_list_editor.js.coffee +7 -2
- data/mod/pointer/set/abstract/02_pointer/html_views.rb +15 -6
- data/mod/pointer/set/abstract/02_pointer/html_views/checkbox_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/html_views/list_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/html_views/list_item.haml +2 -0
- data/mod/pointer/set/abstract/02_pointer/html_views/radio_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/options_api.rb +6 -13
- data/mod/pointer/set/right/{options.rb → content_options.rb} +0 -0
- data/mod/pointer/set/type/link_list.rb +23 -6
- data/mod/pointer/set/type/link_list/link_list_input.haml +24 -0
- data/mod/pointer/set/type/mirrored_list.rb +1 -1
- data/mod/pointer/spec/set/abstract/pointer/html_views_spec.rb +20 -18
- data/mod/pointer/spec/set/abstract/pointer/options_api_spec.rb +2 -1
- data/mod/pointer/spec/set/self/input_options_spec.rb +1 -1
- data/mod/rules/set/right/self.rb +3 -0
- data/mod/rules/set/rule/bar_view.rb +88 -0
- data/mod/rules/set/rule/bridge_rules_editor.rb +5 -10
- data/mod/rules/set/rule/editor.rb +40 -113
- data/mod/rules/set/rule/html_views.rb +13 -0
- data/mod/rules/set/rule/quick_editor.rb +39 -0
- data/mod/rules/set/rule/{editor → quick_editor}/quick_edit.haml +0 -0
- data/mod/rules/set/rule/{editor → quick_editor}/set_info.haml +1 -1
- data/mod/rules/set/rule/rule_form/buttons.rb +3 -1
- data/mod/rules/set/rule/rule_form/form_elements.rb +2 -2
- data/mod/rules/set/rule/rule_form/rule_set_radio.rb +3 -6
- data/mod/rules/set/rule/rule_form/set_selection.rb +3 -10
- data/mod/rules/set/rule/rules.rb +10 -1
- data/mod/rules/set/type/set.rb +37 -20
- data/mod/rules/set/type/set/html_views.rb +17 -35
- data/mod/rules/set/type/set/html_views/group_panel.haml +1 -1
- data/mod/rules/set/type/set/html_views/rule_lists.rb +42 -0
- data/mod/rules/set/type/set/html_views/template.rb +1 -32
- data/mod/rules/set/type/set/rules_filter.rb +24 -10
- data/mod/rules/set/type/set/setting_lists.rb +17 -24
- data/mod/rules/spec/set/rule/bar_view_spec.rb +15 -0
- data/mod/rules/spec/set/rule/editor_spec.rb +15 -1
- data/mod/rules/spec/set/type/set/html_views_spec.rb +0 -13
- data/mod/rules/spec/set/type/set/setting_lists_spec.rb +17 -0
- data/mod/rules/spec/set/type/set_spec.rb +3 -8
- data/mod/search/set/abstract/03_filter/form_helper.rb +9 -7
- data/mod/search/set/abstract/search/views.rb +2 -2
- data/mod/search/set/right/children.rb +4 -0
- data/mod/search/set/right/created.rb +3 -0
- data/mod/search/set/right/edited.rb +3 -0
- data/mod/search/set/right/editors.rb +3 -0
- data/mod/search/set/right/follow.rb +3 -0
- data/mod/search/set/right/linked_to_by.rb +3 -0
- data/mod/search/set/right/links_to.rb +3 -0
- data/mod/search/set/right/mates.rb +3 -0
- data/mod/search/set/right/nested_by.rb +3 -0
- data/mod/search/set/right/nests.rb +3 -0
- data/mod/search/set/right/referred_to_by.rb +3 -0
- data/mod/search/set/right/refers_to.rb +3 -0
- data/mod/search/set/self/search.rb +1 -1
- data/mod/search/set/type/search_type.rb +6 -5
- data/mod/settings/lib/card/setting.rb +17 -4
- data/mod/settings/set/abstract/permission.rb +6 -2
- data/mod/settings/set/all/supports_content_options.rb +7 -0
- data/mod/settings/set/right/content_option_view.rb +10 -0
- data/mod/settings/set/right/content_options.rb +18 -0
- data/mod/settings/set/right/default.rb +18 -2
- data/mod/settings/set/right/help.rb +2 -1
- data/mod/settings/set/right/input_type.rb +35 -0
- data/mod/settings/set/right/script.rb +6 -0
- data/mod/settings/set/right/structure.rb +7 -1
- data/mod/settings/set/right/style.rb +2 -2
- data/mod/settings/set/right/style/{editor.haml → input.haml} +0 -0
- data/mod/settings/set/self/autoname.rb +3 -1
- data/mod/settings/set/self/captcha.rb +4 -1
- data/mod/settings/set/self/content_option_view.rb +10 -0
- data/mod/settings/set/self/content_options.rb +10 -0
- data/mod/settings/set/self/create.rb +2 -1
- data/mod/settings/set/self/default.rb +1 -1
- data/mod/settings/set/self/delete.rb +2 -1
- data/mod/settings/set/self/guide.rb +1 -1
- data/mod/settings/set/self/head.rb +3 -1
- data/mod/settings/set/self/help.rb +3 -1
- data/mod/settings/set/self/input_type.rb +13 -0
- data/mod/settings/set/self/layout.rb +3 -1
- data/mod/settings/set/self/on_create.rb +2 -1
- data/mod/settings/set/self/on_delete.rb +2 -1
- data/mod/settings/set/self/on_update.rb +2 -1
- data/mod/settings/set/self/read.rb +2 -1
- data/mod/settings/set/self/structure.rb +3 -1
- data/mod/settings/set/self/style.rb +3 -1
- data/mod/settings/set/self/table_of_contents.rb +4 -1
- data/mod/settings/set/self/thanks.rb +3 -1
- data/mod/settings/set/self/update.rb +2 -1
- data/mod/settings/set/type/setting.rb +15 -37
- data/mod/settings/spec/set/right/comment_spec.rb +0 -27
- data/mod/settings/spec/set/right/create_spec.rb +1 -1
- data/mod/settings/spec/set/right/structure_spec.rb +13 -10
- data/mod/settings/spec/set/type/setting_spec.rb +1 -8
- data/mod/solid_cache/set/right/solid_cache.rb +3 -3
- data/mod/standard/set/all/comment.rb +1 -1
- data/mod/standard/set/all/error.rb +2 -2
- data/mod/standard/set/all/path.rb +7 -7
- data/mod/standard/set/all/rich_html/content.rb +41 -11
- data/mod/standard/set/all/rich_html/error.rb +14 -22
- data/mod/standard/set/all/rich_html/html_views/guide.rb +1 -1
- data/mod/standard/set/all/rich_html/html_views/help.rb +19 -7
- data/mod/standard/set/all/rich_html/html_views/info.rb +1 -1
- data/mod/standard/set/all/rich_html/menu.rb +50 -2
- data/mod/standard/set/all/rich_html/overlay.rb +23 -1
- data/mod/standard/set/all/rich_html/title.rb +3 -3
- data/mod/standard/set/right/discussion.rb +8 -2
- data/mod/standard/set/right/head.rb +4 -0
- data/mod/standard/set/right/type_plus_right.rb +4 -0
- data/mod/standard/set/self/cardtype.rb +42 -0
- data/mod/standard/set/self/sidebar.rb +5 -0
- data/mod/standard/set/type/basic.rb +1 -1
- data/mod/standard/set/type/cardtype.rb +25 -11
- data/mod/standard/set/type/number.rb +1 -1
- data/mod/standard/set/type/phrase.rb +1 -1
- data/mod/standard/set/type/toggle.rb +9 -1
- data/mod/standard/set/type/uri.rb +1 -1
- data/mod/standard/spec/set/all/error_spec.rb +1 -1
- data/mod/standard/spec/set/type/cardtype_spec.rb +4 -3
- data/mod/standard/spec/set/type/number_spec.rb +1 -1
- data/mod/standard/spec/set/type/phrase_spec.rb +1 -1
- data/mod/standard/spec/set/type/toggle_spec.rb +3 -4
- data/mod/standard/spec/set/type/uri_spec.rb +1 -1
- data/mod/tinymce_editor/set/self/tiny_mce.rb +7 -0
- metadata +116 -52
- data/db/migrate_core_cards/20190710090207_homepage_tweaks.rb +0 -12
- data/db/migrate_core_cards/data/cards/eagle-description +0 -1
- data/mod/account/set/right/token.rb +0 -55
- data/mod/account/spec/set/right/token_spec.rb +0 -23
- data/mod/bootstrap/set/abstract/bootswatch_theme/thumbnail.haml +0 -10
- data/mod/rules/set/rule/table.rb +0 -27
- data/mod/rules/set/rule/table_row.rb +0 -63
- data/mod/rules/set/type/set/html_views/nest_rules.rb +0 -14
- data/mod/rules/set/type/set/html_views/rules_bridge.rb +0 -21
- data/mod/rules/set/type/set/html_views/rules_table.haml +0 -11
- data/mod/rules/set/type/set/html_views/template/template_editor.haml +0 -6
- data/mod/rules/spec/set/rule/table_row_spec.rb +0 -9
- data/mod/rules/spec/set/rule/table_spec.rb +0 -15
- data/mod/settings/set/right/add_help.rb +0 -1
- data/mod/settings/set/self/accountable.rb +0 -3
- data/mod/settings/set/self/add_help.rb +0 -2
- data/mod/settings/set/self/input.rb +0 -3
- data/mod/settings/set/self/options.rb +0 -4
- data/mod/settings/set/self/options_label.rb +0 -4
- data/mod/settings/spec/set/right/add_help_spec.rb +0 -5
@@ -0,0 +1,10 @@
|
|
1
|
+
%h3 First, set up an account.
|
2
|
+
.pb-2
|
3
|
+
As the first account holder for this deck, you will automatically have several
|
4
|
+
permissioned roles. You can configure these roles at any time.
|
5
|
+
|
6
|
+
|
7
|
+
- if Card.config.action_mailer.perform_deliveries == false
|
8
|
+
.bg-warning.p-3
|
9
|
+
WARNING: Email delivery is turned off.
|
10
|
+
Change settings in config/application.rb to send sign up notifications.
|
@@ -1,127 +1,113 @@
|
|
1
1
|
RSpec.describe Card::Set::All::Account do
|
2
|
-
describe "
|
3
|
-
it "
|
4
|
-
expect(Card
|
2
|
+
describe "parties" do
|
3
|
+
it "for Wagn Bot", with_user: Card::WagnBotID do
|
4
|
+
expect(Card::Auth.current.parties.sort)
|
5
|
+
.to eq([Card::WagnBotID, Card::AnyoneSignedInID, Card::AdministratorID])
|
5
6
|
end
|
6
7
|
|
7
|
-
it "
|
8
|
-
Card.
|
9
|
-
Card.create name: "*account+*right+*create",
|
10
|
-
content: "[[Anyone Signed In]]"
|
11
|
-
expect(Card["A"].accountable?).to eq(true)
|
8
|
+
it "for Anonymous", with_user: Card::AnonymousID do
|
9
|
+
expect(Card::Auth.current.parties.sort).to eq([Card::AnonymousID])
|
12
10
|
end
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
)
|
12
|
+
context "for Joe User" do
|
13
|
+
before do
|
14
|
+
@joe_user_card = Card::Auth.current
|
15
|
+
@parties = @joe_user_card.parties # note: must be called to test resets
|
19
16
|
end
|
20
17
|
|
21
|
-
it "
|
22
|
-
expect(
|
18
|
+
it "initially has only auth and self " do
|
19
|
+
expect(@parties)
|
20
|
+
.to eq([Card::AnyoneSignedInID, Card::SharkID, @joe_user_card.id])
|
23
21
|
end
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
Card::Auth.current_id = Card::Auth.current_id
|
46
|
-
# simulate new request
|
47
|
-
# current_id assignment clears several class variables
|
48
|
-
|
49
|
-
new_parties = [Card::AnyoneSignedInID, r1.id, @joe_user_card.id]
|
50
|
-
expect(Card["Joe User"].parties).to eq(new_parties)
|
51
|
-
# @parties regenerated, now with correct values
|
52
|
-
|
53
|
-
expect(Card::Auth.current.parties).to eq(new_parties)
|
54
|
-
# @joe_user_card.refresh(force=true).parties.should == new_parties
|
55
|
-
# should work, but now superfluous?
|
56
|
-
end
|
23
|
+
it "updates when new roles are set" do
|
24
|
+
roles_card = @joe_user_card.fetch trait: :roles, new: {}
|
25
|
+
r1 = Card["r1"]
|
26
|
+
|
27
|
+
Card::Auth.as_bot { roles_card.items = [r1.id] }
|
28
|
+
Card::Cache.restore
|
29
|
+
# simulate new request
|
30
|
+
# clears local cache, where, eg, @parties would still be cached on card
|
31
|
+
|
32
|
+
Card::Auth.current_id = Card::Auth.current_id
|
33
|
+
# simulate new request
|
34
|
+
# current_id assignment clears several class variables
|
35
|
+
|
36
|
+
new_parties = [Card::AnyoneSignedInID, r1.id, @joe_user_card.id]
|
37
|
+
expect(Card["Joe User"].parties).to eq(new_parties)
|
38
|
+
# @parties regenerated, now with correct values
|
39
|
+
|
40
|
+
expect(Card::Auth.current.parties).to eq(new_parties)
|
41
|
+
# @joe_user_card.refresh(force=true).parties.should == new_parties
|
42
|
+
# should work, but now superfluous?
|
57
43
|
end
|
58
44
|
end
|
45
|
+
end
|
59
46
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
47
|
+
describe "among?" do
|
48
|
+
it "is true for self" do
|
49
|
+
expect(Card::Auth.current.among?([Card::Auth.current_id])).to be_truthy
|
64
50
|
end
|
51
|
+
end
|
65
52
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
53
|
+
describe "+*email" do
|
54
|
+
it "creates a card and account card" do
|
55
|
+
jadmin = Card["joe admin"]
|
56
|
+
Card::Auth.current_id = jadmin.id
|
57
|
+
# simulate login to get correct from address
|
71
58
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
59
|
+
Card::Env[:params] = { email: { subject: "Hey Joe!",
|
60
|
+
message: "Come on in." } }
|
61
|
+
Card.create! name: "Joe New",
|
62
|
+
type_id: Card::UserID,
|
63
|
+
"+*account" => { "+*email" => "joe@new.com" }
|
77
64
|
|
78
|
-
|
79
|
-
|
65
|
+
c = Card["Joe New"]
|
66
|
+
u = Card::Auth.find_account_by_email("joe@new.com")
|
80
67
|
|
81
|
-
|
82
|
-
|
83
|
-
end
|
68
|
+
expect(c.account).to eq(u)
|
69
|
+
expect(c.type_id).to eq(Card::UserID)
|
84
70
|
end
|
71
|
+
end
|
85
72
|
|
86
|
-
|
87
|
-
|
88
|
-
|
73
|
+
context "updates" do
|
74
|
+
let(:card) {Card["Joe User"]}
|
75
|
+
let(:account) {card.account}
|
89
76
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
77
|
+
it "handles email updates" do
|
78
|
+
card.update! "+*account" => { "+*email" => "joe@user.co.uk" }
|
79
|
+
expect(account.email).to eq("joe@user.co.uk")
|
80
|
+
end
|
94
81
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
82
|
+
it "lets Wagn Bot block accounts", as_bot: true do
|
83
|
+
card.account.status_card.update! content: "blocked"
|
84
|
+
expect(account.blocked?).to be_truthy
|
85
|
+
end
|
99
86
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
end
|
87
|
+
it "does not allow a user to block or unblock himself" do
|
88
|
+
expect do
|
89
|
+
account.status_card.update! content: "blocked"
|
90
|
+
end.to raise_error(ActiveRecord::RecordInvalid,
|
91
|
+
"Validation failed: Permission denied You don't have "\
|
92
|
+
"permission to change the status of your own account")
|
93
|
+
expect(account.blocked?).to be_falsey
|
108
94
|
end
|
95
|
+
end
|
109
96
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
97
|
+
describe "#read_rules" do
|
98
|
+
before(:all) do
|
99
|
+
@read_rules = Card["joe_user"].read_rules
|
100
|
+
end
|
114
101
|
|
115
|
-
|
116
|
-
|
117
|
-
|
102
|
+
it "*all+*read should apply to Joe User" do
|
103
|
+
expect(@read_rules.member?(Card.fetch("*all+*read").id)).to be_truthy
|
104
|
+
end
|
118
105
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
end
|
106
|
+
it "11 more should apply to Joe Admin" do
|
107
|
+
# includes lots of account rules...
|
108
|
+
Card::Auth.as("joe_admin") do
|
109
|
+
ids = Card::Auth.as_card.read_rules
|
110
|
+
expect(ids.length).to eq(@read_rules.size + 17)
|
125
111
|
end
|
126
112
|
end
|
127
113
|
end
|
@@ -27,18 +27,17 @@ RSpec.describe Card::Set::Right::Account do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "checks accountability of 'accounted' card" do
|
30
|
-
|
31
|
-
|
30
|
+
expect(Card.create(dummy_account_args).errors["+*account"].first)
|
31
|
+
.to match(/You don\'t have permission to create/)
|
32
32
|
end
|
33
33
|
|
34
|
-
it "works for any
|
34
|
+
it "works for any card with +*account permissions -- not just User type" do
|
35
35
|
Card::Auth.as_bot do
|
36
|
-
|
37
|
-
|
36
|
+
Card.create! name: Card::Name[%i[basic account type_plus_right create]],
|
37
|
+
content: "Anyone Signed In"
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
expect(accountable.errors).to be_empty
|
40
|
+
expect(Card.create(dummy_account_args).errors).to be_empty
|
42
41
|
end
|
43
42
|
|
44
43
|
it "requires email" do
|
@@ -51,12 +50,12 @@ RSpec.describe Card::Set::Right::Account do
|
|
51
50
|
end
|
52
51
|
end
|
53
52
|
|
54
|
-
describe "#
|
53
|
+
describe "#send_verification_email" do
|
55
54
|
before do
|
56
55
|
@email = "joe@user.com"
|
57
56
|
@account = Card::Auth.find_account_by_email(@email)
|
58
57
|
Mail::TestMailer.deliveries.clear
|
59
|
-
@account.
|
58
|
+
@account.send_verification_email
|
60
59
|
@mail = Mail::TestMailer.deliveries.last
|
61
60
|
end
|
62
61
|
|
@@ -71,8 +70,9 @@ RSpec.describe Card::Set::Right::Account do
|
|
71
70
|
|
72
71
|
it "contains link to verify account" do
|
73
72
|
raw_source = @mail.parts[0].body.raw_source
|
74
|
-
["/update/#{@account.
|
75
|
-
"
|
73
|
+
["/update/#{@account.name.url_key}",
|
74
|
+
"card%5Btrigger%5D=verify_and_activate",
|
75
|
+
"token="].each do |url_part|
|
76
76
|
expect(raw_source).to include(url_part)
|
77
77
|
end
|
78
78
|
end
|
@@ -83,12 +83,29 @@ RSpec.describe Card::Set::Right::Account do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
describe "#
|
86
|
+
describe "#verify_and_activate" do
|
87
|
+
it "activates account" do
|
88
|
+
user = Card.create!(
|
89
|
+
name: "TmpUser",
|
90
|
+
type_id: Card::UserID,
|
91
|
+
"+*account" => { "+*password" => "tmp_pass",
|
92
|
+
"+*email" => "tmp@decko.org",
|
93
|
+
"+*status" => "unverified" }
|
94
|
+
)
|
95
|
+
|
96
|
+
Card::Env.params[:token] = Card::Auth::Token.encode user.id, anonymous: true
|
97
|
+
user.account.update! trigger: :verify_and_activate
|
98
|
+
|
99
|
+
expect(user.account).to be_active
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "#send_password_reset_email" do
|
87
104
|
before do
|
88
105
|
@email = "joe@user.com"
|
89
106
|
@account = Card::Auth.find_account_by_email(@email)
|
90
107
|
Mail::TestMailer.deliveries = []
|
91
|
-
@account.
|
108
|
+
@account.send_password_reset_email
|
92
109
|
@mail = Mail::TestMailer.deliveries.last
|
93
110
|
end
|
94
111
|
|
@@ -99,10 +116,8 @@ RSpec.describe Card::Set::Right::Account do
|
|
99
116
|
|
100
117
|
it "contains password reset link" do
|
101
118
|
raw_source = @mail.parts[0].body.raw_source
|
102
|
-
token = @account.token_card.refresh(true).content
|
103
119
|
["/update/#{@account.left.name.url_key}",
|
104
|
-
"token
|
105
|
-
"live_token=true",
|
120
|
+
"token=",
|
106
121
|
"card%5Btrigger%5D=reset_password"].each do |url_part|
|
107
122
|
expect(raw_source).to include(url_part)
|
108
123
|
end
|
@@ -136,39 +151,31 @@ RSpec.describe Card::Set::Right::Account do
|
|
136
151
|
before do
|
137
152
|
@email = "joe@user.com"
|
138
153
|
@account = Card::Auth.find_account_by_email(@email)
|
139
|
-
@account.send_reset_password_token
|
140
|
-
@token = @account.token
|
141
|
-
Card::Env.params[:token] = @token
|
142
154
|
Card::Auth.current_id = Card::AnonymousID
|
143
155
|
end
|
144
156
|
|
145
157
|
let(:trigger_reset) { @account.update! trigger: :reset_password }
|
146
158
|
|
159
|
+
def auth_token extra_payload={}
|
160
|
+
Card::Env.params[:token] = Card::Auth::Token.encode @account.left_id, extra_payload
|
161
|
+
end
|
162
|
+
|
147
163
|
it "authenticates with correct token" do
|
164
|
+
auth_token
|
148
165
|
expect(Card::Auth.current_id).to eq(Card::AnonymousID)
|
149
166
|
trigger_reset
|
150
167
|
expect(Card::Auth.current_id).to eq(@account.left_id)
|
151
|
-
@account = @account.refresh true
|
152
168
|
end
|
153
169
|
|
154
170
|
it "does not work if token is expired" do
|
155
|
-
|
156
|
-
|
157
|
-
@account.token_card.expire
|
158
|
-
|
159
|
-
trigger_reset
|
160
|
-
|
161
|
-
expect(@account.token).not_to eq(@token)
|
162
|
-
# token gets updated
|
163
|
-
|
164
|
-
expect(@account.success.message).to match(/expired/)
|
171
|
+
auth_token exp: 1.days.ago.to_i
|
172
|
+
expect { trigger_reset }.to raise_error(/Signature has expired/)
|
165
173
|
# user notified of expired token
|
166
174
|
end
|
167
175
|
|
168
176
|
it "does not work if token is wrong" do
|
169
|
-
Card::Env.params[:token] =
|
170
|
-
trigger_reset
|
171
|
-
expect(Card::Env.success[:message]).to match(/mismatch/)
|
177
|
+
Card::Env.params[:token] = auth_token + "xxx"
|
178
|
+
expect { trigger_reset }.to raise_error(/Signature verification raised/)
|
172
179
|
end
|
173
180
|
end
|
174
181
|
end
|
@@ -53,8 +53,8 @@ RSpec.describe Card::Set::Self::Signin do
|
|
53
53
|
context "#reset password" do
|
54
54
|
it "is triggered by an update" do
|
55
55
|
# Card['joe admin'].account.token.should be_nil FIXME: this should be t
|
56
|
-
@card.update! "+*email" => "joe@admin.com"
|
57
|
-
expect(
|
56
|
+
@card.update! "+*email" => "joe@admin.com", trigger: :send_reset_password_token
|
57
|
+
expect(Mail::TestMailer.deliveries.last.to.first).to eq("joe@admin.com")
|
58
58
|
end
|
59
59
|
|
60
60
|
it "returns an error if email is not found" do
|
@@ -5,6 +5,14 @@ RSpec.describe Card::Set::Type::Signup do
|
|
5
5
|
Card::Auth.current_id = Card::AnonymousID
|
6
6
|
end
|
7
7
|
|
8
|
+
let :big_bad_signup do
|
9
|
+
Mail::TestMailer.deliveries.clear
|
10
|
+
Card.create!(
|
11
|
+
name: "Big Bad Wolf", type_id: Card::SignupID,
|
12
|
+
"+*account" => { "+*email" => "wolf@wagn.org", "+*password" => "wolf" }
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
8
16
|
context "signup form form" do
|
9
17
|
subject do
|
10
18
|
Card.new(type_id: Card::SignupID).format.render! :new
|
@@ -19,29 +27,21 @@ RSpec.describe Card::Set::Type::Signup do
|
|
19
27
|
|
20
28
|
context "signup (without approval)" do
|
21
29
|
before do
|
22
|
-
ActionMailer::Base.deliveries = [] # needed?
|
23
|
-
|
24
30
|
Card::Auth.as_bot do
|
25
31
|
Card.create! name: "User+*type+*create", content: "[[Anyone]]"
|
26
32
|
end
|
27
|
-
|
28
33
|
Card::Auth.current_id = Card::AnonymousID
|
29
|
-
@signup = Card.create!(
|
30
|
-
name: "Big Bad Wolf", type_id: Card::SignupID,
|
31
|
-
"+*account" => { "+*email" => "wolf@wagn.org", "+*password" => "wolf" }
|
32
|
-
)
|
33
34
|
|
35
|
+
@signup = big_bad_signup
|
34
36
|
@account = @signup.account
|
35
|
-
@token = @account.token
|
36
37
|
end
|
37
38
|
|
38
39
|
it "creates all the necessary cards" do
|
39
40
|
expect(@signup.type_id).to eq(Card::SignupID)
|
40
41
|
expect(@account.email).to eq("wolf@wagn.org")
|
41
|
-
expect(@account.status).to eq("
|
42
|
+
expect(@account.status).to eq("unverified")
|
42
43
|
expect(@account.salt).not_to eq("")
|
43
44
|
expect(@account.password.length).to be > 10 # encrypted
|
44
|
-
expect(@account.token).to be_present
|
45
45
|
end
|
46
46
|
|
47
47
|
it "renders in core view" do
|
@@ -50,9 +50,9 @@ RSpec.describe Card::Set::Type::Signup do
|
|
50
50
|
expect(@signup.format.render_core).to have_tag "div.invite-links" do
|
51
51
|
with_tag "div", text: "A verification email has been sent to wolf@wagn.org"
|
52
52
|
with_tag "div" do
|
53
|
-
with_tag "a", href: "/update/Big_Bad_Wolf?
|
53
|
+
with_tag "a", href: "/update/Big_Bad_Wolf?approve_with_verification=true",
|
54
54
|
text: "Resend verification email"
|
55
|
-
with_tag "a", href: "/update/Big_Bad_Wolf?
|
55
|
+
with_tag "a", href: "/update/Big_Bad_Wolf?approve_without_verification=true",
|
56
56
|
text: "Approve without verification"
|
57
57
|
with_tag "a", href: "/delete/Big_Bad_Wolf",
|
58
58
|
text: "Deny and delete"
|
@@ -67,74 +67,41 @@ RSpec.describe Card::Set::Type::Signup do
|
|
67
67
|
expect(body).to match(Card.global_setting(:title))
|
68
68
|
end
|
69
69
|
|
70
|
-
it "creates an authenticable token" do
|
71
|
-
expect(@account.token).to eq(@token)
|
72
|
-
expect(@account.validate_token!(@token)).to be_truthy
|
73
|
-
expect(@account.errors).to be_empty
|
74
|
-
end
|
75
|
-
|
76
70
|
it "notifies someone" do
|
77
71
|
expect(ActionMailer::Base.deliveries.map(&:to).sort).to(
|
78
72
|
eq [["signups@wagn.org"], ["wolf@wagn.org"]]
|
79
73
|
)
|
80
74
|
end
|
81
75
|
|
82
|
-
it "
|
83
|
-
Card::Env.params[:token] = @
|
84
|
-
|
85
|
-
|
76
|
+
it "can be activated by verification token" do
|
77
|
+
Card::Env.params[:token] = Card::Auth::Token.encode @signup.id, anonymous: true
|
78
|
+
account = @signup.account
|
79
|
+
account.update! trigger: :verify_and_activate
|
86
80
|
# puts @signup.errors.full_messages * "\n"
|
87
|
-
expect(
|
88
|
-
expect(
|
89
|
-
expect(
|
90
|
-
expect(
|
91
|
-
end
|
92
|
-
|
93
|
-
it "rejects expired token and creates new token" do
|
94
|
-
@account.token_card.update_column :updated_at,
|
95
|
-
8.days.ago.strftime("%F %T")
|
96
|
-
@account.token_card.expire
|
97
|
-
Card::Env.params[:token] = @token
|
98
|
-
@signup = Card.fetch "big bad wolf"
|
99
|
-
result = @signup.update!({})
|
100
|
-
# successfully completes save
|
101
|
-
expect(result).to eq(true)
|
102
|
-
@account.reload
|
103
|
-
# token gets updated
|
104
|
-
expect(@account.token).not_to eq(@token)
|
105
|
-
# user notified of expired token
|
106
|
-
expect(Card::Env.success.message)
|
107
|
-
.to match(/Please check your email for a new password reset link\./)
|
81
|
+
expect(account.errors).to be_empty
|
82
|
+
expect(account.status).to eq("active")
|
83
|
+
expect(account.refresh(true)).to be_active
|
84
|
+
expect(@signup.refresh(true).type_id).to eq(Card::UserID)
|
108
85
|
end
|
109
86
|
end
|
110
87
|
|
111
88
|
context "signup (with approval)" do
|
112
89
|
before do
|
113
90
|
# NOTE: by default Anonymous does not have permission
|
114
|
-
# to create User cards
|
115
|
-
Mail::TestMailer.deliveries.clear
|
91
|
+
# to create User cards and thus requires approval
|
116
92
|
Card::Auth.current_id = Card::AnonymousID
|
117
|
-
@signup =
|
118
|
-
type_id: Card::SignupID,
|
119
|
-
"+*account" => {
|
120
|
-
"+*email" => "wolf@wagn.org",
|
121
|
-
"+*password" => "wolf"
|
122
|
-
}
|
93
|
+
@signup = big_bad_signup
|
123
94
|
@account = @signup.account
|
124
95
|
end
|
125
96
|
|
126
|
-
it "creates all the necessary cards
|
97
|
+
it "creates all the necessary cards" do
|
127
98
|
expect(@signup.type_id).to eq(Card::SignupID)
|
128
99
|
expect(@account.email).to eq("wolf@wagn.org")
|
129
|
-
expect(@account.status).to eq("
|
100
|
+
expect(@account.status).to eq("unapproved")
|
130
101
|
expect(@account.salt).not_to eq("")
|
131
102
|
expect(@account.password.length).to be > 10 # encrypted
|
132
103
|
end
|
133
104
|
|
134
|
-
it "does not create a token" do
|
135
|
-
expect(@account.token).not_to be_present
|
136
|
-
end
|
137
|
-
|
138
105
|
it "sends signup alert email" do
|
139
106
|
signup_alert = ActionMailer::Base.deliveries.last
|
140
107
|
expect(signup_alert.to).to eq(["signups@wagn.org"])
|
@@ -149,27 +116,24 @@ RSpec.describe Card::Set::Type::Signup do
|
|
149
116
|
expect(Mail::TestMailer.deliveries[-2]).to be_nil
|
150
117
|
end
|
151
118
|
|
152
|
-
context "
|
153
|
-
it "
|
154
|
-
Card::Env.params[:approve_with_token] = true
|
119
|
+
context "when approving with verification" do
|
120
|
+
it "sets status to 'unverified'" do
|
155
121
|
Card::Auth.as "joe_admin"
|
122
|
+
@signup.update! trigger: :approve_with_verification
|
123
|
+
|
124
|
+
expect(@signup.account.status).to eq("unverified")
|
125
|
+
expect(@signup.type_id).to eq(Card::SignupID)
|
156
126
|
|
157
|
-
|
158
|
-
@signup.save!
|
159
|
-
expect(@signup.account.token).to be_present
|
127
|
+
# test that verification email goes out?
|
160
128
|
end
|
161
129
|
end
|
162
130
|
|
163
|
-
context "
|
164
|
-
it "
|
165
|
-
Card::Env.params[:approve_without_token] = true
|
131
|
+
context "when approving without verification" do
|
132
|
+
it "immediately converts signup to active user" do
|
166
133
|
Card::Auth.as "joe_admin"
|
167
|
-
|
168
|
-
@signup = Card.fetch @signup.id
|
169
|
-
@signup.save!
|
170
|
-
expect(@signup.account.token).not_to be_present
|
134
|
+
@signup.update! trigger: :approve_without_verification
|
171
135
|
expect(@signup.type_id).to eq(Card::UserID)
|
172
|
-
expect(@signup.account
|
136
|
+
expect(@signup.account).to be_active
|
173
137
|
end
|
174
138
|
end
|
175
139
|
end
|
@@ -193,7 +157,8 @@ RSpec.describe Card::Set::Type::Signup do
|
|
193
157
|
|
194
158
|
it "sends welcome email when account is activated" do
|
195
159
|
# @signup.run_phase :approve do
|
196
|
-
|
160
|
+
Card::Auth.as "joe admin"
|
161
|
+
@signup.update! trigger: :approve_without_verification
|
197
162
|
# end
|
198
163
|
@mail = ActionMailer::Base.deliveries.find { |a| a.subject == "welcome" }
|
199
164
|
Mail::TestMailer.deliveries.clear
|
@@ -208,18 +173,15 @@ RSpec.describe Card::Set::Type::Signup do
|
|
208
173
|
# NOTE:
|
209
174
|
# by default Anonymous does not have permission to create User cards.
|
210
175
|
Card::Auth.current_id = Card::WagnBotID
|
211
|
-
@signup =
|
212
|
-
"+*account" => { "+*email" => "wolf@wagn.org" }
|
176
|
+
@signup = big_bad_signup
|
213
177
|
@account = @signup.account
|
214
178
|
end
|
215
179
|
|
216
|
-
it "creates all the necessary cards
|
180
|
+
it "creates all the necessary cards" do
|
217
181
|
expect(@signup.type_id).to eq(Card::SignupID)
|
218
182
|
expect(@account.email).to eq("wolf@wagn.org")
|
219
|
-
expect(@account.status).to eq("
|
183
|
+
expect(@account.status).to eq("unverified")
|
220
184
|
expect(@account.salt).not_to eq("")
|
221
|
-
expect(@account.token).to be_present
|
222
|
-
expect(@account.password).not_to be_present
|
223
185
|
end
|
224
186
|
|
225
187
|
it "considers signups created by signed-in users to be invitations" do
|