your_platform 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +39 -11
- data/Rakefile +15 -1
- data/app/assets/images/file.png +0 -0
- data/app/assets/images/img/excel2013_file_128.png +0 -0
- data/app/assets/images/img/excel2013_file_bw_107.png +0 -0
- data/app/assets/images/img/excel2013_file_bw_semitransparent_107.png +0 -0
- data/app/assets/images/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/img/glyphicons-halflings.png +0 -0
- data/app/assets/images/img/gmaps_yellow_marker.png +0 -0
- data/app/assets/images/img/gmaps_yellow_marker_38.png +0 -0
- data/app/assets/images/markdown_help.png +0 -0
- data/app/assets/images/your_platform/breadcrumb-sep.png +0 -0
- data/app/assets/javascripts/app-ng.js.coffee +5 -0
- data/app/assets/javascripts/attachments.js +2 -0
- data/app/assets/javascripts/controllers-ng/bookmark_list_controller.js.coffee +30 -0
- data/app/assets/javascripts/controllers-ng/box_controller.js.coffee +37 -0
- data/app/assets/javascripts/controllers-ng/profile_angular.js.coffee +151 -0
- data/app/assets/javascripts/directives-ng/box_directive.js.coffee +91 -0
- data/app/assets/javascripts/directives-ng/star_tool_directive.js.coffee +111 -0
- data/app/assets/javascripts/filters-ng/some_filter.js.coffee +0 -0
- data/app/assets/javascripts/jquery.appear-1.1.1.js +138 -0
- data/app/assets/javascripts/make-js-more-like-ruby.js.coffee +32 -0
- data/app/assets/javascripts/mercury.js +456 -0
- data/app/assets/javascripts/models-ng/bookmark.js.coffee +28 -0
- data/app/assets/javascripts/services-ng/current_user_bookmarks.js.coffee +39 -0
- data/app/assets/javascripts/your_platform.js +27 -0
- data/app/assets/javascripts/your_platform/address_labels.js.coffee +40 -0
- data/app/assets/javascripts/your_platform/attachments.js.coffee +61 -0
- data/app/assets/javascripts/your_platform/auto-completion.js.coffee +90 -0
- data/app/assets/javascripts/your_platform/best_in_place.js.coffee +8 -0
- data/app/assets/javascripts/your_platform/best_in_place_hyperlinks.js.coffee +25 -0
- data/app/assets/javascripts/your_platform/best_in_place_tab_key.js.coffee +28 -0
- data/app/assets/javascripts/your_platform/boxes.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/change_password.js.coffee +22 -0
- data/app/assets/javascripts/your_platform/close_dropdowns.js.coffee +18 -0
- data/app/assets/javascripts/your_platform/copy_to_clipboard.js.coffee +6 -0
- data/app/assets/javascripts/your_platform/datatables.coffee +112 -0
- data/app/assets/javascripts/your_platform/datepicker_settings.js.coffee +16 -0
- data/app/assets/javascripts/your_platform/edit_tools.js.coffee +19 -0
- data/app/assets/javascripts/your_platform/editable_dbl_click.js.coffee +42 -0
- data/app/assets/javascripts/your_platform/events.js.coffee +126 -0
- data/app/assets/javascripts/your_platform/fix_textarea.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/galleria.js.coffee +112 -0
- data/app/assets/javascripts/your_platform/groups.js.coffee +36 -0
- data/app/assets/javascripts/your_platform/hidden.js.coffee +5 -0
- data/app/assets/javascripts/your_platform/links_to_external_sites.js.coffee +12 -0
- data/app/assets/javascripts/your_platform/maps.js.coffee +13 -0
- data/app/assets/javascripts/your_platform/may_need_review.js.coffee +10 -0
- data/app/assets/javascripts/your_platform/navable_title_rename.js.coffee +17 -0
- data/app/assets/javascripts/your_platform/officers.js.coffee +35 -0
- data/app/assets/javascripts/your_platform/popovers.js.coffee +38 -0
- data/app/assets/javascripts/your_platform/posts.js.coffee +58 -0
- data/app/assets/javascripts/your_platform/profile_fields.js.coffee +61 -0
- data/app/assets/javascripts/your_platform/search.js.coffee +26 -0
- data/app/assets/javascripts/your_platform/tooltips.js.coffee +10 -0
- data/app/assets/javascripts/your_platform/turbolinks_loading_spinner.js.coffee +83 -0
- data/app/assets/javascripts/your_platform/user_avatars.js.coffee +33 -0
- data/app/assets/javascripts/your_platform/user_group_memberships.js.coffee +11 -0
- data/app/assets/javascripts/your_platform/user_settings.js.coffee +18 -0
- data/app/assets/javascripts/your_platform/users_new.js.coffee +54 -0
- data/app/assets/stylesheets/bootstrap_layout.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/attachments.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/boxes.css.sass +11 -0
- data/app/assets/stylesheets/bootstrap_layout/breadcrumb.css.sass +25 -0
- data/app/assets/stylesheets/bootstrap_layout/category_indicator.css.sass +5 -0
- data/app/assets/stylesheets/bootstrap_layout/footer.css.sass +14 -0
- data/app/assets/stylesheets/bootstrap_layout/galleria.css.sass +8 -0
- data/app/assets/stylesheets/bootstrap_layout/header_bar.css.sass +11 -0
- data/app/assets/stylesheets/bootstrap_layout/headings.css.sass +10 -0
- data/app/assets/stylesheets/bootstrap_layout/logged_in_bar.css.sass +40 -0
- data/app/assets/stylesheets/bootstrap_layout/logo.css.sass +2 -0
- data/app/assets/stylesheets/bootstrap_layout/modal_fix.css.sass +8 -0
- data/app/assets/stylesheets/bootstrap_layout/profiles.css.sass +10 -0
- data/app/assets/stylesheets/bootstrap_layout/session_bar.css.sass +60 -0
- data/app/assets/stylesheets/bootstrap_layout/stars.css.sass +4 -0
- data/app/assets/stylesheets/bootstrap_layout/turbolinks_progress_bar.css.sass +3 -0
- data/app/assets/stylesheets/bootstrap_layout/vertical_menu.css.sass +15 -0
- data/app/assets/stylesheets/bootstrap_setup.css.sass +4 -0
- data/app/assets/stylesheets/your_platform.css.sass +11 -0
- data/app/assets/stylesheets/your_platform/address_labels_modal.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/attachments.css.sass +75 -0
- data/app/assets/stylesheets/your_platform/authorization_info.css.sass +16 -0
- data/app/assets/stylesheets/your_platform/auto-completion.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/center.css.sass +14 -0
- data/app/assets/stylesheets/your_platform/change_password.css.sass +13 -0
- data/app/assets/stylesheets/your_platform/corporate_vita.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/datatables.css.sass +23 -0
- data/app/assets/stylesheets/your_platform/datepicker.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/dropdowns.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/events.css.sass +68 -0
- data/app/assets/stylesheets/your_platform/forms.css.sass +25 -0
- data/app/assets/stylesheets/your_platform/galleria.css.sass +12 -0
- data/app/assets/stylesheets/your_platform/groups.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/groups_table.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/hidden.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/images.css.sass +50 -0
- data/app/assets/stylesheets/your_platform/last_activities.css.sass +17 -0
- data/app/assets/stylesheets/your_platform/latest_members.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/login.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/maps.css.sass +22 -0
- data/app/assets/stylesheets/your_platform/markdown_help.css.sass +5 -0
- data/app/assets/stylesheets/your_platform/may_need_review.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/pages.css.sass +12 -0
- data/app/assets/stylesheets/your_platform/password_strength.css.sass +73 -0
- data/app/assets/stylesheets/your_platform/picture_attachments.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/popovers.css.sass +13 -0
- data/app/assets/stylesheets/your_platform/posts.css.sass +32 -0
- data/app/assets/stylesheets/your_platform/profiles.css.sass +153 -0
- data/app/assets/stylesheets/your_platform/search_preview.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/star_tool.css.sass +2 -0
- data/app/assets/stylesheets/your_platform/tooltips.css.sass +7 -0
- data/app/assets/stylesheets/your_platform/turbolinks_loading_spinner.css.sass +3 -0
- data/app/assets/stylesheets/your_platform/user_avatars.css.sass +8 -0
- data/app/assets/stylesheets/your_platform/user_group_memberships.css.sass +4 -0
- data/app/assets/stylesheets/your_platform/vertical_nav.css.sass +7 -0
- data/app/controllers/activities_controller.rb +6 -0
- data/app/controllers/application_controller.rb +236 -0
- data/app/controllers/attachments_controller.rb +97 -0
- data/app/controllers/blog_posts_controller.rb +50 -0
- data/app/controllers/bookmarks_controller.rb +33 -0
- data/app/controllers/corporations_controller.rb +22 -0
- data/app/controllers/errors_controller.rb +27 -0
- data/app/controllers/events_controller.rb +262 -0
- data/app/controllers/groups_controller.rb +257 -0
- data/app/controllers/officers_controller.rb +28 -0
- data/app/controllers/pages_controller.rb +67 -0
- data/app/controllers/posts_controller.rb +81 -0
- data/app/controllers/profile_fields_controller.rb +132 -0
- data/app/controllers/root_controller.rb +35 -0
- data/app/controllers/search_controller.rb +149 -0
- data/app/controllers/sessions_controller.rb +21 -0
- data/app/controllers/setup_controller.rb +80 -0
- data/app/controllers/statistics_controller.rb +38 -0
- data/app/controllers/status_group_memberships_controller.rb +28 -0
- data/app/controllers/terms_of_use_controller.rb +35 -0
- data/app/controllers/user_accounts_controller.rb +55 -0
- data/app/controllers/user_group_memberships_controller.rb +75 -0
- data/app/controllers/user_settings_controller.rb +57 -0
- data/app/controllers/users_controller.rb +125 -0
- data/app/controllers/workflows_controller.rb +19 -0
- data/app/helpers/application_helper.rb +25 -0
- data/app/helpers/attachments_helper.rb +2 -0
- data/app/helpers/auto_completion_helper.rb +33 -0
- data/app/helpers/avatar_helper.rb +70 -0
- data/app/helpers/bookmarks_helper.rb +22 -0
- data/app/helpers/box_helper.rb +56 -0
- data/app/helpers/breadcrumbs_helper.rb +62 -0
- data/app/helpers/corporate_vita_helper.rb +34 -0
- data/app/helpers/events_helper.rb +28 -0
- data/app/helpers/flash_helper.rb +60 -0
- data/app/helpers/footer_helper.rb +13 -0
- data/app/helpers/galleria_helper.rb +13 -0
- data/app/helpers/groups_helper.rb +66 -0
- data/app/helpers/horizontal_nav_helper.rb +11 -0
- data/app/helpers/i18n_helper.rb +10 -0
- data/app/helpers/icon_helper.rb +35 -0
- data/app/helpers/mailer_helper.rb +7 -0
- data/app/helpers/map_helper.rb +26 -0
- data/app/helpers/markdown_helper.rb +22 -0
- data/app/helpers/markup_helper.rb +25 -0
- data/app/helpers/officers_helper.rb +13 -0
- data/app/helpers/password_helper.rb +23 -0
- data/app/helpers/profile_field_helper.rb +40 -0
- data/app/helpers/profile_helper.rb +69 -0
- data/app/helpers/quick_link_helper.rb +53 -0
- data/app/helpers/special_pages_helper.rb +9 -0
- data/app/helpers/structureable_helper.rb +11 -0
- data/app/helpers/sublime_helper.rb +16 -0
- data/app/helpers/title_helper.rb +52 -0
- data/app/helpers/tool_buttons_helper.rb +74 -0
- data/app/helpers/unicode_helper.rb +9 -0
- data/app/helpers/users_helper.rb +13 -0
- data/app/helpers/vertical_nav_helper.rb +84 -0
- data/app/helpers/workflows_helper.rb +37 -0
- data/app/mailers/event_mailer.rb +13 -0
- data/app/mailers/post_mailer.rb +11 -0
- data/app/mailers/user_account_mailer.rb +17 -0
- data/app/models/ability.rb +321 -0
- data/app/models/active_record_associations_patches.rb +26 -0
- data/app/models/active_record_cache_extension.rb +152 -0
- data/app/models/active_record_find_by_extension.rb +20 -0
- data/app/models/active_record_json_url_extension.rb +51 -0
- data/app/models/active_record_metric_events_extension.rb +22 -0
- data/app/models/active_record_read_only_extension.rb +35 -0
- data/app/models/active_record_update_attributes_bip_extension.rb +24 -0
- data/app/models/address_label.rb +50 -0
- data/app/models/app_version.rb +49 -0
- data/app/models/array.rb +15 -0
- data/app/models/attachment.rb +76 -0
- data/app/models/bashpass_password.rb +32 -0
- data/app/models/blog_post.rb +2 -0
- data/app/models/bookmark.rb +67 -0
- data/app/models/cache_additions.rb +15 -0
- data/app/models/cache_store_extension.rb +78 -0
- data/app/models/concerns/user_avatar.rb +16 -0
- data/app/models/concerns/user_corporations.rb +44 -0
- data/app/models/concerns/user_date_of_birth.rb +74 -0
- data/app/models/concerns/user_profile.rb +102 -0
- data/app/models/corporation.rb +80 -0
- data/app/models/dag_link.rb +29 -0
- data/app/models/event.rb +235 -0
- data/app/models/flag.rb +18 -0
- data/app/models/flagable.rb +62 -0
- data/app/models/geo_location.rb +92 -0
- data/app/models/group.rb +224 -0
- data/app/models/group_mixins/corporations.rb +141 -0
- data/app/models/group_mixins/developers.rb +41 -0
- data/app/models/group_mixins/everyone.rb +72 -0
- data/app/models/group_mixins/guests.rb +61 -0
- data/app/models/group_mixins/hidden_users.rb +43 -0
- data/app/models/group_mixins/import.rb +321 -0
- data/app/models/group_mixins/memberships.rb +207 -0
- data/app/models/group_mixins/officers.rb +47 -0
- data/app/models/group_mixins/roles.rb +41 -0
- data/app/models/horizontal_nav.rb +32 -0
- data/app/models/last_seen_activity.rb +10 -0
- data/app/models/list_export.rb +359 -0
- data/app/models/may_need_review.rb +54 -0
- data/app/models/metric_logger.rb +83 -0
- data/app/models/nav_node.rb +169 -0
- data/app/models/navable.rb +46 -0
- data/app/models/object_to_b_extension.rb +12 -0
- data/app/models/page.rb +212 -0
- data/app/models/password.rb +28 -0
- data/app/models/post.rb +199 -0
- data/app/models/profile.rb +36 -0
- data/app/models/profile_field.rb +196 -0
- data/app/models/profile_field_mixins/has_child_profile_fields.rb +114 -0
- data/app/models/profile_field_types/about.rb +9 -0
- data/app/models/profile_field_types/academic_degree.rb +10 -0
- data/app/models/profile_field_types/address.rb +88 -0
- data/app/models/profile_field_types/bank_account.rb +12 -0
- data/app/models/profile_field_types/competence.rb +7 -0
- data/app/models/profile_field_types/custom.rb +12 -0
- data/app/models/profile_field_types/date.rb +14 -0
- data/app/models/profile_field_types/description.rb +15 -0
- data/app/models/profile_field_types/email.rb +20 -0
- data/app/models/profile_field_types/employment.rb +24 -0
- data/app/models/profile_field_types/general.rb +9 -0
- data/app/models/profile_field_types/homepage.rb +19 -0
- data/app/models/profile_field_types/name_surrounding.rb +11 -0
- data/app/models/profile_field_types/organization.rb +24 -0
- data/app/models/profile_field_types/phone.rb +37 -0
- data/app/models/profile_field_types/professional_category.rb +8 -0
- data/app/models/profile_field_types/study.rb +18 -0
- data/app/models/profile_section.rb +49 -0
- data/app/models/profileable.rb +58 -0
- data/app/models/profileable_mixins/address.rb +118 -0
- data/app/models/relationship.rb +78 -0
- data/app/models/role.rb +164 -0
- data/app/models/setting.rb +9 -0
- data/app/models/status_group.rb +28 -0
- data/app/models/status_group_membership.rb +189 -0
- data/app/models/status_group_membership_info.rb +54 -0
- data/app/models/structureable.rb +164 -0
- data/app/models/structureable_mixins/has_special_groups.rb +127 -0
- data/app/models/structureable_mixins/roles.rb +275 -0
- data/app/models/user.rb +878 -0
- data/app/models/user_account.rb +162 -0
- data/app/models/user_alias.rb +112 -0
- data/app/models/user_group_membership.rb +300 -0
- data/app/models/user_group_membership_mixins/validity_range.rb +206 -0
- data/app/models/user_group_membership_mixins/validity_range_for_indirect_memberships.rb +160 -0
- data/app/models/user_mixins/identification.rb +36 -0
- data/app/models/user_mixins/memberships.rb +75 -0
- data/app/models/workflow.rb +40 -0
- data/app/models/workflow_kit/add_to_group_brick.rb +21 -0
- data/app/models/workflow_kit/destroy_account_and_end_memberships_if_needed_brick.rb +19 -0
- data/app/models/workflow_kit/last_membership_needs_review_brick.rb +19 -0
- data/app/models/workflow_kit/mark_as_deceased_brick.rb +17 -0
- data/app/models/workflow_kit/remove_from_group_brick.rb +27 -0
- data/app/models/workflow_kit/test_brick.rb +13 -0
- data/app/pdfs/address_labels_pdf.rb +157 -0
- data/app/presenters/base_presenter.rb +52 -0
- data/app/presenters/horizontal_nav_presenter.rb +106 -0
- data/app/uploaders/attachment_uploader.rb +148 -0
- data/app/views/activities/index.html.haml +25 -0
- data/app/views/attachments/_attachment.html.haml +20 -0
- data/app/views/attachments/_description.html.haml +11 -0
- data/app/views/attachments/_documents.html.haml +17 -0
- data/app/views/attachments/_drop_field.html.haml +46 -0
- data/app/views/attachments/_picture.html.haml +2 -0
- data/app/views/attachments/_pictures.html.haml +10 -0
- data/app/views/attachments/_video.html.haml +8 -0
- data/app/views/attachments/create.js.erb +1 -0
- data/app/views/attachments/destroy.js.erb +1 -0
- data/app/views/blog_posts/create.js.erb +17 -0
- data/app/views/bookmarks/_list.html.haml +7 -0
- data/app/views/bookmarks/update.js.erb +4 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +8 -0
- data/app/views/devise/passwords/edit.html.haml +1 -0
- data/app/views/devise/passwords/new.html.haml +12 -0
- data/app/views/devise/registrations/edit.html.haml +1 -0
- data/app/views/devise/sessions/new.html.haml +14 -0
- data/app/views/devise/shared/_links.haml +26 -0
- data/app/views/errors/show.html.haml +5 -0
- data/app/views/errors/unauthorized.html.haml +7 -0
- data/app/views/event_mailer/invitation_email.html.erb +63 -0
- data/app/views/events/_event_details.html.haml +54 -0
- data/app/views/events/_events_lis.html.haml +29 -0
- data/app/views/events/_invitation_text.html.erb +8 -0
- data/app/views/events/_pictures.html.haml +5 -0
- data/app/views/events/_public_index.html.haml +16 -0
- data/app/views/events/index.html.haml +24 -0
- data/app/views/events/show.html.haml +50 -0
- data/app/views/groups/_address_labels_modal.html.haml +27 -0
- data/app/views/groups/_export_button.html.haml +66 -0
- data/app/views/groups/_group_list.html.haml +25 -0
- data/app/views/groups/_member_avatars.html.haml +4 -0
- data/app/views/groups/_member_list.html.haml +15 -0
- data/app/views/groups/index.html.erb +11 -0
- data/app/views/groups/index_mine.html.haml +7 -0
- data/app/views/groups/show.html.haml +79 -0
- data/app/views/last_seen_activities/_index.html.haml +19 -0
- data/app/views/layouts/_add_structureable_additions.html.haml +15 -0
- data/app/views/layouts/_box.html.haml +16 -0
- data/app/views/layouts/_help_button.html.haml +1 -0
- data/app/views/layouts/_role_preview_switcher.html.haml +20 -0
- data/app/views/layouts/_session_bar_avatar.html.haml +1 -0
- data/app/views/layouts/_vertical_nav.html.haml +5 -0
- data/app/views/layouts/bootstrap.html.haml +146 -0
- data/app/views/layouts/mercury.html.erb +23 -0
- data/app/views/officers/_history_notice.html.haml +4 -0
- data/app/views/officers/_officers_box.html.haml +33 -0
- data/app/views/officers/_officers_group_entry.html.haml +45 -0
- data/app/views/pages/_attachments.html.haml +21 -0
- data/app/views/pages/_page.html.haml +28 -0
- data/app/views/pages/_pictures.html.haml +2 -0
- data/app/views/pages/_videos.html.erb +8 -0
- data/app/views/pages/show.html.haml +39 -0
- data/app/views/post_mailer/post_email.html.erb +17 -0
- data/app/views/posts/_new_post_template_text.html.haml +6 -0
- data/app/views/posts/_post.html.haml +13 -0
- data/app/views/posts/_post_quote.html.haml +18 -0
- data/app/views/posts/_posts.html.haml +6 -0
- data/app/views/posts/index.html.haml +9 -0
- data/app/views/posts/new.html.haml +42 -0
- data/app/views/posts/show.html.haml +8 -0
- data/app/views/profile_fields/_postal_address_flag_switch.html.haml +21 -0
- data/app/views/profile_fields/_profile_field.html.haml +41 -0
- data/app/views/profile_fields/create.js.erb +26 -0
- data/app/views/profile_fields/destroy.js.erb +3 -0
- data/app/views/profiles/_add_profile_field_button.html.haml +15 -0
- data/app/views/profiles/_profile_section_ul.html.haml +8 -0
- data/app/views/profiles/_section.html.haml +28 -0
- data/app/views/profiles/_send_group_message_button.html.haml +4 -0
- data/app/views/root/_latest_members_box.html.haml +19 -0
- data/app/views/root/_start_page_elements.html.haml +0 -0
- data/app/views/root/_what_is_new.html.haml +21 -0
- data/app/views/search/_preview_blog_post.html.haml +1 -0
- data/app/views/search/_preview_corporation.html.haml +5 -0
- data/app/views/search/_preview_group.html.haml +4 -0
- data/app/views/search/_preview_page.html.haml +11 -0
- data/app/views/search/_preview_user.html.haml +14 -0
- data/app/views/search/index.html.haml +42 -0
- data/app/views/setup/index.html.haml +56 -0
- data/app/views/shared/_add_structureable.html.haml +22 -0
- data/app/views/shared/_authorization_info.html.haml +22 -0
- data/app/views/shared/_flags.html.haml +5 -0
- data/app/views/shared/_markdown_help.html.haml +4 -0
- data/app/views/shared/_search_box.html.haml +2 -0
- data/app/views/shared/_upcoming_events.html.haml +33 -0
- data/app/views/statistics/index.html.haml +16 -0
- data/app/views/statistics/show.html.haml +13 -0
- data/app/views/terms_of_use/_checkbox.html.haml +1 -0
- data/app/views/terms_of_use/_terms.html.haml +1 -0
- data/app/views/terms_of_use/index.html.haml +19 -0
- data/app/views/user_account_mailer/welcome_email.html.erb +32 -0
- data/app/views/user_accounts/_change_password.html.haml +149 -0
- data/app/views/user_accounts/_user_account.html.haml +39 -0
- data/app/views/user_group_memberships/_list_item.html.haml +9 -0
- data/app/views/user_group_memberships/_memberships_table.html.haml +56 -0
- data/app/views/user_group_memberships/_new.html.haml +18 -0
- data/app/views/user_group_memberships/create.js.erb +9 -0
- data/app/views/user_group_memberships/index.html.haml +5 -0
- data/app/views/user_settings/show.html.haml +36 -0
- data/app/views/users/_avatar.html.haml +16 -0
- data/app/views/users/_communication_box.html.haml +8 -0
- data/app/views/users/_corporate_vita.html.haml +23 -0
- data/app/views/users/_dead_badge.html.haml +3 -0
- data/app/views/users/_deceased_modal.html.haml +24 -0
- data/app/views/users/_hidden_badge.html.haml +4 -0
- data/app/views/users/_hidden_flag_switch.html.haml +20 -0
- data/app/views/users/_special_general_info_fields.html.haml +10 -0
- data/app/views/users/_user_corporation_attribute.html.haml +6 -0
- data/app/views/users/_user_name_attribute.html.haml +4 -0
- data/app/views/users/_user_title.html.haml +5 -0
- data/app/views/users/_workflow_triggers.html.haml +23 -0
- data/app/views/users/new.html.haml +55 -0
- data/app/views/users/show.html.haml +79 -0
- data/config/environment.rb +5 -0
- data/config/initializers/active_record_cache_extension.rb +1 -0
- data/config/initializers/active_record_find_by_extension.rb +1 -0
- data/config/initializers/active_record_flagable_extension.rb +2 -0
- data/config/initializers/active_record_json_url_extension.rb +1 -0
- data/config/initializers/active_record_may_need_review_extension.rb +2 -0
- data/config/initializers/active_record_metric_events_extension.rb +1 -0
- data/config/initializers/active_record_navable_extension.rb +6 -0
- data/config/initializers/active_record_profileable_extension.rb +4 -0
- data/config/initializers/active_record_read_only_extension.rb +1 -0
- data/config/initializers/active_record_structureable_extension.rb +3 -0
- data/config/initializers/active_record_update_attributes_bip_extension.rb +1 -0
- data/config/initializers/array_extension.rb +1 -0
- data/config/initializers/best_in_place_display_definitions.rb +31 -0
- data/config/initializers/cache_store_extension.rb +1 -0
- data/config/initializers/devise.rb +240 -0
- data/config/initializers/fnordmetric.rb +14 -0
- data/config/initializers/formtastic.rb +76 -0
- data/config/initializers/group_type_column_patches.rb +11 -0
- data/config/initializers/mime_types.rb +1 -0
- data/config/initializers/mini_profiler.rb +32 -0
- data/config/initializers/object_to_b_extension.rb +1 -0
- data/config/initializers/refile.rb +22 -0
- data/config/initializers/sidekiq.rb +12 -0
- data/config/locales/attachments/de.yml +33 -0
- data/config/locales/bookmarks/de.yml +3 -0
- data/config/locales/bookmarks/en.yml +3 -0
- data/config/locales/common_expressions/de.yml +5 -0
- data/config/locales/common_expressions/en.yml +5 -0
- data/config/locales/companies/de.yml +4 -0
- data/config/locales/companies/en.yml +4 -0
- data/config/locales/de.yml +30 -0
- data/config/locales/devise/de.yml +60 -0
- data/config/locales/devise/en.yml +62 -0
- data/config/locales/en.yml +25 -0
- data/config/locales/events/de.yml +34 -0
- data/config/locales/events/en.yml +34 -0
- data/config/locales/forms/de.yml +3 -0
- data/config/locales/groups/de.yml +56 -0
- data/config/locales/groups/en.yml +47 -0
- data/config/locales/officers/de.yml +10 -0
- data/config/locales/pages/de.yml +15 -0
- data/config/locales/pages/en.yml +14 -0
- data/config/locales/pagination/de.yml +6 -0
- data/config/locales/pagination/en.yml +5 -0
- data/config/locales/password_strength/de.yml +9 -0
- data/config/locales/password_strength/en.yml +9 -0
- data/config/locales/posts/de.yml +9 -0
- data/config/locales/profile_fields/de.yml +78 -0
- data/config/locales/profile_fields/en.yml +22 -0
- data/config/locales/profiles/de.yml +47 -0
- data/config/locales/profiles/en.yml +44 -0
- data/config/locales/roles/de.yml +9 -0
- data/config/locales/root/de.yml +3 -0
- data/config/locales/root/en.yml +3 -0
- data/config/locales/search/de.yml +11 -0
- data/config/locales/search/en.yml +11 -0
- data/config/locales/sessions/de.yml +37 -0
- data/config/locales/sessions/en.yml +37 -0
- data/config/locales/setup/de.yml +26 -0
- data/config/locales/setup/en.yml +26 -0
- data/config/locales/statistics/de.yml +6 -0
- data/config/locales/terms_of_use/de.yml +6 -0
- data/config/locales/tools/de.yml +9 -0
- data/config/locales/tools/en.yml +9 -0
- data/config/locales/user_accounts/de.yml +16 -0
- data/config/locales/user_accounts/en.yml +13 -0
- data/config/locales/user_settings/de.yml +9 -0
- data/config/locales/users/de.yml +82 -0
- data/config/locales/users/en.yml +51 -0
- data/config/locales/workflows/de.yml +4 -0
- data/config/locales/workflows/en.yml +4 -0
- data/config/routes.rb +104 -0
- data/db/migrate/20120403002734_create_users.rb +12 -0
- data/db/migrate/20120403011601_create_profile_fields.rb +11 -0
- data/db/migrate/20120403161549_remove_user_email_column.rb +5 -0
- data/db/migrate/20120405222050_encrypt_password.rb +8 -0
- data/db/migrate/20120425161138_create_dag_links.rb +14 -0
- data/db/migrate/20120425162644_create_pages.rb +10 -0
- data/db/migrate/20120426023322_create_groups.rb +9 -0
- data/db/migrate/20120426090436_create_nav_nodes.rb +18 -0
- data/db/migrate/20120427021934_create_user_accounts.rb +12 -0
- data/db/migrate/20120427044338_add_foreign_key_to_user_accounts.rb +7 -0
- data/db/migrate/20120427150156_add_group_token.rb +8 -0
- data/db/migrate/20120507165551_make_profile_fields_polymorphic.rb +11 -0
- data/db/migrate/20120508130729_add_profile_field_acts_as_tree.rb +9 -0
- data/db/migrate/20120508152233_change_profile_field_value_to_text.rb +9 -0
- data/db/migrate/20120508201550_add_group_internal_token.rb +11 -0
- data/db/migrate/20120511090234_create_workflows.rb +9 -0
- data/db/migrate/20120701115059_add_password_digest_to_user_accounts.rb +5 -0
- data/db/migrate/20120710193308_remove_salt_from_user_accounts.rb +5 -0
- data/db/migrate/20120713102445_add_deleted_at_to_dag_links.rb +5 -0
- data/db/migrate/20120722005022_create_workflow_kit_workflows.workflow_kit.rb +11 -0
- data/db/migrate/20120722005023_create_workflow_kit_steps.workflow_kit.rb +12 -0
- data/db/migrate/20120722005024_create_workflow_kit_parameters.workflow_kit.rb +12 -0
- data/db/migrate/20120723165226_add_female_to_users.rb +5 -0
- data/db/migrate/20120811140509_create_flags.rb +11 -0
- data/db/migrate/20120814100529_create_attachments.rb +13 -0
- data/db/migrate/20120815205610_add_content_type_and_file_size_to_attachments.rb +6 -0
- data/db/migrate/20130118220014_add_relationships_table_without_dag.rb +10 -0
- data/db/migrate/20130207214331_create_events.rb +12 -0
- data/db/migrate/20130208215253_create_status_group_membership_infos.rb +11 -0
- data/db/migrate/20130220184943_create_stars.rb +11 -0
- data/db/migrate/20130309193623_add_devise_to_user_accounts.rb +72 -0
- data/db/migrate/20130310003840_rename_stars_to_bookmarks.rb +9 -0
- data/db/migrate/20130310004622_fix_column_names_for_bookmarks.rb +6 -0
- data/db/migrate/20130313211414_create_geo_infos.rb +13 -0
- data/db/migrate/20130313234131_create_geo_locations.rb +16 -0
- data/db/migrate/20130314011638_drop_geo_infos.rb +5 -0
- data/db/migrate/20130315072759_add_invalid_to_geo_location.rb +5 -0
- data/db/migrate/20130315073149_exchange_invalid_for_queried_at_in_geo_location.rb +8 -0
- data/db/migrate/20130320003051_add_redirect_to_to_page.rb +5 -0
- data/db/migrate/20130329231657_create_posts.rb +15 -0
- data/db/migrate/20130404223735_add_entire_message_to_posts.rb +5 -0
- data/db/migrate/20130409192959_add_author_to_page.rb +5 -0
- data/db/migrate/20130908011215_add_type_to_pages.rb +5 -0
- data/db/migrate/20131115114715_validity_range_for_dag_links.rb +16 -0
- data/db/migrate/20140611170430_create_activities.rb +23 -0
- data/db/migrate/20140808223512_create_last_seen_activities.rb +12 -0
- data/db/migrate/20141008101744_add_location_to_events.rb +5 -0
- data/db/migrate/20141010130344_add_publish_on_website_to_events.rb +6 -0
- data/db/migrate/20141010134227_add_auth_token_to_user_accounts.rb +5 -0
- data/db/migrate/20141018143323_add_accepted_terms_to_users.rb +6 -0
- data/db/migrate/20141018221659_add_author_to_attachments.rb +5 -0
- data/db/migrate/20141102223954_add_body_to_groups.rb +5 -0
- data/db/migrate/20141110193830_create_settings.rb +17 -0
- data/db/migrate/20141202140522_add_indices.rb +6 -0
- data/db/migrate/20141209161946_add_keys.rb +20 -0
- data/db/migrate/20150127013809_add_incognito_to_users.rb +5 -0
- data/db/migrate/20150129194501_add_indices_for_polymorphic_references.rb +13 -0
- data/db/migrate/20150304192448_add_type_to_groups.rb +5 -0
- data/db/migrate/20150313221004_add_avatar_id_to_users.rb +5 -0
- data/lib/best_in_place/controller_extensions.rb +25 -0
- data/lib/best_in_place/helper.rb +127 -0
- data/lib/tasks/db_bootstrap.rake +37 -0
- data/lib/tasks/your_platform_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- data/lib/your_platform.rb +6 -2
- data/lib/your_platform/engine.rb +127 -0
- data/lib/your_platform/version.rb +1 -1
- data/spec/factories/attachment.rb +12 -0
- data/spec/factories/blog_post.rb +10 -0
- data/spec/factories/company.rb +7 -0
- data/spec/factories/corporation.rb +20 -0
- data/spec/factories/event.rb +13 -0
- data/spec/factories/group.rb +36 -0
- data/spec/factories/html_email.eml +1059 -0
- data/spec/factories/mail_message.rb +30 -0
- data/spec/factories/page.rb +10 -0
- data/spec/factories/relationship.rb +13 -0
- data/spec/factories/status_group_membership.rb +21 -0
- data/spec/factories/user.rb +97 -0
- data/spec/factories/workflow.rb +44 -0
- data/spec/features/blog_post_spec.rb +46 -0
- data/spec/features/corporate_vita_events_spec.rb +114 -0
- data/spec/features/corporate_vita_spec.rb +258 -0
- data/spec/features/edit_mode_after_clicking_a_link_spec.rb +20 -0
- data/spec/features/events_spec.rb +356 -0
- data/spec/features/group_export_spec.rb +19 -0
- data/spec/features/group_post_spec.rb +89 -0
- data/spec/features/groups_of_groups_page_spec.rb +67 -0
- data/spec/features/groups_page_spec.rb +66 -0
- data/spec/features/groups_table_spec.rb +32 -0
- data/spec/features/help_page_spec.rb +22 -0
- data/spec/features/intranet_root_page_spec.rb +18 -0
- data/spec/features/locales_spec.rb +36 -0
- data/spec/features/maps_spec.rb +53 -0
- data/spec/features/mini_profiler_spec.rb +37 -0
- data/spec/features/officers_spec.rb +61 -0
- data/spec/features/page_redirects_spec.rb +23 -0
- data/spec/features/page_spec.rb +20 -0
- data/spec/features/postal_address_flag_spec.rb +46 -0
- data/spec/features/relationships_on_user_page_spec.rb +78 -0
- data/spec/features/review_membership_spec.rb +44 -0
- data/spec/features/search_field_spec.rb +121 -0
- data/spec/features/setup_spec.rb +63 -0
- data/spec/features/user_change_date_of_birth_spec.rb +26 -0
- data/spec/features/vertical_nav_spec.rb +27 -0
- data/spec/features/what_is_new_box_spec.rb +33 -0
- data/spec/helpers/attachments_helper_spec.rb +15 -0
- data/spec/models/ability_spec.rb +93 -0
- data/spec/models/active_record_cache_extension_spec.rb +177 -0
- data/spec/models/active_record_find_by_extension_spec.rb +26 -0
- data/spec/models/active_record_json_url_extension_spec.rb +79 -0
- data/spec/models/address_label_spec.rb +144 -0
- data/spec/models/app_version_spec.rb +38 -0
- data/spec/models/attachment_spec.rb +5 -0
- data/spec/models/bookmark_spec.rb +70 -0
- data/spec/models/concerns/user_corporations_spec.rb +71 -0
- data/spec/models/corporation_spec.rb +128 -0
- data/spec/models/dag_link_spec.rb +48 -0
- data/spec/models/event_spec.rb +267 -0
- data/spec/models/flag_spec.rb +20 -0
- data/spec/models/flagable_spec.rb +55 -0
- data/spec/models/geo_location_spec.rb +126 -0
- data/spec/models/group_mixins/corporations_spec.rb +95 -0
- data/spec/models/group_mixins/everyone_spec.rb +64 -0
- data/spec/models/group_mixins/guests_spec.rb +75 -0
- data/spec/models/group_mixins/hidden_users_spec.rb +21 -0
- data/spec/models/group_mixins/import_spec.rb +93 -0
- data/spec/models/group_mixins/memberships_spec.rb +303 -0
- data/spec/models/group_mixins/officers_spec.rb +63 -0
- data/spec/models/group_mixins/roles_spec.rb +46 -0
- data/spec/models/group_spec.rb +341 -0
- data/spec/models/list_export_spec.rb +155 -0
- data/spec/models/may_need_review_spec.rb +114 -0
- data/spec/models/nav_node_spec.rb +277 -0
- data/spec/models/navable_spec.rb +54 -0
- data/spec/models/page_spec.rb +185 -0
- data/spec/models/post_spec.rb +271 -0
- data/spec/models/profile_field_mixins/has_child_profile_fields_spec.rb +73 -0
- data/spec/models/profile_field_spec.rb +482 -0
- data/spec/models/profile_section_spec.rb +89 -0
- data/spec/models/profile_spec.rb +74 -0
- data/spec/models/profileable_mixins/adress_spec.rb +93 -0
- data/spec/models/profileable_spec.rb +152 -0
- data/spec/models/relationship_spec.rb +113 -0
- data/spec/models/status_group_membership_spec.rb +350 -0
- data/spec/models/status_group_spec.rb +103 -0
- data/spec/models/structureable_mixins/has_special_groups_spec.rb +479 -0
- data/spec/models/structureable_mixins/roles_spec.rb +517 -0
- data/spec/models/structureable_spec.rb +128 -0
- data/spec/models/user_account_spec.rb +142 -0
- data/spec/models/user_alias_spec.rb +57 -0
- data/spec/models/user_group_membership_mixins/validity_range_for_indirect_memberships_spec.rb +291 -0
- data/spec/models/user_group_membership_mixins/validity_range_spec.rb +293 -0
- data/spec/models/user_group_membership_spec.rb +428 -0
- data/spec/models/user_mixins/identification_spec.rb +27 -0
- data/spec/models/user_mixins/memberships_spec.rb +138 -0
- data/spec/models/user_spec.rb +1794 -0
- data/spec/old_yp_spec_helper.rb +46 -0
- data/spec/spec_helper.rb +350 -0
- data/spec/support/auto_complete.rb +22 -0
- data/spec/support/capybara/flash_helpers.rb +37 -0
- data/spec/support/capybara/profile_steps.rb +73 -0
- data/spec/support/capybara/session_steps.rb +53 -0
- data/spec/support/capybara/user_account_helpers.rb +15 -0
- data/spec/support/debug.rb +8 -0
- data/spec/support/devise-controller_macros.rb +15 -0
- data/spec/support/geocoder/stubs.rb +60 -0
- data/spec/support/press_enter.rb +15 -0
- data/spec/support/time_travel.rb +9 -0
- data/spec/support/uploads/image-upload.png +0 -0
- data/spec/support/uploads/pdf-upload.pdf +0 -0
- data/spec/support/wait_for_ajax.rb +39 -0
- data/spec/support/wait_for_cache.rb +7 -0
- data/spec/uploaders/attachment_uploader_spec.rb +47 -0
- data/vendor/assets/images/flags.png +0 -0
- data/vendor/assets/images/galleria/classic-loader.gif +0 -0
- data/vendor/assets/images/galleria/classic-map.png +0 -0
- data/vendor/assets/javascripts/best_in_place_datetime.js.coffee +45 -0
- data/vendor/assets/javascripts/galleria-classic.js +100 -0
- data/vendor/assets/javascripts/galleria.js +6919 -0
- data/vendor/assets/javascripts/gmaps4rails.js +2 -0
- data/vendor/assets/javascripts/gmaps4rails/all.js +1 -0
- data/vendor/assets/javascripts/gmaps4rails/base.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/base/common.coffee +43 -0
- data/vendor/assets/javascripts/gmaps4rails/base/configuration.coffee +7 -0
- data/vendor/assets/javascripts/gmaps4rails/base/gmaps.coffee +13 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/basic_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/controller_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/map_interface.coffee +27 -0
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/marker_interface.coffee +15 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main.coffee +124 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/circle_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/kml_controller.coffee +5 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/marker_controller.coffee +76 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polygon_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polyline_controller.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/circle.coffee +12 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/kml.coffee +8 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/map.coffee +62 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/marker.coffee +24 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polygon.coffee +11 -0
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polyline.coffee +11 -0
- data/vendor/assets/javascripts/gmaps4rails/bing.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/main.coffee +29 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/map.coffee +63 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/marker.coffee +78 -0
- data/vendor/assets/javascripts/gmaps4rails/bing/shared.coffee +20 -0
- data/vendor/assets/javascripts/gmaps4rails/google.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/google/main.coffee +47 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/circle.coffee +38 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/kml.coffee +16 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/map.coffee +71 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/marker.coffee +114 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polygon.coffee +38 -0
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polyline.coffee +49 -0
- data/vendor/assets/javascripts/gmaps4rails/google/shared.coffee +27 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers.coffee +1 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/main.coffee +138 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/map.coffee +49 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/marker.coffee +68 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/polyline.coffee +39 -0
- data/vendor/assets/javascripts/gmaps4rails/openlayers/shared.coffee +19 -0
- data/vendor/assets/javascripts/jquery-ui-timepicker-addon.js +2223 -0
- data/vendor/assets/javascripts/jquery-ui-timepicker-de.js +26 -0
- data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +23 -0
- data/vendor/assets/javascripts/password_strength.js +149 -0
- data/vendor/assets/javascripts/zxcvbn.js +43 -0
- data/vendor/assets/stylesheets/flags.css.scss +259 -0
- data/vendor/assets/stylesheets/galleria-classic.css.scss +239 -0
- data/vendor/assets/stylesheets/gmaps4rails.css +24 -0
- data/vendor/assets/stylesheets/mercury.css +24 -0
- data/vendor/scripts/bashpass/README.md +29 -0
- data/vendor/scripts/bashpass/bashpass +124 -0
- data/vendor/scripts/bashpass/bashpass-APACHE-LICENSE +201 -0
- data/vendor/scripts/bashpass/german.dic +40794 -0
- metadata +1540 -16
- data/.gitignore +0 -17
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -4
- data/your_platform.gemspec +0 -19
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AppVersion do
|
4
|
+
if ENV['CI'] != 'travis' # because the git commands do not work there.
|
5
|
+
|
6
|
+
subject { AppVersion }
|
7
|
+
it { should respond_to :last_tag }
|
8
|
+
it { should respond_to :version }
|
9
|
+
it { should respond_to :commit_id }
|
10
|
+
it { should respond_to :short_commit_id }
|
11
|
+
it { should respond_to :github_commit_url }
|
12
|
+
|
13
|
+
describe ".last_tag" do
|
14
|
+
subject { AppVersion.last_tag }
|
15
|
+
it { should be_present }
|
16
|
+
it { should_not include "\n" }
|
17
|
+
it { should start_with "v" }
|
18
|
+
end
|
19
|
+
describe ".version" do
|
20
|
+
subject { AppVersion.version }
|
21
|
+
it { should be_present }
|
22
|
+
it { should_not include "\n" }
|
23
|
+
it { should_not start_with "v" }
|
24
|
+
end
|
25
|
+
describe ".github_commit_url" do
|
26
|
+
subject { AppVersion.github_commit_url }
|
27
|
+
it { should == "https://github.com/fiedl/your_platform/commit/#{AppVersion.commit_id}" }
|
28
|
+
end
|
29
|
+
describe ".changelog_url" do
|
30
|
+
subject { AppVersion.changelog_url }
|
31
|
+
it { should = "https://github.com/fiedl/your_platform/commits/#{AppVersion.branch}" }
|
32
|
+
end
|
33
|
+
describe ".app_name" do
|
34
|
+
subject { AppVersion.app_name }
|
35
|
+
it { should == "MyPlatform" }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bookmark do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@user = create( :user )
|
7
|
+
@bookmarks = []
|
8
|
+
@bookmarked_objects = [ create( :user ), create( :page ), create( :group ) ].each do |obj|
|
9
|
+
@bookmarks << Bookmark.create( user: @user, bookmarkable: obj )
|
10
|
+
end
|
11
|
+
@unbookmarked_objects = [ create( :page ) ]
|
12
|
+
@object_to_bookmark = create( :group )
|
13
|
+
end
|
14
|
+
|
15
|
+
specify "spec setup should be done properly" do
|
16
|
+
@user.should be_kind_of User
|
17
|
+
@bookmarks.should be_kind_of Array
|
18
|
+
@bookmarks.length.should == 3
|
19
|
+
@bookmarked_objects.length.should == @bookmarks.length
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
# Finder Methods
|
24
|
+
# ==========================================================================================
|
25
|
+
|
26
|
+
describe ".find_by" do
|
27
|
+
subject { Bookmark.find_by( user: @user, bookmarkable: @bookmarked_objects.first ) }
|
28
|
+
it "should return an object, not an ActiveRecord::Relation" do
|
29
|
+
subject.should_not be_kind_of ActiveRecord::Relation
|
30
|
+
subject.should be_kind_of Bookmark
|
31
|
+
end
|
32
|
+
it "should return the first matching object" do
|
33
|
+
subject.should == @bookmarks.first
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe ".find_all_by_user" do
|
38
|
+
subject { Bookmark.find_all_by_user( @user ) }
|
39
|
+
it { should == @bookmarks }
|
40
|
+
end
|
41
|
+
|
42
|
+
describe ".find_all_by_bookmarkable" do
|
43
|
+
subject { Bookmark.find_all_by_bookmarkable( @bookmarked_objects.first ) }
|
44
|
+
it { should include @bookmarks.first }
|
45
|
+
it { should_not include @bookmarks.last }
|
46
|
+
end
|
47
|
+
|
48
|
+
describe ".find_by_user_and_bookmarkable" do
|
49
|
+
subject { Bookmark.find_by_user_and_bookmarkable( @user, @bookmarked_objects.first ) }
|
50
|
+
it { should == @bookmarks.first }
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
# API Export // Data Serialization
|
55
|
+
# ==========================================================================================
|
56
|
+
|
57
|
+
describe "#serializable_hash" do
|
58
|
+
it "should include the bookmarkable object's title" do
|
59
|
+
@bookmarks.each do |bookmark| # check it for several types of bookmarks
|
60
|
+
bookmark.serializable_hash[ :bookmarkable ][ :title ].should == bookmark.bookmarkable.title
|
61
|
+
end
|
62
|
+
end
|
63
|
+
it "should include the bookmarkable object's url" do
|
64
|
+
@bookmarks.each do |bookmark|
|
65
|
+
bookmark.serializable_hash[ :bookmarkable ][ :url ].should == bookmark.bookmarkable.url
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe UserCorporations do
|
4
|
+
before do
|
5
|
+
@user = create :user
|
6
|
+
@group = create :group
|
7
|
+
@corporation = create :corporation
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "#corporation" do
|
11
|
+
subject { @user.corporation }
|
12
|
+
|
13
|
+
describe "for a fresh user" do
|
14
|
+
it { should == nil }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "with the user being member of a corporation" do
|
18
|
+
before do
|
19
|
+
@group << @user
|
20
|
+
@corporation << @user
|
21
|
+
end
|
22
|
+
it { should == @corporation }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#corporation_name" do
|
27
|
+
subject { @user.corporation_name }
|
28
|
+
|
29
|
+
describe "for a fresh user" do
|
30
|
+
it { should == nil }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "with the user being member of a corporation" do
|
34
|
+
before do
|
35
|
+
@group << @user
|
36
|
+
@corporation << @user
|
37
|
+
end
|
38
|
+
it { should == @corporation.name }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "#corporation_name=" do
|
43
|
+
subject { @user.corporation_name = "My Great Corporation, Inc." }
|
44
|
+
|
45
|
+
describe "when the corporation does not exist" do
|
46
|
+
specify { subject; @user.corporation_name.should == "My Great Corporation, Inc." }
|
47
|
+
|
48
|
+
it "should create the corporation" do
|
49
|
+
subject
|
50
|
+
Corporation.pluck(:name).should include "My Great Corporation, Inc."
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should assing the user to the corporation" do
|
54
|
+
subject
|
55
|
+
Corporation.where(name: "My Great Corporation, Inc.").first.members.should include @user
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "when the corporation exists" do
|
60
|
+
before { @great_corporation = Corporation.create name: "My Great Corporation, Inc." }
|
61
|
+
|
62
|
+
specify { subject; @user.corporation_name.should == "My Great Corporation, Inc." }
|
63
|
+
|
64
|
+
it "should assign the user to the existing corporation" do
|
65
|
+
subject
|
66
|
+
@user.corporation.should == @great_corporation
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Corporation do
|
4
|
+
before do
|
5
|
+
@group = create :group
|
6
|
+
@corporation = create :corporation
|
7
|
+
end
|
8
|
+
|
9
|
+
describe ".create" do
|
10
|
+
subject { Corporation.create name: 'My Great Corporation' }
|
11
|
+
|
12
|
+
it { should be_kind_of Corporation }
|
13
|
+
it { should be_kind_of Group }
|
14
|
+
its(:type) { should == 'Corporation' }
|
15
|
+
|
16
|
+
it "should be child of the corporations_parent group" do
|
17
|
+
subject.reload.parent_group_ids.should include Corporation.corporations_parent.id
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".all" do
|
22
|
+
subject { Corporation.all }
|
23
|
+
|
24
|
+
it { should include @corporation }
|
25
|
+
it { should_not include @group }
|
26
|
+
|
27
|
+
it "should return an array of Corporation-type objects" do
|
28
|
+
subject.should be_kind_of Array
|
29
|
+
subject.first.should be_kind_of Corporation
|
30
|
+
end
|
31
|
+
it "should not find the officers_parent group of the corporations_parent" do
|
32
|
+
@corporations_parent = Group.find_corporations_parent_group
|
33
|
+
@officers_parent = @corporations_parent.create_officers_parent_group
|
34
|
+
subject.should_not include @officers_parent
|
35
|
+
subject.should_not include @officers_parent.becomes(Corporation)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "pluck(:id)" do
|
40
|
+
subject { Corporation.pluck(:id) }
|
41
|
+
|
42
|
+
it { should include @corporation.id }
|
43
|
+
it { should_not include @group.id }
|
44
|
+
end
|
45
|
+
|
46
|
+
describe ".corporations_parent" do
|
47
|
+
subject { Corporation.corporations_parent }
|
48
|
+
|
49
|
+
it { should be_kind_of Group }
|
50
|
+
it { should_not be_kind_of Corporation }
|
51
|
+
its(:children) { should include @corporation }
|
52
|
+
its(:children) { should_not include @group }
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#is_first_corporation_this_user_has_joined?" do
|
56
|
+
before do
|
57
|
+
@first_corporation = create( :corporation )
|
58
|
+
@second_corporation = create( :corporation )
|
59
|
+
@another_corporation = create( :corporation )
|
60
|
+
@user = create( :user )
|
61
|
+
|
62
|
+
@first_membership = UserGroupMembership.create( user: @user, group: @first_corporation )
|
63
|
+
@first_membership.valid_from = 1.year.ago
|
64
|
+
@first_membership.save
|
65
|
+
|
66
|
+
@second_membership = UserGroupMembership.create( user: @user, group: @second_corporation )
|
67
|
+
end
|
68
|
+
describe "for the corporation the user has joined first" do
|
69
|
+
subject { @first_corporation.is_first_corporation_this_user_has_joined?( @user ) }
|
70
|
+
it { should == true }
|
71
|
+
end
|
72
|
+
describe "for a corporation the user has not joined first" do
|
73
|
+
subject { @second_corporation.is_first_corporation_this_user_has_joined?( @user ) }
|
74
|
+
it { should == false }
|
75
|
+
end
|
76
|
+
describe "for a corporation the user is not even member of" do
|
77
|
+
subject { @another_corporation.is_first_corporation_this_user_has_joined?( @user ) }
|
78
|
+
it { should == false }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "#status_groups" do
|
83
|
+
before do
|
84
|
+
@corporation = create( :corporation )
|
85
|
+
|
86
|
+
# status groups are leaf groups of corporations
|
87
|
+
@status_group = create( :group )
|
88
|
+
@intermediate_group = create( :group )
|
89
|
+
@corporation.child_groups << @intermediate_group
|
90
|
+
@intermediate_group.child_groups << @status_group
|
91
|
+
|
92
|
+
@another_group = create( :group )
|
93
|
+
end
|
94
|
+
subject { @corporation.status_groups }
|
95
|
+
|
96
|
+
it "should include the status groups, i.e. the leaf groups of the corporation" do
|
97
|
+
subject.should include @status_group
|
98
|
+
end
|
99
|
+
it "should not include the non-status groups, i.e. the descendant_grous of the corporation that are no leafs" do
|
100
|
+
subject.should_not include @intermediate_group
|
101
|
+
end
|
102
|
+
it "should not include unrelated groups" do
|
103
|
+
subject.should_not include @another_group
|
104
|
+
end
|
105
|
+
describe "after calling admins" do
|
106
|
+
before do
|
107
|
+
@admins_parent = @status_group.admins_parent
|
108
|
+
@officers_parent = @status_group.officers_parent
|
109
|
+
end
|
110
|
+
it "should still return the correct status groups" do
|
111
|
+
subject.should include @status_group
|
112
|
+
end
|
113
|
+
it "should not return the officers parent groups" do
|
114
|
+
subject.should_not include @officers_parent
|
115
|
+
end
|
116
|
+
it "should not return the admins parent groups such that being admin is not considered a status" do
|
117
|
+
subject.should_not include @admins_parent
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
specify "the cache should be updated after a status group is renamed" do
|
122
|
+
@corporation.status_groups # This created the cached version.
|
123
|
+
@status_group.update_attributes name: 'New Status Name'
|
124
|
+
subject.map(&:name).should include 'New Status Name'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# The dag link functionality is tested extensively in the corresponding `acts-as-dag` gem.
|
4
|
+
# This test is just to make sure that the integration is propery done. Therefore, some basic scenarios are tested here.
|
5
|
+
#
|
6
|
+
# We use the Page model here to represent the dag's node objects, since it's a relatively simple model, which is already
|
7
|
+
# present in the database. If the Page model should become more extensive in the future, it's recommended to refactor
|
8
|
+
# this test to use a new model, perhaps defined in the test itself.
|
9
|
+
#
|
10
|
+
describe "Page (DagLinkNode)" do
|
11
|
+
|
12
|
+
def setup_pages
|
13
|
+
@page = FactoryGirl.create( :page )
|
14
|
+
@parent = FactoryGirl.create( :page )
|
15
|
+
@grandfather = FactoryGirl.create( :page )
|
16
|
+
@page.parent_pages << @parent
|
17
|
+
@parent.parent_pages << @grandfather
|
18
|
+
end
|
19
|
+
|
20
|
+
before { setup_pages }
|
21
|
+
|
22
|
+
describe "#ancestors" do
|
23
|
+
it "should return all ancestors, not only the parents" do
|
24
|
+
@page.ancestors.should include( @parent, @grandfather )
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "#descendants" do
|
29
|
+
it "should return all descendants, not only the children" do
|
30
|
+
@grandfather.descendants.should include( @parent, @page )
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "#parents" do
|
35
|
+
it "should return only the parents rather than all ancestors" do
|
36
|
+
@page.parents.should include( @parent )
|
37
|
+
@page.parents.should_not include( @grandfather )
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "#children" do
|
42
|
+
it "should return only the children rather than all descendants" do
|
43
|
+
@grandfather.children.should include( @parent )
|
44
|
+
@grandfather.children.should_not include( @page )
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,267 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Event do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@group = create( :group )
|
7
|
+
@another_group = create( :group )
|
8
|
+
@event = create( :event )
|
9
|
+
@event.group = @group
|
10
|
+
@event.reload # otherwise some associations are apparently missing
|
11
|
+
end
|
12
|
+
|
13
|
+
# Groups
|
14
|
+
# ==========================================================================================
|
15
|
+
|
16
|
+
describe "#group" do
|
17
|
+
subject { @event.group }
|
18
|
+
it "should return the associated group" do
|
19
|
+
subject.should == @group
|
20
|
+
@event.parent_groups.should == [ @group ]
|
21
|
+
@event.links_as_child.count.should == 1
|
22
|
+
@group.links_as_parent.count.should == 1
|
23
|
+
@event.links_as_child.first.should == @group.links_as_parent.first
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "#group=" do
|
28
|
+
subject { @event.group = @another_group }
|
29
|
+
it "should associate the new group and remove previous group associations" do
|
30
|
+
@event.group.should == @group
|
31
|
+
@event.parent_groups.count.should == 1
|
32
|
+
subject
|
33
|
+
@event.group.should == @another_group
|
34
|
+
@event.parent_groups.count.should == 1
|
35
|
+
@event.parent_groups.should include @another_group
|
36
|
+
@event.parent_groups.should_not include @group
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "#groups" do
|
41
|
+
subject { @event.groups }
|
42
|
+
it "should be a shortcut for #parent_groups" do
|
43
|
+
subject.should == @event.parent_groups
|
44
|
+
end
|
45
|
+
it "should return an array of the associated groups" do
|
46
|
+
subject.should be_kind_of Array
|
47
|
+
subject.should include @group
|
48
|
+
end
|
49
|
+
end
|
50
|
+
describe "#groups <<" do
|
51
|
+
subject { @event.groups << @another_group }
|
52
|
+
it "should add the given group" do
|
53
|
+
@event.groups.should == [ @group ]
|
54
|
+
subject
|
55
|
+
@event.groups.should include @group, @another_group
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
# Contact People and Attendees
|
61
|
+
# ==========================================================================================
|
62
|
+
|
63
|
+
describe "#contact_people" do
|
64
|
+
subject { @event.contact_people }
|
65
|
+
before { @user = create :user }
|
66
|
+
specify "it should return users in the contact people group" do
|
67
|
+
@event.contact_people.should_not include @user
|
68
|
+
@event.contact_people_group.assign_user @user; time_travel 2.seconds
|
69
|
+
@event.contact_people.should include @user
|
70
|
+
end
|
71
|
+
specify "it should not return users that left through an un-assign" do
|
72
|
+
@event.contact_people.should_not include @user
|
73
|
+
@event.contact_people_group.assign_user @user; time_travel 2.seconds
|
74
|
+
@event.contact_people.should include @user
|
75
|
+
@event.contact_people_group.unassign_user @user; time_travel 2.seconds
|
76
|
+
@event.contact_people.should_not include @user
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "#attendees" do
|
81
|
+
subject { @event.attendees }
|
82
|
+
before { @user = create :user }
|
83
|
+
specify "it should return joined users" do
|
84
|
+
@event.attendees.should_not include @user
|
85
|
+
@user.join @event; time_travel 2.seconds
|
86
|
+
@event.attendees.should include @user
|
87
|
+
end
|
88
|
+
specify "it should not return users that left through an un-assign" do
|
89
|
+
@event.attendees.should_not include @user
|
90
|
+
@user.join @event; time_travel 2.seconds
|
91
|
+
@event.attendees.should include @user
|
92
|
+
@event.attendees_group.unassign_user @user; time_travel 2.seconds
|
93
|
+
@event.attendees.should_not include @user
|
94
|
+
end
|
95
|
+
specify "multiple joins should not create several attendees groups (bug fix)" do
|
96
|
+
@user.join @event
|
97
|
+
@other_user = create :user; @other_user.join @event
|
98
|
+
subject.should include @user, @other_user
|
99
|
+
@event.child_groups.find_all_by_flag(:attendees).count.should == 1
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
# Scopes
|
105
|
+
# ==========================================================================================
|
106
|
+
|
107
|
+
describe ".upcoming" do
|
108
|
+
before do
|
109
|
+
@upcoming_event = create( :event, start_at: 5.hours.from_now )
|
110
|
+
@recent_event = create(:event, start_at: 2.days.ago, end_at: 2.days.ago + 2.hours)
|
111
|
+
@recent_event_today = create(:event, start_at: Date.today.to_datetime.change(hour: 0, min: 5))
|
112
|
+
@group.child_events << @upcoming_event << @recent_event
|
113
|
+
@unrelated_event = create( :event, start_at: 5.hours.from_now )
|
114
|
+
end
|
115
|
+
subject { Event.upcoming }
|
116
|
+
it "should return events starting in the future" do
|
117
|
+
subject.should include @upcoming_event
|
118
|
+
end
|
119
|
+
it "should not return events having started some days ago (in the past)" do
|
120
|
+
subject.should_not include @recent_event
|
121
|
+
end
|
122
|
+
it "should return events that have started on the same day, i.e. are currently in progress" do
|
123
|
+
subject.should include @recent_event_today
|
124
|
+
end
|
125
|
+
describe "chained with .find_all_by_group" do
|
126
|
+
subject { Event.find_all_by_group( @group ).upcoming }
|
127
|
+
it "should commute with find_all_by_group" do
|
128
|
+
Event.find_all_by_group( @group ).upcoming.should ==
|
129
|
+
Event.upcoming.find_all_by_group( @group )
|
130
|
+
end
|
131
|
+
it "should return associated events starting in the future" do
|
132
|
+
subject.should include @upcoming_event
|
133
|
+
end
|
134
|
+
it "should not return associated events starting in the past" do
|
135
|
+
subject.should_not include @recent_event
|
136
|
+
end
|
137
|
+
it "should not return un-associated events" do
|
138
|
+
subject.should_not include @unrelated_event
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
describe ".direct" do
|
144
|
+
# group_a
|
145
|
+
# |----- event_0
|
146
|
+
# |----- group_b
|
147
|
+
# | |------ event_1
|
148
|
+
# | |------ user
|
149
|
+
# |
|
150
|
+
# |----- group_c
|
151
|
+
# |------ event_2
|
152
|
+
before do
|
153
|
+
@group_a = create( :group )
|
154
|
+
@event_0 = @group_a.child_events.create
|
155
|
+
@group_b = @group_a.child_groups.create
|
156
|
+
@event_1 = @group_b.child_events.create
|
157
|
+
@group_c = @group_a.child_groups.create
|
158
|
+
@event_2 = @group_c.child_events.create
|
159
|
+
end
|
160
|
+
it "should list direct events" do
|
161
|
+
@group_a.events.should include @event_0, @event_1, @event_2
|
162
|
+
@group_a.events.direct.should include @event_0
|
163
|
+
@group_a.events.direct.should_not include @event_1
|
164
|
+
end
|
165
|
+
it "should commute with .find_all_by_group" do
|
166
|
+
Event.find_all_by_group( @group_a ).direct.to_a.should ==
|
167
|
+
Event.direct.find_all_by_group( @group_a ).to_a
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
|
172
|
+
# Finder Methods
|
173
|
+
# ==========================================================================================
|
174
|
+
|
175
|
+
describe ".find_all_by_group" do
|
176
|
+
before do
|
177
|
+
@sub_group = create( :group )
|
178
|
+
@sub_group.parent_groups << @group
|
179
|
+
@sub_group_event = create( :event )
|
180
|
+
@sub_group_event.parent_groups << @sub_group
|
181
|
+
@another_group = create( :group )
|
182
|
+
@unrelated_event = @another_group.events.create
|
183
|
+
end
|
184
|
+
subject { Event.find_all_by_group( @group ) }
|
185
|
+
it "should return direct events of the group" do
|
186
|
+
subject.should include @event
|
187
|
+
end
|
188
|
+
it "should return events of the sub groups as well" do
|
189
|
+
subject.should include @sub_group_event
|
190
|
+
@sub_group_event.ancestors.should include @group, @sub_group
|
191
|
+
end
|
192
|
+
it "should not return unrelated events" do
|
193
|
+
subject.should_not include @unrelated_event
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
describe ".find_all_by_groups" do
|
198
|
+
before do
|
199
|
+
@group1 = create( :group )
|
200
|
+
@event1 = @group1.events.create( :start_at => 5.hours.from_now )
|
201
|
+
@group2 = create( :group )
|
202
|
+
@event2 = @group2.events.create( :start_at => 2.hours.from_now )
|
203
|
+
@group3 = create( :group )
|
204
|
+
@event3 = @group3.events.create
|
205
|
+
end
|
206
|
+
subject { Event.find_all_by_groups( [ @group1, @group2 ] ) }
|
207
|
+
it "should return the events of the given groups" do
|
208
|
+
subject.should include @event1, @event2
|
209
|
+
end
|
210
|
+
it "should not return the events of other groups" do
|
211
|
+
subject.should_not include @event3
|
212
|
+
end
|
213
|
+
it "should return the events in ascending order" do
|
214
|
+
subject.first.start_at.should < subject.last.start_at
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
|
219
|
+
# Structure
|
220
|
+
# ==========================================================================================
|
221
|
+
|
222
|
+
# The following DAG structure should be possible in the model layer (bug fix).
|
223
|
+
#
|
224
|
+
# @corporation
|
225
|
+
# |---------- @status_group
|
226
|
+
# | |
|
227
|
+
# @event |
|
228
|
+
# |--- @contact_people |
|
229
|
+
# | |
|
230
|
+
# @user
|
231
|
+
#
|
232
|
+
specify "this dag structure should work (bug fix)" do
|
233
|
+
@user = create :user
|
234
|
+
@corporation = create :corporation_with_status_groups
|
235
|
+
@status_group = @corporation.status_groups.first
|
236
|
+
@event = @corporation.child_events.create
|
237
|
+
@contact_people = @event.contact_people_group
|
238
|
+
@contact_people.assign_user @user
|
239
|
+
end
|
240
|
+
specify "this structure is created in the events controller this way" do
|
241
|
+
@user = create :user
|
242
|
+
@group = create :group
|
243
|
+
@group.assign_user @user
|
244
|
+
|
245
|
+
@event = Event.new
|
246
|
+
@event.name ||= I18n.t(:enter_name_of_event_here)
|
247
|
+
@event.start_at ||= Time.zone.now.change(hour: 20, min: 15)
|
248
|
+
@event.save!
|
249
|
+
@event.parent_groups << @group
|
250
|
+
@event.contact_people_group.assign_user @user
|
251
|
+
end
|
252
|
+
|
253
|
+
|
254
|
+
describe "#destroy" do
|
255
|
+
subject { @event.destroy }
|
256
|
+
|
257
|
+
it "should destroy the contact people and attendees groups as well" do
|
258
|
+
@contact_people_group = @event.contact_people_group
|
259
|
+
@attendees_group = @event.attendees_group
|
260
|
+
|
261
|
+
subject
|
262
|
+
Group.exists?(id: @contact_people_group.id).should == false
|
263
|
+
Group.exists?(id: @attendees_group.id).should == false
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|