reduced_fat_crm 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +36 -0
- data/.rubocop.yml +5 -0
- data/.teatro.yml +3 -0
- data/.travis.yml +41 -0
- data/CHANGELOG +1923 -0
- data/CONTRIBUTORS +91 -0
- data/Capfile +25 -0
- data/Dockerfile +18 -0
- data/Gemfile +88 -0
- data/Gemfile.lock +430 -0
- data/Guardfile +24 -0
- data/MIT-LICENSE +21 -0
- data/Procfile +1 -0
- data/README.md +153 -0
- data/Rakefile +9 -0
- data/app/assets/images/1x1.gif +0 -0
- data/app/assets/images/asterisk.gif +0 -0
- data/app/assets/images/avatar.jpg +0 -0
- data/app/assets/images/blog.gif +0 -0
- data/app/assets/images/facebook.gif +0 -0
- data/app/assets/images/info.png +0 -0
- data/app/assets/images/info_tiny.png +0 -0
- data/app/assets/images/linkedin.gif +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/notifications.png +0 -0
- data/app/assets/images/skype.gif +0 -0
- data/app/assets/images/sortable.gif +0 -0
- data/app/assets/images/stars.gif +0 -0
- data/app/assets/images/twitter.gif +0 -0
- data/app/assets/javascripts/admin/fields.js.coffee +72 -0
- data/app/assets/javascripts/application.js.erb +41 -0
- data/app/assets/javascripts/crm.js.coffee +428 -0
- data/app/assets/javascripts/crm_chosen.js.coffee +29 -0
- data/app/assets/javascripts/crm_classes.js.coffee +215 -0
- data/app/assets/javascripts/crm_comments.js.coffee +28 -0
- data/app/assets/javascripts/crm_loginout.js.coffee +27 -0
- data/app/assets/javascripts/crm_select2.js.coffee +31 -0
- data/app/assets/javascripts/crm_sortable.js.coffee +32 -0
- data/app/assets/javascripts/crm_tags.js.coffee +22 -0
- data/app/assets/javascripts/crm_textarea_autocomplete.js.coffee +33 -0
- data/app/assets/javascripts/datepicker.js.coffee +20 -0
- data/app/assets/javascripts/format_buttons.js.coffee +52 -0
- data/app/assets/javascripts/lists.js.coffee +54 -0
- data/app/assets/javascripts/pagination.js.coffee +16 -0
- data/app/assets/javascripts/search.js.coffee +55 -0
- data/app/assets/javascripts/timeago.js.coffee +21 -0
- data/app/assets/stylesheets/about.css.scss +10 -0
- data/app/assets/stylesheets/admin/fields.css.scss +17 -0
- data/app/assets/stylesheets/advanced_search.css.scss +108 -0
- data/app/assets/stylesheets/application.css.erb +37 -0
- data/app/assets/stylesheets/base.scss +78 -0
- data/app/assets/stylesheets/common.scss +765 -0
- data/app/assets/stylesheets/ffcrm_chosen.scss +69 -0
- data/app/assets/stylesheets/fields.scss +27 -0
- data/app/assets/stylesheets/format_buttons.css.scss +40 -0
- data/app/assets/stylesheets/groups.css.scss +8 -0
- data/app/assets/stylesheets/header.scss +121 -0
- data/app/assets/stylesheets/index_headers.css.scss +5 -0
- data/app/assets/stylesheets/lists.css.scss +26 -0
- data/app/assets/stylesheets/print.css.scss +77 -0
- data/app/assets/stylesheets/rails.scss +133 -0
- data/app/assets/stylesheets/safari.scss +11 -0
- data/app/assets/stylesheets/textarea_autocomplete.scss +47 -0
- data/app/controllers/admin/application_controller.rb +30 -0
- data/app/controllers/admin/field_groups_controller.rb +83 -0
- data/app/controllers/admin/fields_controller.rb +118 -0
- data/app/controllers/admin/groups_controller.rb +65 -0
- data/app/controllers/admin/plugins_controller.rb +17 -0
- data/app/controllers/admin/settings_controller.rb +14 -0
- data/app/controllers/admin/tags_controller.rb +71 -0
- data/app/controllers/admin/users_controller.rb +144 -0
- data/app/controllers/application_controller.rb +276 -0
- data/app/controllers/authentications_controller.rb +51 -0
- data/app/controllers/comments_controller.rb +93 -0
- data/app/controllers/emails_controller.rb +18 -0
- data/app/controllers/entities/accounts_controller.rb +158 -0
- data/app/controllers/entities/campaigns_controller.rb +197 -0
- data/app/controllers/entities/contacts_controller.rb +178 -0
- data/app/controllers/entities/leads_controller.rb +256 -0
- data/app/controllers/entities/opportunities_controller.rb +222 -0
- data/app/controllers/entities_controller.rb +214 -0
- data/app/controllers/home_controller.rb +156 -0
- data/app/controllers/lists_controller.rb +40 -0
- data/app/controllers/passwords_controller.rb +65 -0
- data/app/controllers/tasks_controller.rb +219 -0
- data/app/controllers/users_controller.rb +159 -0
- data/app/helpers/accounts_helper.rb +110 -0
- data/app/helpers/addresses_helper.rb +17 -0
- data/app/helpers/admin/application_helper.rb +15 -0
- data/app/helpers/admin/field_groups_helper.rb +25 -0
- data/app/helpers/admin/fields_helper.rb +18 -0
- data/app/helpers/admin/plugins_helper.rb +7 -0
- data/app/helpers/admin/settings_helper.rb +7 -0
- data/app/helpers/admin/tags_helper.rb +10 -0
- data/app/helpers/admin/users_helper.rb +51 -0
- data/app/helpers/application_helper.rb +527 -0
- data/app/helpers/authentications_helper.rb +7 -0
- data/app/helpers/campaigns_helper.rb +34 -0
- data/app/helpers/comments_helper.rb +11 -0
- data/app/helpers/contacts_helper.rb +21 -0
- data/app/helpers/emails_helper.rb +7 -0
- data/app/helpers/fields_helper.rb +7 -0
- data/app/helpers/groups_helper.rb +7 -0
- data/app/helpers/home_helper.rb +66 -0
- data/app/helpers/javascript_helper.rb +30 -0
- data/app/helpers/leads_helper.rb +85 -0
- data/app/helpers/lists_helper.rb +7 -0
- data/app/helpers/opportunities_helper.rb +46 -0
- data/app/helpers/passwords_helper.rb +7 -0
- data/app/helpers/remote_link_pagination_helper.rb +8 -0
- data/app/helpers/tags_helper.rb +29 -0
- data/app/helpers/tasks_helper.rb +139 -0
- data/app/helpers/users_helper.rb +35 -0
- data/app/helpers/versions_helper.rb +32 -0
- data/app/inputs/date_pair_input.rb +65 -0
- data/app/inputs/date_time_input.rb +36 -0
- data/app/inputs/datetime_pair_input.rb +25 -0
- data/app/inputs/text_input.rb +12 -0
- data/app/mailers/dropbox_mailer.rb +18 -0
- data/app/mailers/subscription_mailer.rb +30 -0
- data/app/mailers/user_mailer.rb +32 -0
- data/app/models/entities/account.rb +142 -0
- data/app/models/entities/account_contact.rb +28 -0
- data/app/models/entities/account_opportunity.rb +26 -0
- data/app/models/entities/campaign.rb +116 -0
- data/app/models/entities/contact.rb +215 -0
- data/app/models/entities/contact_opportunity.rb +27 -0
- data/app/models/entities/lead.rb +197 -0
- data/app/models/entities/opportunity.rb +190 -0
- data/app/models/fields/core_field.rb +37 -0
- data/app/models/fields/custom_field.rb +148 -0
- data/app/models/fields/custom_field_date_pair.rb +42 -0
- data/app/models/fields/custom_field_datetime_pair.rb +12 -0
- data/app/models/fields/custom_field_pair.rb +42 -0
- data/app/models/fields/field.rb +129 -0
- data/app/models/fields/field_group.rb +63 -0
- data/app/models/list.rb +17 -0
- data/app/models/observers/entity_observer.rb +43 -0
- data/app/models/observers/lead_observer.rb +29 -0
- data/app/models/observers/opportunity_observer.rb +47 -0
- data/app/models/observers/task_observer.rb +31 -0
- data/app/models/polymorphic/address.rb +59 -0
- data/app/models/polymorphic/avatar.rb +55 -0
- data/app/models/polymorphic/comment.rb +73 -0
- data/app/models/polymorphic/email.rb +59 -0
- data/app/models/polymorphic/tag.rb +21 -0
- data/app/models/polymorphic/tagging.rb +8 -0
- data/app/models/polymorphic/task.rb +284 -0
- data/app/models/polymorphic/version.rb +81 -0
- data/app/models/setting.rb +103 -0
- data/app/models/users/ability.rb +59 -0
- data/app/models/users/authentication.rb +54 -0
- data/app/models/users/group.rb +13 -0
- data/app/models/users/permission.rb +27 -0
- data/app/models/users/preference.rb +50 -0
- data/app/models/users/user.rb +184 -0
- data/app/views/accounts/_account.html.haml +5 -0
- data/app/views/accounts/_contact_info.html.haml +37 -0
- data/app/views/accounts/_edit.html.haml +21 -0
- data/app/views/accounts/_index_brief.html.haml +32 -0
- data/app/views/accounts/_index_long.html.haml +42 -0
- data/app/views/accounts/_new.html.haml +21 -0
- data/app/views/accounts/_sidebar_index.html.haml +20 -0
- data/app/views/accounts/_sidebar_show.html.haml +57 -0
- data/app/views/accounts/_title_bar.html.haml +11 -0
- data/app/views/accounts/_top_section.html.haml +29 -0
- data/app/views/accounts/create.js.haml +17 -0
- data/app/views/accounts/destroy.js.haml +6 -0
- data/app/views/accounts/edit.js.haml +31 -0
- data/app/views/accounts/index.html.haml +18 -0
- data/app/views/accounts/index.js.haml +11 -0
- data/app/views/accounts/index.xls.builder +84 -0
- data/app/views/accounts/new.js.haml +11 -0
- data/app/views/accounts/show.html.haml +26 -0
- data/app/views/accounts/show.js.haml +5 -0
- data/app/views/accounts/update.js.haml +19 -0
- data/app/views/admin/custom_fields/_base_field.html.haml +21 -0
- data/app/views/admin/custom_fields/_check_boxes_field.html.haml +6 -0
- data/app/views/admin/custom_fields/_date_field.html.haml +14 -0
- data/app/views/admin/custom_fields/_date_pair_field.html.haml +21 -0
- data/app/views/admin/custom_fields/_datetime_field.html.haml +14 -0
- data/app/views/admin/custom_fields/_datetime_pair_field.html.haml +21 -0
- data/app/views/admin/custom_fields/_radio_field.html.haml +6 -0
- data/app/views/admin/custom_fields/_select_field.html.haml +25 -0
- data/app/views/admin/custom_fields/_string_field.html.haml +2 -0
- data/app/views/admin/field_groups/_confirm.html.haml +5 -0
- data/app/views/admin/field_groups/_edit.html.haml +8 -0
- data/app/views/admin/field_groups/_field_group.html.haml +28 -0
- data/app/views/admin/field_groups/_new.html.haml +10 -0
- data/app/views/admin/field_groups/_top_section.html.haml +14 -0
- data/app/views/admin/field_groups/confirm.js.haml +7 -0
- data/app/views/admin/field_groups/create.js.haml +14 -0
- data/app/views/admin/field_groups/destroy.js.haml +9 -0
- data/app/views/admin/field_groups/edit.js.haml +12 -0
- data/app/views/admin/field_groups/new.js.haml +8 -0
- data/app/views/admin/field_groups/update.js.haml +8 -0
- data/app/views/admin/fields/_field.html.haml +17 -0
- data/app/views/admin/fields/_form.html.haml +35 -0
- data/app/views/admin/fields/_sidebar_index.html.haml +1 -0
- data/app/views/admin/fields/_sidebar_show.html.haml +1 -0
- data/app/views/admin/fields/_sort_by.html.haml +10 -0
- data/app/views/admin/fields/_subform.html.haml +6 -0
- data/app/views/admin/fields/create.js.haml +17 -0
- data/app/views/admin/fields/destroy.js.haml +8 -0
- data/app/views/admin/fields/edit.js.haml +3 -0
- data/app/views/admin/fields/index.html.haml +34 -0
- data/app/views/admin/fields/show.html.haml +41 -0
- data/app/views/admin/fields/update.js.haml +13 -0
- data/app/views/admin/groups/_edit.html.haml +12 -0
- data/app/views/admin/groups/_form.html.haml +11 -0
- data/app/views/admin/groups/_group.html.haml +16 -0
- data/app/views/admin/groups/_new.html.haml +12 -0
- data/app/views/admin/groups/create.js.haml +10 -0
- data/app/views/admin/groups/destroy.js.haml +9 -0
- data/app/views/admin/groups/edit.js.haml +14 -0
- data/app/views/admin/groups/index.html.haml +18 -0
- data/app/views/admin/groups/index.js.haml +2 -0
- data/app/views/admin/groups/new.js.haml +9 -0
- data/app/views/admin/groups/show.html.haml +11 -0
- data/app/views/admin/groups/update.js.haml +9 -0
- data/app/views/admin/plugins/_plugin.html.haml +13 -0
- data/app/views/admin/plugins/index.html.haml +3 -0
- data/app/views/admin/settings/index.html.haml +3 -0
- data/app/views/admin/tags/_confirm.html.haml +5 -0
- data/app/views/admin/tags/_edit.html.haml +9 -0
- data/app/views/admin/tags/_new.html.haml +10 -0
- data/app/views/admin/tags/_tag.html.haml +29 -0
- data/app/views/admin/tags/_top_section.html.haml +6 -0
- data/app/views/admin/tags/confirm.js.haml +7 -0
- data/app/views/admin/tags/create.js.haml +11 -0
- data/app/views/admin/tags/destroy.js.haml +10 -0
- data/app/views/admin/tags/edit.js.haml +20 -0
- data/app/views/admin/tags/index.html.haml +17 -0
- data/app/views/admin/tags/new.js.haml +7 -0
- data/app/views/admin/tags/update.js.haml +9 -0
- data/app/views/admin/users/_confirm.html.haml +5 -0
- data/app/views/admin/users/_edit.html.haml +11 -0
- data/app/views/admin/users/_new.html.haml +11 -0
- data/app/views/admin/users/_profile.html.haml +54 -0
- data/app/views/admin/users/_sidebar_index.html.haml +2 -0
- data/app/views/admin/users/_user.html.haml +66 -0
- data/app/views/admin/users/confirm.js.haml +7 -0
- data/app/views/admin/users/create.js.haml +10 -0
- data/app/views/admin/users/destroy.js.haml +10 -0
- data/app/views/admin/users/edit.js.haml +20 -0
- data/app/views/admin/users/index.html.haml +13 -0
- data/app/views/admin/users/index.js.haml +2 -0
- data/app/views/admin/users/new.js.haml +9 -0
- data/app/views/admin/users/reactivate.js.haml +3 -0
- data/app/views/admin/users/show.html.haml +5 -0
- data/app/views/admin/users/suspend.js.haml +3 -0
- data/app/views/admin/users/update.js.haml +9 -0
- data/app/views/application/_auto_complete.html.haml +10 -0
- data/app/views/application/index.atom.builder +34 -0
- data/app/views/application/index.rss.builder +31 -0
- data/app/views/application/show.atom.builder +32 -0
- data/app/views/application/show.rss.builder +29 -0
- data/app/views/authentications/new.html.haml +19 -0
- data/app/views/campaigns/_campaign.html.haml +5 -0
- data/app/views/campaigns/_edit.html.haml +18 -0
- data/app/views/campaigns/_index_brief.html.haml +15 -0
- data/app/views/campaigns/_index_long.html.haml +20 -0
- data/app/views/campaigns/_metrics.html.haml +16 -0
- data/app/views/campaigns/_new.html.haml +18 -0
- data/app/views/campaigns/_objectives.html.haml +30 -0
- data/app/views/campaigns/_sidebar_index.html.haml +20 -0
- data/app/views/campaigns/_sidebar_show.html.haml +91 -0
- data/app/views/campaigns/_status.html.haml +24 -0
- data/app/views/campaigns/_title_bar.html.haml +11 -0
- data/app/views/campaigns/_top_section.html.haml +29 -0
- data/app/views/campaigns/create.js.haml +20 -0
- data/app/views/campaigns/destroy.js.haml +6 -0
- data/app/views/campaigns/edit.js.haml +31 -0
- data/app/views/campaigns/index.html.haml +18 -0
- data/app/views/campaigns/index.js.haml +11 -0
- data/app/views/campaigns/index.xls.builder +77 -0
- data/app/views/campaigns/new.js.haml +11 -0
- data/app/views/campaigns/show.html.haml +26 -0
- data/app/views/campaigns/show.js.haml +5 -0
- data/app/views/campaigns/update.js.haml +22 -0
- data/app/views/comments/_comment.html.haml +29 -0
- data/app/views/comments/_edit.html.haml +11 -0
- data/app/views/comments/_new.html.haml +35 -0
- data/app/views/comments/_subscription_links.html.haml +13 -0
- data/app/views/comments/create.js.haml +14 -0
- data/app/views/comments/destroy.js.haml +5 -0
- data/app/views/comments/edit.js.haml +11 -0
- data/app/views/comments/update.js.haml +9 -0
- data/app/views/contacts/_contact.html.haml +5 -0
- data/app/views/contacts/_contacts.html.haml +7 -0
- data/app/views/contacts/_edit.html.haml +19 -0
- data/app/views/contacts/_extra.html.haml +36 -0
- data/app/views/contacts/_index_brief.html.haml +25 -0
- data/app/views/contacts/_index_full.html.haml +57 -0
- data/app/views/contacts/_index_long.html.haml +44 -0
- data/app/views/contacts/_new.html.haml +20 -0
- data/app/views/contacts/_section_extra.html.haml +26 -0
- data/app/views/contacts/_section_general.html.haml +26 -0
- data/app/views/contacts/_sidebar_index.html.haml +0 -0
- data/app/views/contacts/_sidebar_show.html.haml +52 -0
- data/app/views/contacts/_title_bar.html.haml +11 -0
- data/app/views/contacts/_top_section.html.haml +45 -0
- data/app/views/contacts/_web.html.haml +31 -0
- data/app/views/contacts/create.js.haml +23 -0
- data/app/views/contacts/destroy.js.haml +9 -0
- data/app/views/contacts/edit.js.haml +34 -0
- data/app/views/contacts/index.html.haml +18 -0
- data/app/views/contacts/index.js.haml +11 -0
- data/app/views/contacts/index.xls.builder +104 -0
- data/app/views/contacts/new.js.haml +13 -0
- data/app/views/contacts/show.html.haml +22 -0
- data/app/views/contacts/show.js.haml +5 -0
- data/app/views/contacts/update.js.haml +24 -0
- data/app/views/dropbox_mailer/dropbox_notification.html.haml +9 -0
- data/app/views/emails/_email.html.haml +36 -0
- data/app/views/emails/destroy.js.haml +5 -0
- data/app/views/entities/_basic_search.html.haml +24 -0
- data/app/views/entities/_permissions.html.haml +36 -0
- data/app/views/entities/_search.html.haml +16 -0
- data/app/views/entities/_section_custom_fields.html.haml +11 -0
- data/app/views/entities/_sort_fields.html.haml +3 -0
- data/app/views/entities/_title_bar.html.haml +12 -0
- data/app/views/entities/attach.js.haml +21 -0
- data/app/views/entities/contacts.js.haml +3 -0
- data/app/views/entities/discard.js.haml +6 -0
- data/app/views/entities/leads.js.haml +3 -0
- data/app/views/entities/opportunities.js.haml +3 -0
- data/app/views/entities/subscription_update.js.haml +4 -0
- data/app/views/entities/versions.js.haml +3 -0
- data/app/views/fields/_edit_custom_field_group.html.haml +8 -0
- data/app/views/fields/_group.html.haml +11 -0
- data/app/views/fields/_group_table.html.haml +13 -0
- data/app/views/fields/_group_view.html.haml +10 -0
- data/app/views/fields/_groups.html.haml +8 -0
- data/app/views/fields/_sidebar_show.html.haml +9 -0
- data/app/views/fields/group.js.erb +3 -0
- data/app/views/home/_account.html.haml +29 -0
- data/app/views/home/_activity.html.haml +35 -0
- data/app/views/home/_assets_menu.html.haml +7 -0
- data/app/views/home/_duration_menu.html.haml +8 -0
- data/app/views/home/_events_menu.html.haml +8 -0
- data/app/views/home/_opportunity.html.haml +41 -0
- data/app/views/home/_options.html.haml +12 -0
- data/app/views/home/_task.html.haml +48 -0
- data/app/views/home/_users_menu.html.haml +8 -0
- data/app/views/home/index.atom.builder +24 -0
- data/app/views/home/index.html.haml +46 -0
- data/app/views/home/index.js.haml +7 -0
- data/app/views/home/index.rss.builder +20 -0
- data/app/views/home/options.js.haml +7 -0
- data/app/views/layouts/500.html.haml +17 -0
- data/app/views/layouts/_about.html.haml +17 -0
- data/app/views/layouts/_footer.html.haml +9 -0
- data/app/views/layouts/_header.html.haml +20 -0
- data/app/views/layouts/_jumpbox.html.haml +34 -0
- data/app/views/layouts/_sidebar.html.haml +12 -0
- data/app/views/layouts/_tabbed.html.haml +15 -0
- data/app/views/layouts/_tabless.html.haml +3 -0
- data/app/views/layouts/admin/_header.html.haml +14 -0
- data/app/views/layouts/admin/application.html.haml +24 -0
- data/app/views/layouts/application.html.haml +48 -0
- data/app/views/layouts/header.xls.builder +8 -0
- data/app/views/leads/_contact.html.haml +35 -0
- data/app/views/leads/_convert.html.haml +25 -0
- data/app/views/leads/_convert_permissions.html.haml +31 -0
- data/app/views/leads/_edit.html.haml +23 -0
- data/app/views/leads/_index_brief.html.haml +41 -0
- data/app/views/leads/_index_long.html.haml +62 -0
- data/app/views/leads/_lead.html.haml +5 -0
- data/app/views/leads/_leads.html.haml +6 -0
- data/app/views/leads/_new.html.haml +24 -0
- data/app/views/leads/_opportunity.html.haml +37 -0
- data/app/views/leads/_sidebar_index.html.haml +20 -0
- data/app/views/leads/_sidebar_show.html.haml +65 -0
- data/app/views/leads/_status.html.haml +36 -0
- data/app/views/leads/_title_bar.html.haml +16 -0
- data/app/views/leads/_top_section.html.haml +30 -0
- data/app/views/leads/_web.html.haml +31 -0
- data/app/views/leads/convert.js.haml +35 -0
- data/app/views/leads/create.js.haml +21 -0
- data/app/views/leads/destroy.js.haml +9 -0
- data/app/views/leads/edit.js.haml +33 -0
- data/app/views/leads/index.html.haml +18 -0
- data/app/views/leads/index.js.haml +11 -0
- data/app/views/leads/index.xls.builder +102 -0
- data/app/views/leads/new.js.haml +11 -0
- data/app/views/leads/promote.js.haml +26 -0
- data/app/views/leads/reject.js.haml +12 -0
- data/app/views/leads/show.html.haml +20 -0
- data/app/views/leads/show.js.haml +5 -0
- data/app/views/leads/update.js.haml +28 -0
- data/app/views/lists/_lists.html.haml +6 -0
- data/app/views/lists/_sidebar.html.haml +29 -0
- data/app/views/lists/create.js.haml +9 -0
- data/app/views/lists/destroy.js.haml +1 -0
- data/app/views/opportunities/_edit.html.haml +18 -0
- data/app/views/opportunities/_index_brief.html.haml +29 -0
- data/app/views/opportunities/_index_long.html.haml +59 -0
- data/app/views/opportunities/_new.html.haml +18 -0
- data/app/views/opportunities/_opportunities.html.haml +6 -0
- data/app/views/opportunities/_opportunity.html.haml +5 -0
- data/app/views/opportunities/_sidebar_index.html.haml +20 -0
- data/app/views/opportunities/_sidebar_show.html.haml +61 -0
- data/app/views/opportunities/_title_bar.html.haml +11 -0
- data/app/views/opportunities/_top_section.html.haml +59 -0
- data/app/views/opportunities/contacts.js.haml +3 -0
- data/app/views/opportunities/create.js.haml +29 -0
- data/app/views/opportunities/destroy.js.haml +13 -0
- data/app/views/opportunities/edit.js.haml +34 -0
- data/app/views/opportunities/index.html.haml +20 -0
- data/app/views/opportunities/index.js.haml +11 -0
- data/app/views/opportunities/index.xls.builder +71 -0
- data/app/views/opportunities/new.js.haml +13 -0
- data/app/views/opportunities/show.html.haml +22 -0
- data/app/views/opportunities/show.js.haml +5 -0
- data/app/views/opportunities/update.js.haml +27 -0
- data/app/views/passwords/edit.html.haml +15 -0
- data/app/views/passwords/new.html.haml +10 -0
- data/app/views/shared/_add_comment.html.haml +8 -0
- data/app/views/shared/_address.html.haml +44 -0
- data/app/views/shared/_address_show.html.haml +24 -0
- data/app/views/shared/_comment.html.haml +11 -0
- data/app/views/shared/_edit_comment.html.haml +13 -0
- data/app/views/shared/_empty.html.haml +8 -0
- data/app/views/shared/_export.html.haml +2 -0
- data/app/views/shared/_inline_styles.html.haml +31 -0
- data/app/views/shared/_naming.html.haml +9 -0
- data/app/views/shared/_paginate.haml +2 -0
- data/app/views/shared/_paginate_with_per_page.html.haml +12 -0
- data/app/views/shared/_recent.html.haml +4 -0
- data/app/views/shared/_recently.html.haml +7 -0
- data/app/views/shared/_search.html.haml +15 -0
- data/app/views/shared/_select_popup.html.haml +19 -0
- data/app/views/shared/_tags.html.haml +10 -0
- data/app/views/shared/_tasks.html.haml +10 -0
- data/app/views/shared/_timeline.html.haml +2 -0
- data/app/views/shared/_total.html.haml +4 -0
- data/app/views/subscription_mailer/comment_notification.text.erb +7 -0
- data/app/views/tasks/_assigned.html.haml +47 -0
- data/app/views/tasks/_completed.html.haml +25 -0
- data/app/views/tasks/_edit.html.haml +18 -0
- data/app/views/tasks/_empty.html.haml +4 -0
- data/app/views/tasks/_new.html.haml +14 -0
- data/app/views/tasks/_pending.html.haml +52 -0
- data/app/views/tasks/_related.html.haml +32 -0
- data/app/views/tasks/_selector.html.haml +8 -0
- data/app/views/tasks/_sidebar_index.html.haml +18 -0
- data/app/views/tasks/_tasks.html.haml +3 -0
- data/app/views/tasks/_title.html.haml +8 -0
- data/app/views/tasks/_top_section.html.haml +34 -0
- data/app/views/tasks/complete.js.haml +14 -0
- data/app/views/tasks/create.js.haml +39 -0
- data/app/views/tasks/destroy.js.haml +7 -0
- data/app/views/tasks/discard.js.haml +1 -0
- data/app/views/tasks/edit.js.haml +26 -0
- data/app/views/tasks/filter.js.haml +4 -0
- data/app/views/tasks/index.html.haml +20 -0
- data/app/views/tasks/index.xls.builder +49 -0
- data/app/views/tasks/new.js.haml +8 -0
- data/app/views/tasks/uncomplete.js.haml +12 -0
- data/app/views/tasks/update.js.haml +19 -0
- data/app/views/user_mailer/assigned_entity_notification.html.haml +3 -0
- data/app/views/user_mailer/password_reset_instructions.html.haml +6 -0
- data/app/views/users/_avatar.html.haml +20 -0
- data/app/views/users/_languages.html.haml +9 -0
- data/app/views/users/_password.html.haml +27 -0
- data/app/views/users/_profile.html.haml +67 -0
- data/app/views/users/_user.html.haml +33 -0
- data/app/views/users/_user_report.html.haml +6 -0
- data/app/views/users/avatar.js.haml +9 -0
- data/app/views/users/change_password.js.haml +13 -0
- data/app/views/users/edit.js.haml +9 -0
- data/app/views/users/index.html.haml +3 -0
- data/app/views/users/new.html.haml +19 -0
- data/app/views/users/opportunities_overview.html.haml +16 -0
- data/app/views/users/password.js.haml +10 -0
- data/app/views/users/show.html.haml +15 -0
- data/app/views/users/update.js.haml +9 -0
- data/app/views/users/upload_avatar.js.haml +7 -0
- data/app/views/versions/_version.html.haml +17 -0
- data/app/views/versions/_version_item.html.haml +8 -0
- data/app/views/versions/_versions.html.haml +11 -0
- data/bin/bundle +3 -0
- data/bin/rails +4 -0
- data/bin/rake +4 -0
- data/config.ru +4 -0
- data/config/application.rb +77 -0
- data/config/boot.rb +10 -0
- data/config/database.mysql.mac.yml +32 -0
- data/config/database.mysql.yml +33 -0
- data/config/database.postgres.docker.yml +25 -0
- data/config/database.postgres.yml +26 -0
- data/config/database.sqlite.yml +23 -0
- data/config/deploy.example.rb +77 -0
- data/config/environment.rb +10 -0
- data/config/environments/development.rb +46 -0
- data/config/environments/production.rb +66 -0
- data/config/environments/staging.rb +66 -0
- data/config/environments/test.rb +54 -0
- data/config/initializers/action_mailer.rb +22 -0
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/authlogic.rb +6 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/constants.rb +6 -0
- data/config/initializers/cookies_serializer.rb +3 -0
- data/config/initializers/custom_field_ransack_translations.rb +17 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/gravatar.rb +12 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/locale.rb +18 -0
- data/config/initializers/mime_types.rb +12 -0
- data/config/initializers/paginate_arrays.rb +11 -0
- data/config/initializers/ransack.rb +20 -0
- data/config/initializers/relative_url_root.rb +10 -0
- data/config/initializers/secret_token.rb +25 -0
- data/config/initializers/session_store.rb +5 -0
- data/config/initializers/simple_form.rb +100 -0
- data/config/initializers/views.rb +47 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/cz.yml +247 -0
- data/config/locales/cz_fat_free_crm.yml +610 -0
- data/config/locales/de.yml +237 -0
- data/config/locales/de_fat_free_crm.yml +842 -0
- data/config/locales/de_ransack.yml +91 -0
- data/config/locales/en-GB.yml +219 -0
- data/config/locales/en-GB_fat_free_crm.yml +937 -0
- data/config/locales/en-GB_ransack.yml +91 -0
- data/config/locales/en-US.yml +219 -0
- data/config/locales/en-US_fat_free_crm.yml +937 -0
- data/config/locales/en-US_ransack.yml +91 -0
- data/config/locales/en.yml +23 -0
- data/config/locales/es-CL.yml +227 -0
- data/config/locales/es-CL_fat_free_crm.yml +929 -0
- data/config/locales/es-CL_ransack.yml +91 -0
- data/config/locales/es.yml +219 -0
- data/config/locales/es_fat_free_crm.yml +917 -0
- data/config/locales/es_ransack.yml +91 -0
- data/config/locales/fr-CA.yml +224 -0
- data/config/locales/fr-CA_fat_free_crm.yml +570 -0
- data/config/locales/fr.yml +227 -0
- data/config/locales/fr_fat_free_crm.yml +934 -0
- data/config/locales/it.yml +219 -0
- data/config/locales/it_fat_free_crm.yml +592 -0
- data/config/locales/ja.yml +219 -0
- data/config/locales/ja_fat_free_crm.yml +557 -0
- data/config/locales/ja_ransack.yml +91 -0
- data/config/locales/nl.yml +210 -0
- data/config/locales/nl_fat_free_crm.yml +920 -0
- data/config/locales/nl_ransack.yml +91 -0
- data/config/locales/pl.yml +230 -0
- data/config/locales/pl_fat_free_crm.yml +570 -0
- data/config/locales/pt-BR.yml +232 -0
- data/config/locales/pt-BR_fat_free_crm.yml +650 -0
- data/config/locales/ru.yml +326 -0
- data/config/locales/ru_fat_free_crm.yml +977 -0
- data/config/locales/sv-SE.yml +215 -0
- data/config/locales/sv-SE_fat_free_crm.yml +565 -0
- data/config/locales/th.rb +204 -0
- data/config/locales/th_fat_free_crm.yml +558 -0
- data/config/locales/zh-CN.yml +241 -0
- data/config/locales/zh-CN_fat_free_crm.yml +937 -0
- data/config/locales/zh-CN_ransack.yml +91 -0
- data/config/routes.rb +199 -0
- data/config/settings.default.yml +400 -0
- data/config/unicorn.rb +32 -0
- data/custom_plan.rb +9 -0
- data/db/demo/account_contacts.yml +24 -0
- data/db/demo/account_opportunities.yml +24 -0
- data/db/demo/accounts.yml +47 -0
- data/db/demo/activities.yml +16 -0
- data/db/demo/addresses.yml +46 -0
- data/db/demo/avatars.yml +16 -0
- data/db/demo/campaigns.yml +144 -0
- data/db/demo/comments.yml +30 -0
- data/db/demo/contact_opportunities.yml +25 -0
- data/db/demo/contacts.yml +70 -0
- data/db/demo/emails.yml +53 -0
- data/db/demo/field_groups.yml +14 -0
- data/db/demo/leads.yml +71 -0
- data/db/demo/opportunities.yml +48 -0
- data/db/demo/permissions.yml +13 -0
- data/db/demo/preferences.yml +13 -0
- data/db/demo/settings.yml +12 -0
- data/db/demo/tasks.yml +64 -0
- data/db/demo/users.yml +245 -0
- data/db/migrate/20100928030598_create_sessions.rb +21 -0
- data/db/migrate/20100928030599_create_users.rb +45 -0
- data/db/migrate/20100928030600_create_openid_tables.rb +23 -0
- data/db/migrate/20100928030601_create_accounts.rb +26 -0
- data/db/migrate/20100928030602_create_permissions.rb +15 -0
- data/db/migrate/20100928030603_create_settings.rb +15 -0
- data/db/migrate/20100928030604_create_preferences.rb +15 -0
- data/db/migrate/20100928030605_create_campaigns.rb +34 -0
- data/db/migrate/20100928030606_create_leads.rb +38 -0
- data/db/migrate/20100928030607_create_contacts.rb +38 -0
- data/db/migrate/20100928030608_create_opportunities.rb +27 -0
- data/db/migrate/20100928030609_create_account_contacts.rb +14 -0
- data/db/migrate/20100928030610_create_account_opportunities.rb +14 -0
- data/db/migrate/20100928030611_create_contact_opportunities.rb +15 -0
- data/db/migrate/20100928030612_create_tasks.rb +26 -0
- data/db/migrate/20100928030613_create_comments.rb +16 -0
- data/db/migrate/20100928030614_create_activities.rb +19 -0
- data/db/migrate/20100928030615_create_avatars.rb +16 -0
- data/db/migrate/20100928030616_rename_remember_token.rb +11 -0
- data/db/migrate/20100928030617_drop_openid_tables.rb +23 -0
- data/db/migrate/20100928030618_add_admin_to_users.rb +11 -0
- data/db/migrate/20100928030619_add_suspended_to_users.rb +11 -0
- data/db/migrate/20100928030620_remove_uuid.rb +24 -0
- data/db/migrate/20100928030621_add_email_to_accounts.rb +9 -0
- data/db/migrate/20100928030622_add_background_info_to_models.rb +19 -0
- data/db/migrate/20100928030623_create_addresses.rb +49 -0
- data/db/migrate/20100928030624_add_index_on_permissions.rb +9 -0
- data/db/migrate/20100928030625_create_emails.rb +26 -0
- data/db/migrate/20100928030626_add_state_to_timeline_objects.rb +13 -0
- data/db/migrate/20100928030627_acts_as_taggable_on_migration.rb +29 -0
- data/db/migrate/20101221123456_add_single_access_token_to_users.rb +9 -0
- data/db/migrate/20101221345678_add_rating_and_category_to_accounts.rb +11 -0
- data/db/migrate/20110719082054_add_skype_to_contacts_and_leads.rb +11 -0
- data/db/migrate/20111101083437_create_fields.rb +27 -0
- data/db/migrate/20111101090312_create_field_groups.rb +15 -0
- data/db/migrate/20111116091952_add_field_groups_tag_id.rb +9 -0
- data/db/migrate/20111117041311_change_fields_collection_to_text.rb +9 -0
- data/db/migrate/20111201030535_add_field_groups_klass_name.rb +24 -0
- data/db/migrate/20120121054235_create_lists.rb +10 -0
- data/db/migrate/20120216031616_create_versions.rb +18 -0
- data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +10 -0
- data/db/migrate/20120220233724_add_versions_object_changes.rb +9 -0
- data/db/migrate/20120224073107_remove_default_value_and_clear_settings.rb +16 -0
- data/db/migrate/20120309070209_add_versions_related.rb +6 -0
- data/db/migrate/20120314080441_add_subscribed_users_to_entities.rb +23 -0
- data/db/migrate/20120316045804_activities_to_versions.rb +35 -0
- data/db/migrate/20120405080727_change_subscribed_users_to_set.rb +24 -0
- data/db/migrate/20120405080742_change_further_subscribed_users_to_set.rb +27 -0
- data/db/migrate/20120406082136_create_groups.rb +19 -0
- data/db/migrate/20120413034923_add_index_on_versions_item_type.rb +5 -0
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +22 -0
- data/db/migrate/20120528102124_increase_length_of_version_events.rb +9 -0
- data/db/migrate/20120801032706_add_pair_id_to_fields.rb +5 -0
- data/db/migrate/20121003063155_add_settings_to_custom_fields.rb +5 -0
- data/db/migrate/20121221033947_fix_country_mapping.rb +31 -0
- data/db/migrate/20131207033244_add_user_id_to_lists.rb +6 -0
- data/db/migrate/20140916011927_add_created_at_index_on_versions.rb +5 -0
- data/db/migrate/20140916012922_add_indexes_to_model_associations.rb +6 -0
- data/db/migrate/20141126031837_increase_email_to254_chars.rb +21 -0
- data/db/migrate/20141230021159_add_transaction_id_column_to_versions.rb +11 -0
- data/db/migrate/20141230205453_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
- data/db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20141230205455_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20150123060900_convert_radio_to_radio_buttons.rb +10 -0
- data/db/migrate/20150227123054_remove_last_request_at_from_users.rb +5 -0
- data/db/migrate/20150427131956_create_index_related_type.rb +9 -0
- data/db/migrate/20160511053730_add_account_contacts_index.rb +5 -0
- data/db/schema.rb +459 -0
- data/db/seeds.rb +9 -0
- data/db/seeds/fields.rb +93 -0
- data/docker-compose.yml +13 -0
- data/fat_free_crm.gemspec +63 -0
- data/lib/development_tasks/gem.rake +13 -0
- data/lib/development_tasks/license.rake +77 -0
- data/lib/development_tasks/rdoc.rake +20 -0
- data/lib/development_tasks/rspec.rake +24 -0
- data/lib/fat_free_crm.rb +57 -0
- data/lib/fat_free_crm/callback.rb +144 -0
- data/lib/fat_free_crm/comment_extensions.rb +28 -0
- data/lib/fat_free_crm/core_ext.rb +6 -0
- data/lib/fat_free_crm/core_ext/nil.rb +14 -0
- data/lib/fat_free_crm/core_ext/string.rb +48 -0
- data/lib/fat_free_crm/custom_fields.rb +12 -0
- data/lib/fat_free_crm/engine.rb +27 -0
- data/lib/fat_free_crm/errors.rb +37 -0
- data/lib/fat_free_crm/exceptions.rb +21 -0
- data/lib/fat_free_crm/export_csv.rb +33 -0
- data/lib/fat_free_crm/exportable.rb +49 -0
- data/lib/fat_free_crm/fields.rb +95 -0
- data/lib/fat_free_crm/gem_dependencies.rb +40 -0
- data/lib/fat_free_crm/gem_ext.rb +10 -0
- data/lib/fat_free_crm/gem_ext/action_controller/base.rb +16 -0
- data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +27 -0
- data/lib/fat_free_crm/gem_ext/active_support/buffered_logger.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rails/engine.rb +15 -0
- data/lib/fat_free_crm/gem_ext/rake/task.rb +13 -0
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +24 -0
- data/lib/fat_free_crm/i18n.rb +42 -0
- data/lib/fat_free_crm/load_settings.rb +18 -0
- data/lib/fat_free_crm/mail_processor/base.rb +227 -0
- data/lib/fat_free_crm/mail_processor/comment_replies.rb +69 -0
- data/lib/fat_free_crm/mail_processor/dropbox.rb +273 -0
- data/lib/fat_free_crm/permissions.rb +109 -0
- data/lib/fat_free_crm/renderers.rb +11 -0
- data/lib/fat_free_crm/secret_token_generator.rb +59 -0
- data/lib/fat_free_crm/sortable.rb +43 -0
- data/lib/fat_free_crm/tabs.rb +23 -0
- data/lib/fat_free_crm/version.rb +15 -0
- data/lib/fat_free_crm/view_factory.rb +81 -0
- data/lib/gravatar_image_tag.rb +58 -0
- data/lib/missing_translation_detector.rb +50 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/.gitkeep~master +0 -0
- data/lib/tasks/ffcrm/comment_replies.rake +27 -0
- data/lib/tasks/ffcrm/config.rake +40 -0
- data/lib/tasks/ffcrm/demo.rake +62 -0
- data/lib/tasks/ffcrm/dropbox.rake +28 -0
- data/lib/tasks/ffcrm/missing_translations.rake +34 -0
- data/lib/tasks/ffcrm/secret.rake +15 -0
- data/lib/tasks/ffcrm/settings.rake +20 -0
- data/lib/tasks/ffcrm/setup.rake +81 -0
- data/lib/tasks/ffcrm/update_data.rake +238 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +5 -0
- data/script/rails +6 -0
- data/spec/controllers/admin/groups_controller_spec.rb +9 -0
- data/spec/controllers/admin/users_controller_spec.rb +305 -0
- data/spec/controllers/applications_controller_spec.rb +41 -0
- data/spec/controllers/authentications_controller_spec.rb +148 -0
- data/spec/controllers/comments_controller_spec.rb +193 -0
- data/spec/controllers/emails_controller_spec.rb +35 -0
- data/spec/controllers/entities/accounts_controller_spec.rb +605 -0
- data/spec/controllers/entities/campaigns_controller_spec.rb +643 -0
- data/spec/controllers/entities/contacts_controller_spec.rb +702 -0
- data/spec/controllers/entities/leads_controller_spec.rb +1007 -0
- data/spec/controllers/entities/opportunities_controller_spec.rb +902 -0
- data/spec/controllers/entities_controller_spec.rb +40 -0
- data/spec/controllers/home_controller_spec.rb +231 -0
- data/spec/controllers/lists_controller_spec.rb +9 -0
- data/spec/controllers/passwords_controller_spec.rb +30 -0
- data/spec/controllers/tasks_controller_spec.rb +512 -0
- data/spec/controllers/users_controller_spec.rb +431 -0
- data/spec/factories/account_factories.rb +38 -0
- data/spec/factories/campaign_factories.rb +28 -0
- data/spec/factories/contact_factories.rb +43 -0
- data/spec/factories/field_factories.rb +37 -0
- data/spec/factories/lead_factories.rb +34 -0
- data/spec/factories/list_factories.rb +11 -0
- data/spec/factories/opportunity_factories.rb +37 -0
- data/spec/factories/sequences.rb +31 -0
- data/spec/factories/setting_factories.rb +13 -0
- data/spec/factories/shared_factories.rb +66 -0
- data/spec/factories/subscription_factories.rb +11 -0
- data/spec/factories/tag_factories.rb +10 -0
- data/spec/factories/task_factories.rb +27 -0
- data/spec/factories/user_factories.rb +64 -0
- data/spec/features/acceptance_helper.rb +9 -0
- data/spec/features/accounts_spec.rb +109 -0
- data/spec/features/admin/groups_spec.rb +30 -0
- data/spec/features/admin/users_spec.rb +37 -0
- data/spec/features/campaigns_spec.rb +103 -0
- data/spec/features/contacts_spec.rb +129 -0
- data/spec/features/dashboard_spec.rb +66 -0
- data/spec/features/leads_spec.rb +129 -0
- data/spec/features/opportunities_overview_spec.rb +87 -0
- data/spec/features/opportunities_spec.rb +105 -0
- data/spec/features/support/browser.rb +18 -0
- data/spec/features/support/headless.rb +17 -0
- data/spec/features/support/helpers.rb +30 -0
- data/spec/features/support/maintain_sessions.rb +10 -0
- data/spec/features/support/paths.rb +46 -0
- data/spec/features/support/selector_helpers.rb +31 -0
- data/spec/features/tasks_spec.rb +93 -0
- data/spec/fixtures/rails.png +0 -0
- data/spec/helpers/accounts_helper_spec.rb +14 -0
- data/spec/helpers/admin/field_groups_helper_spec.rb +18 -0
- data/spec/helpers/admin/plugins_helper_spec.rb +9 -0
- data/spec/helpers/admin/settings_helper_spec.rb +9 -0
- data/spec/helpers/admin/users_helper_spec.rb +9 -0
- data/spec/helpers/application_helper_spec.rb +83 -0
- data/spec/helpers/authentications_helper_spec.rb +14 -0
- data/spec/helpers/campaigns_helper_spec.rb +14 -0
- data/spec/helpers/comments_helper_spec.rb +14 -0
- data/spec/helpers/contacts_helper_spec.rb +14 -0
- data/spec/helpers/emails_helper_spec.rb +9 -0
- data/spec/helpers/fields_helper_spec.rb +10 -0
- data/spec/helpers/groups_helper_spec.rb +19 -0
- data/spec/helpers/home_helper_spec.rb +14 -0
- data/spec/helpers/leads_helper_spec.rb +14 -0
- data/spec/helpers/lists_helper_spec.rb +19 -0
- data/spec/helpers/opportunities_helper_spec.rb +14 -0
- data/spec/helpers/passwords_helper_spec.rb +14 -0
- data/spec/helpers/tasks_helper_spec.rb +18 -0
- data/spec/helpers/users_helper_spec.rb +37 -0
- data/spec/lib/comment_extensions_spec.rb +34 -0
- data/spec/lib/core_ext/string_spec.rb +21 -0
- data/spec/lib/errors_spec.rb +30 -0
- data/spec/lib/fields_spec.rb +99 -0
- data/spec/lib/mail_processor/base_spec.rb +167 -0
- data/spec/lib/mail_processor/comment_replies_spec.rb +68 -0
- data/spec/lib/mail_processor/dropbox_spec.rb +304 -0
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +171 -0
- data/spec/lib/permissions_spec.rb +134 -0
- data/spec/lib/secret_token_generator_spec.rb +67 -0
- data/spec/lib/view_factory_spec.rb +67 -0
- data/spec/mailers/subscription_mailer_spec.rb +47 -0
- data/spec/mailers/user_mailer_spec.rb +139 -0
- data/spec/models/entities/account_contact_spec.rb +31 -0
- data/spec/models/entities/account_opportunity_spec.rb +31 -0
- data/spec/models/entities/account_spec.rb +178 -0
- data/spec/models/entities/campaign_spec.rb +136 -0
- data/spec/models/entities/contact_opportunity_spec.rb +32 -0
- data/spec/models/entities/contact_spec.rb +208 -0
- data/spec/models/entities/lead_spec.rb +102 -0
- data/spec/models/entities/opportunity_spec.rb +287 -0
- data/spec/models/fields/custom_field_date_pair_spec.rb +88 -0
- data/spec/models/fields/custom_field_pair_spec.rb +74 -0
- data/spec/models/fields/custom_field_spec.rb +125 -0
- data/spec/models/fields/field_group_spec.rb +27 -0
- data/spec/models/fields/field_spec.rb +65 -0
- data/spec/models/list_spec.rb +17 -0
- data/spec/models/observers/entity_observer_spec.rb +72 -0
- data/spec/models/polymorphic/address_spec.rb +36 -0
- data/spec/models/polymorphic/avatar_spec.rb +44 -0
- data/spec/models/polymorphic/comment_spec.rb +47 -0
- data/spec/models/polymorphic/email_spec.rb +40 -0
- data/spec/models/polymorphic/task_spec.rb +385 -0
- data/spec/models/polymorphic/version_spec.rb +244 -0
- data/spec/models/setting_spec.rb +54 -0
- data/spec/models/users/abilities/user_ability_spec.rb +63 -0
- data/spec/models/users/authentication_spec.rb +17 -0
- data/spec/models/users/group_spec.rb +9 -0
- data/spec/models/users/permission_spec.rb +48 -0
- data/spec/models/users/preference_spec.rb +69 -0
- data/spec/models/users/user_spec.rb +237 -0
- data/spec/routing/accounts_routing_spec.rb +58 -0
- data/spec/routing/admin/users_routing_spec.rb +38 -0
- data/spec/routing/campaigns_routing_spec.rb +62 -0
- data/spec/routing/comments_routing_spec.rb +30 -0
- data/spec/routing/contacts_routing_spec.rb +58 -0
- data/spec/routing/emails_routing_spec.rb +38 -0
- data/spec/routing/leads_routing_spec.rb +86 -0
- data/spec/routing/opportunities_routing_spec.rb +62 -0
- data/spec/routing/tasks_routing_spec.rb +66 -0
- data/spec/routing/users_routing_spec.rb +82 -0
- data/spec/shared/controllers.rb +103 -0
- data/spec/shared/models.rb +139 -0
- data/spec/spec_helper.rb +107 -0
- data/spec/support/assert_select.rb +164 -0
- data/spec/support/auth_macros.rb +48 -0
- data/spec/support/macros.rb +44 -0
- data/spec/support/mail_processor_mocks.rb +35 -0
- data/spec/support/uploaded_file.rb +8 -0
- data/spec/views/accounts/_edit.haml_spec.rb +42 -0
- data/spec/views/accounts/_new.haml_spec.rb +40 -0
- data/spec/views/accounts/create.js.haml_spec.rb +51 -0
- data/spec/views/accounts/destroy.js.haml_spec.rb +32 -0
- data/spec/views/accounts/edit.js.haml_spec.rb +64 -0
- data/spec/views/accounts/index.haml_spec.rb +41 -0
- data/spec/views/accounts/index.js.haml_spec.rb +32 -0
- data/spec/views/accounts/new.js.haml_spec.rb +42 -0
- data/spec/views/accounts/show.haml_spec.rb +33 -0
- data/spec/views/accounts/update.js.haml_spec.rb +94 -0
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +29 -0
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +29 -0
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +22 -0
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +23 -0
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +28 -0
- data/spec/views/admin/users/_create.haml_spec.rb +21 -0
- data/spec/views/admin/users/create.js.haml_spec.rb +40 -0
- data/spec/views/admin/users/destroy.js.haml_spec.rb +51 -0
- data/spec/views/admin/users/edit.js.haml_spec.rb +42 -0
- data/spec/views/admin/users/index.haml_spec.rb +20 -0
- data/spec/views/admin/users/index.js.haml_spec.rb +24 -0
- data/spec/views/admin/users/new.js.haml_spec.rb +32 -0
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +20 -0
- data/spec/views/admin/users/show.haml_spec.rb +16 -0
- data/spec/views/admin/users/suspend.js.haml_spec.rb +20 -0
- data/spec/views/admin/users/update.js.haml_spec.rb +36 -0
- data/spec/views/application/auto_complete.haml_spec.rb +46 -0
- data/spec/views/authentications/new.haml_spec.rb +29 -0
- data/spec/views/campaigns/_edit.haml_spec.rb +42 -0
- data/spec/views/campaigns/_new.haml_spec.rb +39 -0
- data/spec/views/campaigns/create.js.haml_spec.rb +48 -0
- data/spec/views/campaigns/destroy.js.haml_spec.rb +30 -0
- data/spec/views/campaigns/edit.js.haml_spec.rb +64 -0
- data/spec/views/campaigns/index.haml_spec.rb +35 -0
- data/spec/views/campaigns/index.js.haml_spec.rb +32 -0
- data/spec/views/campaigns/new.js.haml_spec.rb +48 -0
- data/spec/views/campaigns/show.haml_spec.rb +33 -0
- data/spec/views/campaigns/update.js.haml_spec.rb +80 -0
- data/spec/views/comments/edit.js.haml_spec.rb +29 -0
- data/spec/views/contacts/_edit.haml_spec.rb +71 -0
- data/spec/views/contacts/_new.haml_spec.rb +50 -0
- data/spec/views/contacts/create.js.haml_spec.rb +64 -0
- data/spec/views/contacts/destroy.js.haml_spec.rb +43 -0
- data/spec/views/contacts/edit.js.haml_spec.rb +72 -0
- data/spec/views/contacts/index.haml_spec.rb +35 -0
- data/spec/views/contacts/index.js.html_spec.rb +32 -0
- data/spec/views/contacts/new.js.haml_spec.rb +45 -0
- data/spec/views/contacts/show.haml_spec.rb +30 -0
- data/spec/views/contacts/update.js.haml_spec.rb +130 -0
- data/spec/views/home/index.haml_spec.rb +34 -0
- data/spec/views/home/index.js.haml_spec.rb +31 -0
- data/spec/views/home/options.js.haml_spec.rb +51 -0
- data/spec/views/leads/_convert.haml_spec.rb +28 -0
- data/spec/views/leads/_edit.haml_spec.rb +45 -0
- data/spec/views/leads/_new.haml_spec.rb +43 -0
- data/spec/views/leads/_sidebar_show.haml_spec.rb +29 -0
- data/spec/views/leads/convert.js.haml_spec.rb +77 -0
- data/spec/views/leads/create.js.haml_spec.rb +68 -0
- data/spec/views/leads/destroy.js.haml_spec.rb +47 -0
- data/spec/views/leads/edit.js.haml_spec.rb +74 -0
- data/spec/views/leads/index.haml_spec.rb +35 -0
- data/spec/views/leads/index.js.haml_spec.rb +32 -0
- data/spec/views/leads/new.js.haml_spec.rb +45 -0
- data/spec/views/leads/promote.js.haml_spec.rb +141 -0
- data/spec/views/leads/reject.js.haml_spec.rb +46 -0
- data/spec/views/leads/show.haml_spec.rb +27 -0
- data/spec/views/leads/update.js.haml_spec.rb +124 -0
- data/spec/views/opportunities/_edit.haml_spec.rb +68 -0
- data/spec/views/opportunities/_new.haml_spec.rb +49 -0
- data/spec/views/opportunities/create.js.haml_spec.rb +86 -0
- data/spec/views/opportunities/destroy.js.haml_spec.rb +65 -0
- data/spec/views/opportunities/edit.js.haml_spec.rb +73 -0
- data/spec/views/opportunities/index.haml_spec.rb +36 -0
- data/spec/views/opportunities/index.js.haml_spec.rb +33 -0
- data/spec/views/opportunities/new.js.haml_spec.rb +52 -0
- data/spec/views/opportunities/show.haml_spec.rb +30 -0
- data/spec/views/opportunities/update.js.haml_spec.rb +149 -0
- data/spec/views/tasks/_edit.haml_spec.rb +48 -0
- data/spec/views/tasks/complete.js.haml_spec.rb +66 -0
- data/spec/views/tasks/create.js.haml_spec.rb +119 -0
- data/spec/views/tasks/destroy.js.haml_spec.rb +56 -0
- data/spec/views/tasks/edit.js.haml_spec.rb +74 -0
- data/spec/views/tasks/index.haml_spec.rb +44 -0
- data/spec/views/tasks/new.js.haml_spec.rb +47 -0
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +44 -0
- data/spec/views/tasks/update.js.haml_spec.rb +141 -0
- data/spec/views/users/avatar.js.haml_spec.rb +33 -0
- data/spec/views/users/change_password.js.haml_spec.rb +50 -0
- data/spec/views/users/edit.js.haml_spec.rb +33 -0
- data/spec/views/users/password.js.haml_spec.rb +34 -0
- data/spec/views/users/update.js.haml_spec.rb +45 -0
- data/spec/views/users/upload_avatar.js.haml_spec.rb +44 -0
- data/vendor/assets/images/calendar_date_select/calendar.gif +0 -0
- data/vendor/assets/images/chosen-sprite.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_100_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_25_3875d7_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_65_3875d7_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_466bb1_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/javascripts/ajax-chosen-jquery.js +2 -0
- data/vendor/assets/javascripts/ajax-chosen.jquery.coffee +171 -0
- data/vendor/assets/javascripts/chosen-jquery.js +3 -0
- data/vendor/assets/javascripts/chosen.jquery.coffee +574 -0
- data/vendor/assets/javascripts/jquery.disable.js +23 -0
- data/vendor/assets/javascripts/jquery_timeago/index.js +19 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.cz.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.de.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.en-GB.js +20 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.en-US.js +20 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.es-CL.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.es.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.fr-CA.js +17 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.fr.js +17 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.it.js +16 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.ja.js +19 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.js +194 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.nl.js +20 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.pl.js +31 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.pt-BR.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.ru.js +34 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.sv-SE.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.th.js +20 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.zh-CN.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-addon.js +1882 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-af.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-ca.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-cz.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-de.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-el.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-es-CL.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-es.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-et.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-fi.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-fr-CA.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-fr.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-gl.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-he.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-hu.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-id.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-it.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-ja.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-ko.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-lt.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-nl.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-no.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-pl.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-pt-BR.js +22 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-pt.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-ro.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-ru.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-sk.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-sv-SE.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-th.js +19 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-tr.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-vi.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-zh-CN.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-zh-TW.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-cz.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-de.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-en-GB.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-es-CL.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-es.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-fr-CA.js +21 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-fr.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-it.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-ja.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-nl.js +21 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-pl.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-pt-BR.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-pt.js +21 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-ru.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-sv-SE.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-th.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-zh-CN.js +23 -0
- data/vendor/assets/javascripts/lib/abstract-chosen.coffee +110 -0
- data/vendor/assets/javascripts/lib/select-parser.coffee +51 -0
- data/vendor/assets/javascripts/rating.js +162 -0
- data/vendor/assets/javascripts/textarea_autocomplete.js +605 -0
- data/vendor/assets/stylesheets/chosen.css.sass +361 -0
- data/vendor/assets/stylesheets/jquery-ui.custom.scss +566 -0
- data/vendor/assets/stylesheets/modalbox.css +107 -0
- data/vendor/gems/globby-0.1.2/LICENSE.txt +20 -0
- data/vendor/gems/globby-0.1.2/README.md +65 -0
- data/vendor/gems/globby-0.1.2/Rakefile +9 -0
- data/vendor/gems/globby-0.1.2/lib/globby.rb +47 -0
- data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +90 -0
- data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +18 -0
- data/vendor/gems/globby-0.1.2/lib/globby/result.rb +20 -0
- data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +109 -0
- data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +93 -0
- data/zeus.json +22 -0
- metadata +1566 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
|
2
|
+
#
|
|
3
|
+
# Fat Free CRM is freely distributable under the terms of MIT license.
|
|
4
|
+
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
5
|
+
#------------------------------------------------------------------------------
|
|
6
|
+
require 'spec_helper'
|
|
7
|
+
|
|
8
|
+
describe EntitiesController do
|
|
9
|
+
describe "parse_query_and_tags" do
|
|
10
|
+
it "should parse empty string" do
|
|
11
|
+
str = ""
|
|
12
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(['', ''])
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should parse #tags" do
|
|
16
|
+
str = "#test"
|
|
17
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(['', 'test'])
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should parse no tags" do
|
|
21
|
+
str = "test query"
|
|
22
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(['test query', ''])
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should parse tags and query" do
|
|
26
|
+
str = "#real Billy Bones #pirate"
|
|
27
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(["Billy Bones", "real, pirate"])
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should parse strange characters" do
|
|
31
|
+
str = "#this is #a test !@$%^~ #parseme"
|
|
32
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(['is test !@$%^~', 'this, a, parseme'])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "should strip whitespace" do
|
|
36
|
+
str = " test me "
|
|
37
|
+
expect(controller.send(:parse_query_and_tags, str)).to eq(['test me', ''])
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
|
2
|
+
#
|
|
3
|
+
# Fat Free CRM is freely distributable under the terms of MIT license.
|
|
4
|
+
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
5
|
+
#------------------------------------------------------------------------------
|
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
7
|
+
|
|
8
|
+
describe HomeController do
|
|
9
|
+
# GET /
|
|
10
|
+
#----------------------------------------------------------------------------
|
|
11
|
+
describe "responding to GET /" do
|
|
12
|
+
before(:each) do
|
|
13
|
+
require_user
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should get a list of activities" do
|
|
17
|
+
activity = FactoryGirl.create(:version, item: FactoryGirl.create(:account, user: current_user))
|
|
18
|
+
expect(controller).to receive(:get_activities).once.and_return([activity])
|
|
19
|
+
get :index
|
|
20
|
+
expect(assigns[:activities]).to eq([activity])
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "should not include views in the list of activities" do
|
|
24
|
+
activity = FactoryGirl.create(:version, item: FactoryGirl.create(:account, user: @current_user), event: "view")
|
|
25
|
+
expect(controller).to receive(:get_activities).once.and_return([])
|
|
26
|
+
|
|
27
|
+
get :index
|
|
28
|
+
expect(assigns[:activities]).to eq([])
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it "should get a list of my tasks ordered by due_at" do
|
|
32
|
+
task_1 = FactoryGirl.create(:task, name: "Your first task", bucket: "due_asap", assigned_to: current_user.id)
|
|
33
|
+
task_2 = FactoryGirl.create(:task, name: "Another task for you", bucket: "specific_time", calendar: 5.days.from_now.to_s, assigned_to: current_user.id)
|
|
34
|
+
task_3 = FactoryGirl.create(:task, name: "Third Task", bucket: "due_next_week", assigned_to: current_user.id)
|
|
35
|
+
task_4 = FactoryGirl.create(:task, name: "i've assigned it to myself", user: current_user, calendar: 20.days.from_now.to_s, assigned_to: nil, bucket: "specific_time")
|
|
36
|
+
|
|
37
|
+
FactoryGirl.create(:task, name: "Someone else's Task", user_id: current_user.id, bucket: "due_asap", assigned_to: FactoryGirl.create(:user).id)
|
|
38
|
+
FactoryGirl.create(:task, name: "Not my task", bucket: "due_asap", assigned_to: FactoryGirl.create(:user).id)
|
|
39
|
+
|
|
40
|
+
get :index
|
|
41
|
+
expect(assigns[:my_tasks]).to eq([task_1, task_2, task_3, task_4])
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "should not display completed tasks" do
|
|
45
|
+
task_1 = FactoryGirl.create(:task, user_id: current_user.id, name: "Your first task", bucket: "due_asap", assigned_to: current_user.id)
|
|
46
|
+
task_2 = FactoryGirl.create(:task, user_id: current_user.id, name: "Completed task", bucket: "due_asap", completed_at: 1.days.ago, completed_by: current_user.id, assigned_to: current_user.id)
|
|
47
|
+
|
|
48
|
+
get :index
|
|
49
|
+
expect(assigns[:my_tasks]).to eq([task_1])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it "should get a list of my opportunities ordered by closes_on" do
|
|
53
|
+
opportunity_1 = FactoryGirl.create(:opportunity, name: "Your first opportunity", closes_on: 15.days.from_now, assigned_to: current_user.id, stage: 'proposal')
|
|
54
|
+
opportunity_2 = FactoryGirl.create(:opportunity, name: "Another opportunity for you", closes_on: 10.days.from_now, assigned_to: current_user.id, stage: 'proposal')
|
|
55
|
+
opportunity_3 = FactoryGirl.create(:opportunity, name: "Third Opportunity", closes_on: 5.days.from_now, assigned_to: current_user.id, stage: 'proposal')
|
|
56
|
+
opportunity_4 = FactoryGirl.create(:opportunity, name: "Fourth Opportunity", closes_on: 50.days.from_now, assigned_to: nil, user_id: current_user.id, stage: 'proposal')
|
|
57
|
+
|
|
58
|
+
FactoryGirl.create(:opportunity_in_pipeline, name: "Someone else's Opportunity", assigned_to: FactoryGirl.create(:user).id, stage: 'proposal')
|
|
59
|
+
FactoryGirl.create(:opportunity_in_pipeline, name: "Not my opportunity", assigned_to: FactoryGirl.create(:user).id, stage: 'proposal')
|
|
60
|
+
|
|
61
|
+
get :index
|
|
62
|
+
expect(assigns[:my_opportunities]).to eq([opportunity_3, opportunity_2, opportunity_1, opportunity_4])
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it "should get a list of my accounts ordered by name" do
|
|
66
|
+
account_1 = FactoryGirl.create(:account, name: "Anderson", assigned_to: current_user.id)
|
|
67
|
+
account_2 = FactoryGirl.create(:account, name: "Wilson", assigned_to: current_user.id)
|
|
68
|
+
account_3 = FactoryGirl.create(:account, name: "Triple", assigned_to: current_user.id)
|
|
69
|
+
account_4 = FactoryGirl.create(:account, name: "Double", assigned_to: nil, user_id: current_user.id)
|
|
70
|
+
|
|
71
|
+
FactoryGirl.create(:account, name: "Someone else's Account", assigned_to: FactoryGirl.create(:user).id)
|
|
72
|
+
FactoryGirl.create(:account, name: "Not my account", assigned_to: FactoryGirl.create(:user).id)
|
|
73
|
+
|
|
74
|
+
get :index
|
|
75
|
+
expect(assigns[:my_accounts]).to eq([account_1, account_4, account_3, account_2])
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# GET /home/options AJAX
|
|
80
|
+
#----------------------------------------------------------------------------
|
|
81
|
+
describe "responding to GET options" do
|
|
82
|
+
before(:each) do
|
|
83
|
+
require_user
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it "should assign instance variables for user preferences" do
|
|
87
|
+
@asset = FactoryGirl.create(:preference, user: current_user, name: "activity_asset", value: Base64.encode64(Marshal.dump("tasks")))
|
|
88
|
+
@user = FactoryGirl.create(:preference, user: current_user, name: "activity_user", value: Base64.encode64(Marshal.dump("Billy Bones")))
|
|
89
|
+
@duration = FactoryGirl.create(:preference, user: current_user, name: "activity_duration", value: Base64.encode64(Marshal.dump("two days")))
|
|
90
|
+
|
|
91
|
+
xhr :get, :options
|
|
92
|
+
expect(assigns[:asset]).to eq("tasks")
|
|
93
|
+
expect(assigns[:user]).to eq("Billy Bones")
|
|
94
|
+
expect(assigns[:duration]).to eq("two days")
|
|
95
|
+
expect(assigns[:all_users]).to eq(User.order(:first_name, :last_name).to_a)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it "should not assign instance variables when hiding options" do
|
|
99
|
+
xhr :get, :options, cancel: "true"
|
|
100
|
+
expect(assigns[:asset]).to eq(nil)
|
|
101
|
+
expect(assigns[:user]).to eq(nil)
|
|
102
|
+
expect(assigns[:duration]).to eq(nil)
|
|
103
|
+
expect(assigns[:all_users]).to eq(nil)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# GET /home/redraw AJAX
|
|
108
|
+
#----------------------------------------------------------------------------
|
|
109
|
+
describe "responding to GET redraw" do
|
|
110
|
+
before(:each) do
|
|
111
|
+
require_user
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
it "should save user selected options" do
|
|
115
|
+
xhr :get, :redraw, asset: "tasks", user: "Billy Bones", duration: "two days"
|
|
116
|
+
expect(current_user.pref[:activity_asset]).to eq("tasks")
|
|
117
|
+
expect(current_user.pref[:activity_user]).to eq("Billy Bones")
|
|
118
|
+
expect(current_user.pref[:activity_duration]).to eq("two days")
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it "should get a list of activities" do
|
|
122
|
+
@activity = FactoryGirl.create(:version, item: FactoryGirl.create(:account, user: current_user))
|
|
123
|
+
expect(controller).to receive(:get_activities).once.and_return([@activity])
|
|
124
|
+
|
|
125
|
+
get :index
|
|
126
|
+
expect(assigns[:activities]).to eq([@activity])
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# GET /home/toggle AJAX
|
|
131
|
+
#----------------------------------------------------------------------------
|
|
132
|
+
describe "responding to GET toggle" do
|
|
133
|
+
it "should toggle expand/collapse state of form section in the session (delete existing session key)" do
|
|
134
|
+
session[:hello] = "world"
|
|
135
|
+
|
|
136
|
+
xhr :get, :toggle, id: "hello"
|
|
137
|
+
expect(session.keys).not_to include(:hello)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
it "should toggle expand/collapse state of form section in the session (save new session key)" do
|
|
141
|
+
session.delete(:hello)
|
|
142
|
+
|
|
143
|
+
xhr :get, :toggle, id: "hello"
|
|
144
|
+
expect(session[:hello]).to eq(true)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
describe "activity_user" do
|
|
149
|
+
before(:each) do
|
|
150
|
+
@user = double(User, id: 1, is_a?: true)
|
|
151
|
+
@cur_user = double(User)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
it "should find a user by email" do
|
|
155
|
+
allow(@cur_user).to receive(:pref).and_return(activity_user: 'billy@example.com')
|
|
156
|
+
controller.instance_variable_set(:@current_user, @cur_user)
|
|
157
|
+
expect(User).to receive(:where).with(email: 'billy@example.com').and_return([@user])
|
|
158
|
+
expect(controller.send(:activity_user)).to eq(1)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
it "should find a user by first name or last name" do
|
|
162
|
+
allow(@cur_user).to receive(:pref).and_return(activity_user: 'Billy')
|
|
163
|
+
controller.instance_variable_set(:@current_user, @cur_user)
|
|
164
|
+
expect(User).to receive(:where).with(first_name: 'Billy').and_return([@user])
|
|
165
|
+
expect(User).to receive(:where).with(last_name: 'Billy').and_return([@user])
|
|
166
|
+
expect(controller.send(:activity_user)).to eq(1)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
it "should find a user by first name and last name" do
|
|
170
|
+
allow(@cur_user).to receive(:pref).and_return(activity_user: 'Billy Elliot')
|
|
171
|
+
controller.instance_variable_set(:@current_user, @cur_user)
|
|
172
|
+
expect(User).to receive(:where).with(first_name: 'Billy', last_name: "Elliot").and_return([@user])
|
|
173
|
+
expect(User).to receive(:where).with(first_name: 'Elliot', last_name: "Billy").and_return([@user])
|
|
174
|
+
expect(controller.send(:activity_user)).to eq(1)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
it "should return nil when 'all_users' is specified" do
|
|
178
|
+
allow(@cur_user).to receive(:pref).and_return(activity_user: 'all_users')
|
|
179
|
+
controller.instance_variable_set(:@current_user, @cur_user)
|
|
180
|
+
expect(User).not_to receive(:where)
|
|
181
|
+
expect(controller.send(:activity_user)).to eq(nil)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
describe "timeline" do
|
|
186
|
+
before(:each) do
|
|
187
|
+
require_user
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
it "should collapse all comments and emails on a specific contact" do
|
|
191
|
+
comment = double(Comment)
|
|
192
|
+
expect(Comment).to receive(:find).with("1").and_return(comment)
|
|
193
|
+
expect(comment).to receive(:update_attribute).with(:state, 'Collapsed')
|
|
194
|
+
xhr :get, :timeline, type: "comment", id: "1", state: "Collapsed"
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
it "should expand all comments and emails on a specific contact" do
|
|
198
|
+
comment = double(Comment)
|
|
199
|
+
expect(Comment).to receive(:find).with("1").and_return(comment)
|
|
200
|
+
expect(comment).to receive(:update_attribute).with(:state, 'Expanded')
|
|
201
|
+
xhr :get, :timeline, type: "comment", id: "1", state: "Expanded"
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
it "should not do anything when state neither Expanded nor Collapsed" do
|
|
205
|
+
comment = double(Comment)
|
|
206
|
+
expect(Comment).not_to receive(:find).with("1")
|
|
207
|
+
xhr :get, :timeline, type: "comment", id: "1", state: "Explode"
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
it "should collapse all comments and emails on Contact" do
|
|
211
|
+
where_stub = double
|
|
212
|
+
expect(where_stub).to receive(:update_all).with(state: "Collapsed")
|
|
213
|
+
expect(Comment).to receive(:where).and_return(where_stub)
|
|
214
|
+
xhr :get, :timeline, id: "1,2,3,4+", state: "Collapsed"
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
it "should not allow an arbitary state (sanitizes input)" do
|
|
218
|
+
where_stub = double
|
|
219
|
+
expect(where_stub).to receive(:update_all).with(state: "Expanded")
|
|
220
|
+
expect(Comment).to receive(:where).and_return(where_stub)
|
|
221
|
+
xhr :get, :timeline, id: "1,2,3,4+", state: "Expanded"
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
it "should not update an arbitary model (sanitizes input)" do
|
|
225
|
+
where_stub = double
|
|
226
|
+
expect(where_stub).to receive(:update_all).with(state: "Expanded")
|
|
227
|
+
expect(Comment).to receive(:where).and_return(where_stub)
|
|
228
|
+
xhr :get, :timeline, id: "1,2,3,4+", state: "Expanded"
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
|
2
|
+
#
|
|
3
|
+
# Fat Free CRM is freely distributable under the terms of MIT license.
|
|
4
|
+
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
5
|
+
#------------------------------------------------------------------------------
|
|
6
|
+
require 'spec_helper'
|
|
7
|
+
|
|
8
|
+
describe ListsController do
|
|
9
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
|
2
|
+
#
|
|
3
|
+
# Fat Free CRM is freely distributable under the terms of MIT license.
|
|
4
|
+
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
5
|
+
#------------------------------------------------------------------------------
|
|
6
|
+
require 'spec_helper'
|
|
7
|
+
|
|
8
|
+
describe PasswordsController do
|
|
9
|
+
let(:user) { FactoryGirl.build(:user) }
|
|
10
|
+
|
|
11
|
+
describe "update" do
|
|
12
|
+
before(:each) do
|
|
13
|
+
allow(User).to receive(:find_using_perishable_token).and_return(user)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should accept non-blank passwords" do
|
|
17
|
+
password = "password"
|
|
18
|
+
expect(user).to receive(:update_attributes).and_return(true)
|
|
19
|
+
put :update, id: 1, user: { password: password, password_confirmation: password }
|
|
20
|
+
expect(response).to redirect_to(profile_url)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "should not accept blank passwords" do
|
|
24
|
+
password = " "
|
|
25
|
+
expect(user).not_to receive(:update_attributes)
|
|
26
|
+
put :update, id: 1, user: { password: password, password_confirmation: password }
|
|
27
|
+
expect(response).to render_template('edit')
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
|
2
|
+
#
|
|
3
|
+
# Fat Free CRM is freely distributable under the terms of MIT license.
|
|
4
|
+
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
5
|
+
#------------------------------------------------------------------------------
|
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
7
|
+
|
|
8
|
+
describe TasksController do
|
|
9
|
+
def update_sidebar
|
|
10
|
+
@task_total = { key: :value, pairs: :etc }
|
|
11
|
+
allow(Task).to receive(:totals).and_return(@task_total)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def produce_tasks(user, view)
|
|
15
|
+
settings = (view != "completed" ? Setting.task_bucket : Setting.task_completed)
|
|
16
|
+
|
|
17
|
+
settings.inject({}) do | hash, due |
|
|
18
|
+
hash[due] ||= []
|
|
19
|
+
if Date.tomorrow == Date.today.end_of_week && due == :due_tomorrow
|
|
20
|
+
due = :due_this_week
|
|
21
|
+
hash[due] ||= []
|
|
22
|
+
end
|
|
23
|
+
hash[due] << case view
|
|
24
|
+
when "pending"
|
|
25
|
+
FactoryGirl.create(:task, user: user, bucket: due.to_s)
|
|
26
|
+
when "assigned"
|
|
27
|
+
FactoryGirl.create(:task, user: user, bucket: due.to_s, assigned_to: 1)
|
|
28
|
+
when "completed"
|
|
29
|
+
completed_at = case due
|
|
30
|
+
when :completed_today
|
|
31
|
+
Date.yesterday + 1.day
|
|
32
|
+
when :completed_yesterday
|
|
33
|
+
Date.yesterday
|
|
34
|
+
when :completed_last_week
|
|
35
|
+
Date.today.beginning_of_week - 7.days
|
|
36
|
+
when :completed_this_month
|
|
37
|
+
Date.today.beginning_of_month
|
|
38
|
+
when :completed_last_month
|
|
39
|
+
Date.today.beginning_of_month - 1.day
|
|
40
|
+
end
|
|
41
|
+
FactoryGirl.create(:task, user: user, bucket: due.to_s, completed_at: completed_at)
|
|
42
|
+
end
|
|
43
|
+
hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
before(:each) do
|
|
48
|
+
require_user
|
|
49
|
+
set_current_tab(:tasks)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# GET /tasks
|
|
53
|
+
# GET /tasks.xml
|
|
54
|
+
#----------------------------------------------------------------------------
|
|
55
|
+
describe "responding to GET index" do
|
|
56
|
+
before do
|
|
57
|
+
update_sidebar
|
|
58
|
+
@timezone, Time.zone = Time.zone, 'UTC'
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
after do
|
|
62
|
+
Time.zone = @timezone
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
TASK_STATUSES.each do |view|
|
|
66
|
+
it "should expose all tasks as @tasks and render [index] template for #{view} view" do
|
|
67
|
+
@tasks = produce_tasks(current_user, view)
|
|
68
|
+
|
|
69
|
+
get :index, view: view
|
|
70
|
+
|
|
71
|
+
expect(assigns[:tasks].keys.map(&:to_sym) - @tasks.keys).to eq([])
|
|
72
|
+
expect(assigns[:tasks].values.flatten - @tasks.values.flatten).to eq([])
|
|
73
|
+
expect(assigns[:task_total].symbolize_keys).to eq(@task_total)
|
|
74
|
+
expect(response).to render_template("tasks/index")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
it "should render all tasks as JSON for #{view} view" do
|
|
78
|
+
@tasks = produce_tasks(current_user, view)
|
|
79
|
+
get :index, view: view, format: :json
|
|
80
|
+
|
|
81
|
+
expect(assigns[:tasks].keys.map(&:to_sym) - @tasks.keys).to eq([])
|
|
82
|
+
expect(assigns[:tasks].values.flatten - @tasks.values.flatten).to eq([])
|
|
83
|
+
hash = ActiveSupport::JSON.decode(response.body)
|
|
84
|
+
|
|
85
|
+
hash.keys.each do |key|
|
|
86
|
+
hash[key].each do |attr|
|
|
87
|
+
task = Task.new(attr["task"])
|
|
88
|
+
expect(task).to be_instance_of(Task)
|
|
89
|
+
expect(task.valid?).to eq(true)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "should render all tasks as xml for #{view} view" do
|
|
95
|
+
@tasks = produce_tasks(current_user, view)
|
|
96
|
+
get :index, view: view, format: :xml
|
|
97
|
+
|
|
98
|
+
expect(assigns[:tasks].keys.map(&:to_sym) - @tasks.keys).to eq([])
|
|
99
|
+
expect(assigns[:tasks].values.flatten - @tasks.values.flatten).to eq([])
|
|
100
|
+
hash = Hash.from_xml(response.body)
|
|
101
|
+
hash["hash"].keys.each do |key|
|
|
102
|
+
hash["hash"][key].each do |attr|
|
|
103
|
+
task = Task.new(attr)
|
|
104
|
+
expect(task).to be_instance_of(Task)
|
|
105
|
+
expect(task.valid?).to eq(true)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# GET /tasks/1
|
|
113
|
+
# GET /tasks/1.xml
|
|
114
|
+
#----------------------------------------------------------------------------
|
|
115
|
+
describe "responding to GET show" do
|
|
116
|
+
TASK_STATUSES.each do |view|
|
|
117
|
+
it "should render the requested task as JSON for #{view} view" do
|
|
118
|
+
allow(Task).to receive_message_chain(:tracked_by, :find).and_return(task = double("Task"))
|
|
119
|
+
expect(task).to receive(:to_json).and_return("generated JSON")
|
|
120
|
+
|
|
121
|
+
request.env["HTTP_ACCEPT"] = "application/json"
|
|
122
|
+
get :show, id: 42, view: "pending"
|
|
123
|
+
expect(response.body).to eq("generated JSON")
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
it "should render the requested task as xml for #{view} view" do
|
|
127
|
+
allow(Task).to receive_message_chain(:tracked_by, :find).and_return(task = double("Task"))
|
|
128
|
+
expect(task).to receive(:to_xml).and_return("generated XML")
|
|
129
|
+
|
|
130
|
+
request.env["HTTP_ACCEPT"] = "application/xml"
|
|
131
|
+
get :show, id: 42, view: "pending"
|
|
132
|
+
expect(response.body).to eq("generated XML")
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# GET /tasks/new
|
|
138
|
+
# GET /tasks/new.xml AJAX
|
|
139
|
+
#----------------------------------------------------------------------------
|
|
140
|
+
describe "responding to GET new" do
|
|
141
|
+
it "should expose a new task as @task and render [new] template" do
|
|
142
|
+
account = FactoryGirl.create(:account, user: current_user)
|
|
143
|
+
@task = FactoryGirl.build(:task, user: current_user, asset: account)
|
|
144
|
+
allow(Task).to receive(:new).and_return(@task)
|
|
145
|
+
@bucket = Setting.unroll(:task_bucket)[1..-1] << ["On Specific Date...", :specific_time]
|
|
146
|
+
@category = Setting.unroll(:task_category)
|
|
147
|
+
|
|
148
|
+
xhr :get, :new
|
|
149
|
+
expect(assigns[:task]).to eq(@task)
|
|
150
|
+
expect(assigns[:bucket]).to eq(@bucket)
|
|
151
|
+
expect(assigns[:category]).to eq(@category)
|
|
152
|
+
expect(response).to render_template("tasks/new")
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
it "should find related asset when necessary" do
|
|
156
|
+
@asset = FactoryGirl.create(:account, id: 42)
|
|
157
|
+
|
|
158
|
+
xhr :get, :new, related: "account_42"
|
|
159
|
+
expect(assigns[:asset]).to eq(@asset)
|
|
160
|
+
expect(response).to render_template("tasks/new")
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
describe "(when creating related task)" do
|
|
164
|
+
it "should redirect to parent asset's index page with the message if parent asset got deleted" do
|
|
165
|
+
@account = FactoryGirl.create(:account)
|
|
166
|
+
@account.destroy
|
|
167
|
+
|
|
168
|
+
xhr :get, :new, related: "account_#{@account.id}"
|
|
169
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
170
|
+
expect(response.body).to eq('window.location.href = "/accounts";')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
it "should redirect to parent asset's index page with the message if parent asset got protected" do
|
|
174
|
+
@account = FactoryGirl.create(:account, access: "Private")
|
|
175
|
+
|
|
176
|
+
xhr :get, :new, related: "account_#{@account.id}"
|
|
177
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
178
|
+
expect(response.body).to eq('window.location.href = "/accounts";')
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# GET /tasks/1/edit AJAX
|
|
184
|
+
#----------------------------------------------------------------------------
|
|
185
|
+
describe "responding to GET edit" do
|
|
186
|
+
it "should expose the requested task as @task and render [edit] template" do
|
|
187
|
+
@asset = FactoryGirl.create(:account, user: current_user)
|
|
188
|
+
@task = FactoryGirl.create(:task, user: current_user, asset: @asset)
|
|
189
|
+
@bucket = Setting.unroll(:task_bucket)[1..-1] << ["On Specific Date...", :specific_time]
|
|
190
|
+
@category = Setting.unroll(:task_category)
|
|
191
|
+
|
|
192
|
+
xhr :get, :edit, id: @task.id
|
|
193
|
+
expect(assigns[:task]).to eq(@task)
|
|
194
|
+
expect(assigns[:bucket]).to eq(@bucket)
|
|
195
|
+
expect(assigns[:category]).to eq(@category)
|
|
196
|
+
expect(assigns[:asset]).to eq(@asset)
|
|
197
|
+
expect(response).to render_template("tasks/edit")
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
it "should find previously open task when necessary" do
|
|
201
|
+
@task = FactoryGirl.create(:task, user: current_user)
|
|
202
|
+
@previous = FactoryGirl.create(:task, id: 999, user: current_user)
|
|
203
|
+
|
|
204
|
+
xhr :get, :edit, id: @task.id, previous: 999
|
|
205
|
+
expect(assigns[:task]).to eq(@task)
|
|
206
|
+
expect(assigns[:previous]).to eq(@previous)
|
|
207
|
+
expect(response).to render_template("tasks/edit")
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
describe "(task got deleted or reassigned)" do
|
|
211
|
+
it "should reload current page with the flash message if the task got deleted" do
|
|
212
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user)
|
|
213
|
+
@task.destroy
|
|
214
|
+
|
|
215
|
+
xhr :get, :edit, id: @task.id
|
|
216
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
217
|
+
expect(response.body).to eq("window.location.reload();")
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
it "should reload current page with the flash message if the task got reassigned" do
|
|
221
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: FactoryGirl.create(:user))
|
|
222
|
+
|
|
223
|
+
xhr :get, :edit, id: @task.id
|
|
224
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
225
|
+
expect(response.body).to eq("window.location.reload();")
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
describe "(previous task got deleted or reassigned)" do
|
|
230
|
+
before(:each) do
|
|
231
|
+
@task = FactoryGirl.create(:task, user: current_user)
|
|
232
|
+
@previous = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
it "should notify the view if previous task got deleted" do
|
|
236
|
+
@previous.destroy
|
|
237
|
+
|
|
238
|
+
xhr :get, :edit, id: @task.id, previous: @previous.id
|
|
239
|
+
expect(flash[:warning]).to eq(nil) # no warning, just silently remove the div
|
|
240
|
+
expect(assigns[:previous]).to eq(@previous.id)
|
|
241
|
+
expect(response).to render_template("tasks/edit")
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
it "should notify the view if previous task got reassigned" do
|
|
245
|
+
@previous.update_attribute(:assignee, FactoryGirl.create(:user))
|
|
246
|
+
|
|
247
|
+
xhr :get, :edit, id: @task.id, previous: @previous.id
|
|
248
|
+
expect(flash[:warning]).to eq(nil)
|
|
249
|
+
expect(assigns[:previous]).to eq(@previous.id)
|
|
250
|
+
expect(response).to render_template("tasks/edit")
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# POST /tasks
|
|
256
|
+
# POST /tasks.xml AJAX
|
|
257
|
+
#----------------------------------------------------------------------------
|
|
258
|
+
describe "responding to POST create" do
|
|
259
|
+
describe "with valid params" do
|
|
260
|
+
it "should expose a newly created task as @task and render [create] template" do
|
|
261
|
+
@task = FactoryGirl.build(:task, user: current_user)
|
|
262
|
+
allow(Task).to receive(:new).and_return(@task)
|
|
263
|
+
|
|
264
|
+
xhr :post, :create, task: { name: "Hello world" }
|
|
265
|
+
expect(assigns(:task)).to eq(@task)
|
|
266
|
+
expect(assigns(:view)).to eq("pending")
|
|
267
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
268
|
+
expect(response).to render_template("tasks/create")
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
["", "?view=pending", "?view=assigned", "?view=completed"].each do |view|
|
|
272
|
+
it "should update tasks sidebar when [create] is being called from [/tasks#{view}] page" do
|
|
273
|
+
@task = FactoryGirl.build(:task, user: current_user)
|
|
274
|
+
allow(Task).to receive(:new).and_return(@task)
|
|
275
|
+
|
|
276
|
+
request.env["HTTP_REFERER"] = "http://localhost/tasks#{view}"
|
|
277
|
+
xhr :post, :create, task: { name: "Hello world" }
|
|
278
|
+
expect(assigns[:task_total]).to be_an_instance_of(HashWithIndifferentAccess)
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
describe "with invalid params" do
|
|
284
|
+
it "should expose a newly created but unsaved task as @lead and still render [create] template" do
|
|
285
|
+
@task = FactoryGirl.build(:task, name: nil, user: current_user)
|
|
286
|
+
allow(Task).to receive(:new).and_return(@task)
|
|
287
|
+
|
|
288
|
+
xhr :post, :create, task: {}
|
|
289
|
+
expect(assigns(:task)).to eq(@task)
|
|
290
|
+
expect(assigns(:view)).to eq("pending")
|
|
291
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
292
|
+
expect(response).to render_template("tasks/create")
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# PUT /tasks/1
|
|
298
|
+
# PUT /tasks/1.xml AJAX
|
|
299
|
+
#----------------------------------------------------------------------------
|
|
300
|
+
describe "responding to PUT update" do
|
|
301
|
+
describe "with valid params" do
|
|
302
|
+
it "should update the requested task, expose it as @task, and render [update] template" do
|
|
303
|
+
@task = FactoryGirl.create(:task, name: "Hi", user: current_user)
|
|
304
|
+
|
|
305
|
+
xhr :put, :update, id: @task.id, task: { name: "Hello" }
|
|
306
|
+
expect(@task.reload.name).to eq("Hello")
|
|
307
|
+
expect(assigns(:task)).to eq(@task)
|
|
308
|
+
expect(assigns(:view)).to eq("pending")
|
|
309
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
310
|
+
expect(response).to render_template("tasks/update")
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
["", "?view=pending", "?view=assigned", "?view=completed"].each do |view|
|
|
314
|
+
it "should update tasks sidebar when [update] is being called from [/tasks#{view}] page" do
|
|
315
|
+
@task = FactoryGirl.create(:task, name: "Hi", user: current_user)
|
|
316
|
+
|
|
317
|
+
request.env["HTTP_REFERER"] = "http://localhost/tasks#{view}"
|
|
318
|
+
xhr :put, :update, id: @task.id, task: { name: "Hello" }
|
|
319
|
+
expect(assigns[:task_total]).to be_an_instance_of(HashWithIndifferentAccess)
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
describe "with invalid params" do
|
|
325
|
+
it "should not update the task, but still expose it as @task and render [update] template" do
|
|
326
|
+
@task = FactoryGirl.create(:task, name: "Hi", user: current_user)
|
|
327
|
+
|
|
328
|
+
xhr :put, :update, id: @task.id, task: { name: nil }
|
|
329
|
+
expect(@task.reload.name).to eq("Hi")
|
|
330
|
+
expect(assigns(:task)).to eq(@task)
|
|
331
|
+
expect(assigns(:view)).to eq("pending")
|
|
332
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
333
|
+
expect(response).to render_template("tasks/update")
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
describe "task got deleted or reassigned" do
|
|
338
|
+
it "should reload current page with the flash message if the task got deleted" do
|
|
339
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user)
|
|
340
|
+
@task.destroy
|
|
341
|
+
|
|
342
|
+
xhr :put, :update, id: @task.id, task: { name: "Hello" }
|
|
343
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
344
|
+
expect(response.body).to eq("window.location.reload();")
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
it "should reload current page with the flash message if the task got reassigned" do
|
|
348
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: FactoryGirl.create(:user))
|
|
349
|
+
|
|
350
|
+
xhr :put, :update, id: @task.id, task: { name: "Hello" }
|
|
351
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
352
|
+
expect(response.body).to eq("window.location.reload();")
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# DELETE /tasks/1
|
|
358
|
+
# DELETE /tasks/1.xml AJAX
|
|
359
|
+
#----------------------------------------------------------------------------
|
|
360
|
+
describe "responding to DELETE destroy" do
|
|
361
|
+
it "should destroy the requested task and render [destroy] template" do
|
|
362
|
+
@task = FactoryGirl.create(:task, user: current_user)
|
|
363
|
+
|
|
364
|
+
xhr :delete, :destroy, id: @task.id, bucket: "due_asap"
|
|
365
|
+
expect(assigns(:task)).to eq(@task)
|
|
366
|
+
expect(assigns(:view)).to eq("pending")
|
|
367
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
368
|
+
expect(response).to render_template("tasks/destroy")
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
["", "?view=pending", "?view=assigned", "?view=completed"].each do |view|
|
|
372
|
+
it "should update sidebar when [destroy] is being called from [/tasks#{view}]" do
|
|
373
|
+
@task = FactoryGirl.create(:task, user: current_user)
|
|
374
|
+
|
|
375
|
+
request.env["HTTP_REFERER"] = "http://localhost/tasks#{view}"
|
|
376
|
+
xhr :delete, :destroy, id: @task.id, bucket: "due_asap"
|
|
377
|
+
expect(assigns[:task_total]).to be_an_instance_of(HashWithIndifferentAccess)
|
|
378
|
+
end
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
it "should not update sidebar when [destroy] is being called from asset page" do
|
|
382
|
+
@task = FactoryGirl.create(:task, user: current_user)
|
|
383
|
+
|
|
384
|
+
xhr :delete, :destroy, id: @task.id
|
|
385
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
describe "task got deleted or reassigned" do
|
|
389
|
+
it "should reload current page with the flash message if the task got deleted" do
|
|
390
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user)
|
|
391
|
+
@task.destroy
|
|
392
|
+
|
|
393
|
+
xhr :delete, :destroy, id: @task.id
|
|
394
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
395
|
+
expect(response.body).to eq("window.location.reload();")
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
it "should reload current page with the flash message if the task got reassigned" do
|
|
399
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: FactoryGirl.create(:user))
|
|
400
|
+
|
|
401
|
+
xhr :delete, :destroy, id: @task.id
|
|
402
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
403
|
+
expect(response.body).to eq("window.location.reload();")
|
|
404
|
+
end
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# PUT /tasks/1/complete
|
|
409
|
+
# PUT /leads/1/complete.xml AJAX
|
|
410
|
+
#----------------------------------------------------------------------------
|
|
411
|
+
describe "responding to PUT complete" do
|
|
412
|
+
it "should change task status, expose task as @task, and render [complete] template" do
|
|
413
|
+
@task = FactoryGirl.create(:task, completed_at: nil, user: current_user)
|
|
414
|
+
|
|
415
|
+
xhr :put, :complete, id: @task.id
|
|
416
|
+
expect(@task.reload.completed_at).not_to eq(nil)
|
|
417
|
+
expect(assigns[:task]).to eq(@task)
|
|
418
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
419
|
+
expect(response).to render_template("tasks/complete")
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
it "should change task status, expose task as @task, and render [complete] template where task.bucket = 'specific_time'" do
|
|
423
|
+
@task = FactoryGirl.create(:task, completed_at: nil, user: current_user, bucket: "specific_time", calendar: "01/01/2010 1:00 AM")
|
|
424
|
+
|
|
425
|
+
xhr :put, :complete, id: @task.id
|
|
426
|
+
expect(@task.reload.completed_at).not_to eq(nil)
|
|
427
|
+
expect(assigns[:task]).to eq(@task)
|
|
428
|
+
expect(assigns[:task_total]).to eq(nil)
|
|
429
|
+
expect(response).to render_template("tasks/complete")
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
it "should change update tasks sidebar if bucket is not empty" do
|
|
433
|
+
@task = FactoryGirl.create(:task, completed_at: nil, user: current_user)
|
|
434
|
+
|
|
435
|
+
xhr :put, :complete, id: @task.id, bucket: "due_asap"
|
|
436
|
+
expect(assigns[:task_total]).to be_an_instance_of(HashWithIndifferentAccess)
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
describe "task got deleted or reassigned" do
|
|
440
|
+
it "should reload current page with the flash message if the task got deleted" do
|
|
441
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user)
|
|
442
|
+
@task.destroy
|
|
443
|
+
|
|
444
|
+
xhr :put, :complete, id: @task.id
|
|
445
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
446
|
+
expect(response.body).to eq("window.location.reload();")
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
it "should reload current page with the flash message if the task got reassigned" do
|
|
450
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: FactoryGirl.create(:user))
|
|
451
|
+
|
|
452
|
+
xhr :put, :complete, id: @task.id
|
|
453
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
454
|
+
expect(response.body).to eq("window.location.reload();")
|
|
455
|
+
end
|
|
456
|
+
end
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
# PUT /tasks/1/complete
|
|
460
|
+
# PUT /leads/1/complete.xml AJAX
|
|
461
|
+
#----------------------------------------------------------------------------
|
|
462
|
+
describe "responding to PUT uncomplete" do
|
|
463
|
+
it "should change task status, expose task as @task, and render template" do
|
|
464
|
+
@task = FactoryGirl.create(:task, completed_at: Time.now, user: current_user)
|
|
465
|
+
|
|
466
|
+
xhr :put, :uncomplete, id: @task.id
|
|
467
|
+
expect(@task.reload.completed_at).to eq(nil)
|
|
468
|
+
expect(assigns[:task]).to eq(@task)
|
|
469
|
+
expect(assigns[:task_total]).not_to eq(nil)
|
|
470
|
+
expect(response).to render_template("tasks/uncomplete")
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
describe "task got deleted" do
|
|
474
|
+
it "should reload current page with the flash message if the task got deleted" do
|
|
475
|
+
@task = FactoryGirl.create(:task, user: FactoryGirl.create(:user), assignee: current_user, completed_at: Time.now)
|
|
476
|
+
@task.destroy
|
|
477
|
+
|
|
478
|
+
xhr :put, :uncomplete, id: @task.id
|
|
479
|
+
expect(flash[:warning]).not_to eq(nil)
|
|
480
|
+
expect(response.body).to eq("window.location.reload();")
|
|
481
|
+
end
|
|
482
|
+
end
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Ajax request to filter out a list of tasks. AJAX
|
|
486
|
+
#----------------------------------------------------------------------------
|
|
487
|
+
describe "responding to GET filter" do
|
|
488
|
+
TASK_STATUSES.each do |view|
|
|
489
|
+
it "should remove a filter from session and render [filter] template for #{view} view" do
|
|
490
|
+
name = "filter_by_task_#{view}"
|
|
491
|
+
session[name] = "due_asap,due_today,due_tomorrow"
|
|
492
|
+
|
|
493
|
+
xhr :get, :filter, filter: "due_asap", view: view
|
|
494
|
+
expect(session[name]).not_to include("due_asap")
|
|
495
|
+
expect(session[name]).to include("due_today")
|
|
496
|
+
expect(session[name]).to include("due_tomorrow")
|
|
497
|
+
expect(response).to render_template("tasks/filter")
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
it "should add a filter from session and render [filter] template for #{view} view" do
|
|
501
|
+
name = "filter_by_task_#{view}"
|
|
502
|
+
session[name] = "due_today,due_tomorrow"
|
|
503
|
+
|
|
504
|
+
xhr :get, :filter, checked: "true", filter: "due_asap", view: view
|
|
505
|
+
expect(session[name]).to include("due_asap")
|
|
506
|
+
expect(session[name]).to include("due_today")
|
|
507
|
+
expect(session[name]).to include("due_tomorrow")
|
|
508
|
+
expect(response).to render_template("tasks/filter")
|
|
509
|
+
end
|
|
510
|
+
end
|
|
511
|
+
end
|
|
512
|
+
end
|