fat_free_crm 0.12.3 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +5 -13
- data/.travis.yml +1 -11
- data/Gemfile +7 -19
- data/Gemfile.lock +166 -166
- data/Procfile +1 -1
- data/README.md +20 -20
- data/app/assets/javascripts/admin/fields.js.coffee +3 -3
- data/app/assets/javascripts/application.js.erb +3 -0
- data/app/assets/javascripts/crm.js +1 -0
- data/app/assets/javascripts/crm_comments.js.coffee +66 -0
- data/app/assets/javascripts/lists.js.coffee +45 -2
- data/app/assets/javascripts/search.js.coffee +2 -0
- data/app/assets/javascripts/timeago.js +17 -0
- data/app/assets/stylesheets/advanced_search.css.scss +49 -25
- data/app/assets/stylesheets/application.css.erb +3 -0
- data/app/assets/stylesheets/common.scss +13 -0
- data/app/assets/stylesheets/format_buttons.css.scss +15 -10
- data/app/assets/stylesheets/header.scss +3 -0
- data/app/assets/stylesheets/lists.css.scss +4 -0
- data/app/controllers/admin/fields_controller.rb +5 -5
- data/app/controllers/admin/users_controller.rb +1 -3
- data/app/controllers/application_controller.rb +23 -23
- data/app/controllers/comments_controller.rb +3 -31
- data/app/controllers/entities/accounts_controller.rb +3 -3
- data/app/controllers/entities/campaigns_controller.rb +4 -4
- data/app/controllers/entities/contacts_controller.rb +2 -2
- data/app/controllers/entities/leads_controller.rb +3 -3
- data/app/controllers/entities/opportunities_controller.rb +4 -3
- data/app/controllers/entities_controller.rb +6 -6
- data/app/controllers/home_controller.rb +1 -1
- data/app/controllers/lists_controller.rb +8 -1
- data/app/controllers/tasks_controller.rb +1 -1
- data/app/controllers/users_controller.rb +46 -23
- data/app/helpers/admin/application_helper.rb +1 -3
- data/app/helpers/admin/field_groups_helper.rb +2 -1
- data/app/helpers/application_helper.rb +37 -16
- data/app/helpers/home_helper.rb +1 -2
- data/app/helpers/leads_helper.rb +5 -6
- data/app/helpers/tasks_helper.rb +36 -50
- data/app/models/entities/account.rb +10 -7
- data/app/models/entities/campaign.rb +4 -4
- data/app/models/entities/contact.rb +8 -5
- data/app/models/entities/lead.rb +8 -8
- data/app/models/entities/opportunity.rb +13 -18
- data/app/models/fields/custom_field.rb +10 -0
- data/app/models/fields/field.rb +3 -3
- data/app/models/fields/field_group.rb +1 -1
- data/app/models/list.rb +1 -0
- data/app/models/polymorphic/address.rb +3 -3
- data/app/models/polymorphic/comment.rb +2 -4
- data/app/models/polymorphic/task.rb +32 -27
- data/app/models/setting.rb +3 -9
- data/app/models/users/ability.rb +2 -13
- data/app/models/users/user.rb +12 -15
- data/app/views/accounts/_edit.html.haml +1 -1
- data/app/views/accounts/_index_brief.html.haml +3 -3
- data/app/views/accounts/_index_long.html.haml +3 -3
- data/app/views/accounts/_new.html.haml +1 -1
- 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 +32 -0
- data/app/views/accounts/index.js.haml +11 -0
- data/app/views/accounts/index.xls.builder +9 -7
- data/app/views/accounts/new.js.haml +11 -0
- data/app/views/accounts/show.js.haml +5 -0
- data/app/views/accounts/update.js.haml +17 -0
- data/app/views/admin/field_groups/_edit.html.haml +1 -1
- data/app/views/admin/field_groups/_new.html.haml +1 -1
- data/app/views/admin/field_groups/confirm.js.haml +7 -0
- data/app/views/admin/field_groups/create.js.haml +20 -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 +2 -2
- data/app/views/admin/fields/_form.html.haml +2 -2
- 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/update.js.haml +13 -0
- data/app/views/admin/groups/_edit.html.haml +1 -1
- data/app/views/admin/groups/_new.html.haml +1 -1
- 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 +1 -1
- 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/update.js.haml +9 -0
- data/app/views/admin/tags/_edit.html.haml +1 -1
- data/app/views/admin/tags/_new.html.haml +1 -1
- 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/new.js.haml +7 -0
- data/app/views/admin/tags/update.js.haml +9 -0
- data/app/views/admin/users/_edit.html.haml +1 -1
- data/app/views/admin/users/_new.html.haml +1 -1
- data/app/views/admin/users/_user.html.haml +1 -1
- 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.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/suspend.js.haml +3 -0
- data/app/views/admin/users/update.js.haml +9 -0
- data/app/views/authentications/new.html.haml +1 -1
- data/app/views/campaigns/_edit.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -1
- 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 +33 -0
- data/app/views/campaigns/index.js.haml +11 -0
- data/app/views/campaigns/index.xls.builder +9 -7
- data/app/views/campaigns/new.js.haml +11 -0
- data/app/views/campaigns/show.js.haml +5 -0
- data/app/views/campaigns/update.js.haml +20 -0
- data/app/views/comments/_comment.html.haml +1 -1
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +3 -2
- 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/_edit.html.haml +1 -1
- data/app/views/contacts/_index_full.html.haml +1 -1
- data/app/views/contacts/_index_long.html.haml +2 -1
- data/app/views/contacts/_new.html.haml +1 -1
- data/app/views/contacts/_section_general.html.haml +3 -3
- 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 +35 -0
- data/app/views/contacts/index.js.haml +11 -0
- data/app/views/contacts/index.xls.builder +9 -7
- data/app/views/contacts/new.js.haml +13 -0
- data/app/views/contacts/show.js.haml +5 -0
- data/app/views/contacts/update.js.haml +22 -0
- data/app/views/emails/destroy.js.haml +5 -0
- data/app/views/entities/_permissions.html.haml +1 -1
- 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/group.js.erb +3 -0
- data/app/views/home/_account.html.haml +3 -3
- data/app/views/home/_opportunity.html.haml +3 -3
- data/app/views/home/index.atom.builder +3 -3
- data/app/views/home/index.js.haml +7 -0
- data/app/views/home/index.rss.builder +2 -2
- data/app/views/home/options.js.haml +7 -0
- data/app/views/layouts/_footer.html.haml +0 -4
- data/app/views/layouts/_sidebar.html.haml +1 -0
- data/app/views/layouts/_tabbed.html.haml +1 -4
- data/app/views/layouts/admin/application.html.haml +0 -1
- data/app/views/layouts/application.html.haml +5 -7
- data/app/views/leads/_convert.html.haml +1 -1
- data/app/views/leads/_edit.html.haml +1 -1
- data/app/views/leads/_index_long.html.haml +2 -2
- data/app/views/leads/_new.html.haml +1 -1
- 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 +35 -0
- data/app/views/leads/index.js.haml +11 -0
- data/app/views/leads/index.xls.builder +9 -7
- 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.js.haml +5 -0
- data/app/views/leads/update.js.haml +26 -0
- data/app/views/lists/_personal_sidebar.html.haml +28 -0
- data/app/views/lists/_sidebar.html.haml +10 -7
- data/app/views/lists/create.js.haml +10 -0
- data/app/views/lists/destroy.js.haml +1 -0
- data/app/views/opportunities/_edit.html.haml +1 -1
- data/app/views/opportunities/_index_brief.html.haml +3 -3
- data/app/views/opportunities/_index_long.html.haml +3 -3
- data/app/views/opportunities/_new.html.haml +1 -2
- data/app/views/opportunities/_top_section.html.haml +4 -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 +35 -0
- data/app/views/opportunities/index.js.haml +11 -0
- data/app/views/opportunities/index.xls.builder +9 -7
- data/app/views/opportunities/new.js.haml +13 -0
- data/app/views/opportunities/show.js.haml +5 -0
- data/app/views/opportunities/update.js.haml +25 -0
- data/app/views/passwords/edit.html.haml +1 -1
- data/app/views/passwords/new.html.haml +1 -1
- data/app/views/shared/_comment.html.haml +1 -1
- data/app/views/shared/_inline_styles.html.haml +1 -1
- data/app/views/tasks/_edit.html.haml +1 -1
- data/app/views/tasks/_new.html.haml +1 -1
- 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.xls.builder +7 -5
- data/app/views/tasks/new.js.haml +8 -0
- data/app/views/tasks/update.js.haml +19 -0
- data/app/views/users/_password.html.haml +1 -1
- data/app/views/users/_profile.html.haml +1 -1
- 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/new.html.haml +1 -1
- data/app/views/users/password.js.haml +10 -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 +1 -1
- data/config/application.rb +1 -4
- data/config/environments/production.rb +3 -2
- data/config/initializers/custom_field_ransack_translations.rb +15 -0
- data/config/initializers/locale.rb +9 -1
- data/config/initializers/secret_token.rb +1 -25
- data/config/initializers/views.rb +20 -20
- data/config/locales/cz.yml +245 -211
- data/config/locales/cz_fat_free_crm.yml +105 -181
- data/config/locales/de.yml +162 -118
- data/config/locales/de_fat_free_crm.yml +760 -731
- data/config/locales/de_ransack.yml +91 -0
- data/config/locales/en-GB.yml +158 -119
- data/config/locales/en-GB_fat_free_crm.yml +161 -279
- data/config/locales/en-US.yml +158 -121
- data/config/locales/en-US_fat_free_crm.yml +185 -179
- data/config/locales/en-US_ransack.yml +81 -82
- data/config/locales/es.yml +164 -123
- data/config/locales/es_fat_free_crm.yml +151 -209
- data/config/locales/fr-CA.yml +167 -130
- data/config/locales/fr-CA_fat_free_crm.yml +142 -202
- data/config/locales/fr.yml +170 -125
- data/config/locales/fr_fat_free_crm.yml +199 -302
- data/config/locales/it.yml +158 -122
- data/config/locales/it_fat_free_crm.yml +105 -168
- data/config/locales/ja.yml +162 -131
- data/config/locales/ja_fat_free_crm.yml +118 -188
- data/config/locales/pl.yml +168 -132
- data/config/locales/pl_fat_free_crm.yml +115 -186
- data/config/locales/pt-BR.yml +160 -127
- data/config/locales/pt-BR_fat_free_crm.yml +125 -182
- data/config/locales/ru.yml +256 -233
- data/config/locales/ru_fat_free_crm.yml +136 -193
- data/config/locales/sv-SE.yml +164 -181
- data/config/locales/sv-SE_fat_free_crm.yml +129 -193
- data/config/locales/th_fat_free_crm.yml +114 -194
- data/config/locales/zh-CN.yml +176 -149
- data/config/locales/zh-CN_fat_free_crm.yml +78 -167
- data/config/routes.rb +1 -1
- data/config/settings.default.yml +74 -23
- data/custom_plan.rb +11 -0
- data/db/migrate/20131207033244_add_user_id_to_lists.rb +6 -0
- data/db/schema.rb +4 -1
- data/fat_free_crm.gemspec +3 -3
- data/lib/fat_free_crm.rb +1 -11
- data/lib/fat_free_crm/export_csv.rb +3 -3
- data/lib/fat_free_crm/fields.rb +10 -0
- data/lib/fat_free_crm/gem_dependencies.rb +1 -2
- data/lib/fat_free_crm/i18n.rb +9 -5
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/fat_free_crm/view_factory.rb +8 -5
- data/lib/tasks/ffcrm/config.rake +9 -12
- data/lib/tasks/ffcrm/missing_translations.rake +2 -1
- data/spec/controllers/admin/users_controller_spec.rb +6 -4
- data/spec/controllers/applications_controller_spec.rb +4 -4
- data/spec/controllers/authentications_controller_spec.rb +15 -15
- data/spec/controllers/comments_controller_spec.rb +9 -87
- data/spec/controllers/emails_controller_spec.rb +1 -1
- data/spec/controllers/entities/accounts_controller_spec.rb +7 -7
- data/spec/controllers/entities/campaigns_controller_spec.rb +5 -5
- data/spec/controllers/entities/contacts_controller_spec.rb +7 -7
- data/spec/controllers/entities/leads_controller_spec.rb +14 -14
- data/spec/controllers/entities/opportunities_controller_spec.rb +8 -8
- data/spec/controllers/home_controller_spec.rb +6 -6
- data/spec/controllers/tasks_controller_spec.rb +7 -7
- data/spec/controllers/users_controller_spec.rb +22 -50
- data/spec/features/support/selector_helpers.rb +1 -6
- data/spec/features/tasks_spec.rb +2 -2
- data/spec/helpers/application_helper_spec.rb +15 -15
- data/spec/lib/fields_spec.rb +29 -29
- data/spec/lib/mail_processor/base_spec.rb +7 -7
- data/spec/lib/mail_processor/dropbox_spec.rb +3 -3
- data/spec/lib/view_factory_spec.rb +14 -14
- data/spec/models/entities/opportunity_spec.rb +1 -1
- data/spec/models/fields/custom_field_date_pair_spec.rb +14 -14
- data/spec/models/fields/custom_field_pair_spec.rb +13 -13
- data/spec/models/fields/custom_field_spec.rb +5 -5
- data/spec/models/fields/field_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +2 -2
- data/spec/models/users/user_spec.rb +7 -7
- data/spec/routing/comments_routing_spec.rb +0 -9
- data/spec/shared/controllers.rb +75 -77
- data/spec/shared/models.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- data/spec/support/auth_macros.rb +3 -3
- data/spec/support/mail_processor_mocks.rb +13 -13
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -14
- data/spec/views/accounts/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -8
- data/spec/views/accounts/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +10 -18
- data/spec/views/accounts/{index.rjs_spec.rb → index.js.haml_spec.rb} +7 -11
- data/spec/views/accounts/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
- data/spec/views/accounts/show.haml_spec.rb +1 -1
- data/spec/views/accounts/{update.rjs_spec.rb → update.js.haml_spec.rb} +16 -25
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +31 -0
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +31 -0
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +24 -0
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +25 -0
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +30 -0
- data/spec/views/admin/users/_create.haml_spec.rb +1 -1
- data/spec/views/admin/users/{create.rjs_spec.rb → create.js.haml_spec.rb} +6 -9
- data/spec/views/admin/users/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -7
- data/spec/views/admin/users/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +6 -12
- data/spec/views/admin/users/index.haml_spec.rb +0 -0
- data/spec/views/admin/users/{index.rjs_spec.rb → index.js.haml_spec.rb} +3 -5
- data/spec/views/admin/users/{new.rjs_spec.rb → new.js.haml_spec.rb} +4 -6
- data/spec/views/admin/users/{reactivate.rjs_spec.rb → reactivate.js.haml_spec.rb} +2 -4
- data/spec/views/admin/users/show.haml_spec.rb +0 -0
- data/spec/views/admin/users/{suspend.rjs_spec.rb → suspend.js.haml_spec.rb} +2 -4
- data/spec/views/admin/users/{update.rjs_spec.rb → update.js.haml_spec.rb} +6 -10
- data/spec/views/campaigns/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -14
- data/spec/views/campaigns/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -7
- data/spec/views/campaigns/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +11 -19
- data/spec/views/campaigns/{index.rjs_spec.rb → index.js.haml_spec.rb} +5 -9
- data/spec/views/campaigns/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
- data/spec/views/campaigns/{update.rjs_spec.rb → update.js.haml_spec.rb} +14 -21
- data/spec/views/comments/{new.rjs_spec.rb → edit.js.haml_spec.rb} +12 -9
- data/spec/views/contacts/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -16
- data/spec/views/contacts/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -8
- data/spec/views/contacts/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +12 -19
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/{index.rjs_spec.rb → index.js.html_spec.rb} +7 -11
- data/spec/views/contacts/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -7
- data/spec/views/contacts/{update.rjs_spec.rb → update.js.haml_spec.rb} +20 -35
- data/spec/views/home/{index.rjs_spec.rb → index.js.haml_spec.rb} +2 -4
- data/spec/views/home/{options.rjs_spec.rb → options.js.haml_spec.rb} +7 -12
- data/spec/views/leads/{convert.rjs_spec.rb → convert.js.haml_spec.rb} +12 -20
- data/spec/views/leads/{create.rjs_spec.rb → create.js.haml_spec.rb} +13 -19
- data/spec/views/leads/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +9 -12
- data/spec/views/leads/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +12 -20
- data/spec/views/leads/{index.rjs_spec.rb → index.js.haml_spec.rb} +5 -9
- data/spec/views/leads/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
- data/spec/views/leads/{promote.rjs_spec.rb → promote.js.haml_spec.rb} +28 -43
- data/spec/views/leads/{reject.rjs_spec.rb → reject.js.haml_spec.rb} +10 -17
- data/spec/views/leads/{update.rjs_spec.rb → update.js.haml_spec.rb} +25 -38
- data/spec/views/opportunities/{create.rjs_spec.rb → create.js.haml_spec.rb} +16 -26
- data/spec/views/opportunities/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +13 -16
- data/spec/views/opportunities/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +10 -18
- data/spec/views/opportunities/{index.rjs_spec.rb → index.js.haml_spec.rb} +7 -12
- data/spec/views/opportunities/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
- data/spec/views/opportunities/{update.rjs_spec.rb → update.js.haml_spec.rb} +29 -46
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/{complete.rjs_spec.rb → complete.js.haml_spec.rb} +9 -14
- data/spec/views/tasks/{create.rjs_spec.rb → create.js.haml_spec.rb} +25 -33
- data/spec/views/tasks/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +9 -11
- data/spec/views/tasks/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +9 -14
- data/spec/views/tasks/index.haml_spec.rb +1 -2
- data/spec/views/tasks/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
- data/spec/views/tasks/{update.rjs_spec.rb → update.js.haml_spec.rb} +28 -41
- data/spec/views/users/{avatar.rjs_spec.rb → avatar.js.haml_spec.rb} +7 -9
- data/spec/views/users/{change_password.rjs_spec.rb → change_password.js.haml_spec.rb} +10 -12
- data/spec/views/users/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +8 -10
- data/spec/views/users/{password.rjs_spec.rb → password.js.haml_spec.rb} +9 -11
- data/spec/views/users/{update.rjs_spec.rb → update.js.haml_spec.rb} +7 -15
- data/spec/views/users/{upload_avatar.rjs_spec.rb → upload_avatar.js.haml_spec.rb} +8 -10
- data/vendor/assets/javascripts/ajax-chosen-jquery.js +2 -0
- data/vendor/assets/javascripts/ajax-chosen-prototype.js +2 -0
- data/vendor/assets/javascripts/ajax-chosen.jquery.coffee +81 -0
- data/vendor/assets/javascripts/ajax-chosen.proto.coffee +98 -0
- data/vendor/assets/javascripts/jquery_timeago/index.js +17 -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.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.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/zeus.json +2 -1
- metadata +240 -245
- data/app/assets/images/delete.png +0 -0
- data/app/assets/images/iconset_attribution.png +0 -0
- data/app/views/accounts/create.js.rjs +0 -14
- data/app/views/accounts/destroy.js.rjs +0 -3
- data/app/views/accounts/edit.js.rjs +0 -33
- data/app/views/accounts/index.js.rjs +0 -8
- data/app/views/accounts/new.js.rjs +0 -9
- data/app/views/accounts/show.js.erb +0 -2
- data/app/views/accounts/update.js.rjs +0 -17
- data/app/views/admin/field_groups/confirm.js.rjs +0 -6
- data/app/views/admin/field_groups/create.js.rjs +0 -20
- data/app/views/admin/field_groups/destroy.js.rjs +0 -11
- data/app/views/admin/field_groups/edit.js.rjs +0 -14
- data/app/views/admin/field_groups/new.js.rjs +0 -9
- data/app/views/admin/field_groups/update.js.rjs +0 -9
- data/app/views/admin/fields/create.js.erb +0 -19
- data/app/views/admin/fields/destroy.js.erb +0 -9
- data/app/views/admin/fields/edit.js.erb +0 -1
- data/app/views/admin/fields/update.js.erb +0 -13
- data/app/views/admin/groups/create.js.rjs +0 -11
- data/app/views/admin/groups/destroy.js.rjs +0 -11
- data/app/views/admin/groups/edit.js.rjs +0 -21
- data/app/views/admin/groups/index.js.rjs +0 -2
- data/app/views/admin/groups/new.js.rjs +0 -9
- data/app/views/admin/groups/update.js.rjs +0 -10
- data/app/views/admin/tags/confirm.js.rjs +0 -6
- data/app/views/admin/tags/create.js.rjs +0 -12
- data/app/views/admin/tags/destroy.js.rjs +0 -11
- data/app/views/admin/tags/edit.js.rjs +0 -21
- data/app/views/admin/tags/new.js.rjs +0 -8
- data/app/views/admin/tags/update.js.rjs +0 -10
- data/app/views/admin/users/confirm.js.rjs +0 -6
- data/app/views/admin/users/create.js.rjs +0 -11
- data/app/views/admin/users/destroy.js.rjs +0 -11
- data/app/views/admin/users/edit.js.rjs +0 -21
- data/app/views/admin/users/index.js.rjs +0 -3
- data/app/views/admin/users/new.js.rjs +0 -8
- data/app/views/admin/users/reactivate.js.rjs +0 -3
- data/app/views/admin/users/suspend.js.rjs +0 -3
- data/app/views/admin/users/update.js.rjs +0 -10
- data/app/views/campaigns/create.js.rjs +0 -18
- data/app/views/campaigns/destroy.js.rjs +0 -3
- data/app/views/campaigns/edit.js.rjs +0 -34
- data/app/views/campaigns/index.js.rjs +0 -8
- data/app/views/campaigns/new.js.rjs +0 -9
- data/app/views/campaigns/show.js.erb +0 -2
- data/app/views/campaigns/update.js.rjs +0 -21
- data/app/views/comments/create.js.rjs +0 -11
- data/app/views/comments/destroy.js.rjs +0 -6
- data/app/views/comments/edit.js.rjs +0 -11
- data/app/views/comments/new.js.rjs +0 -14
- data/app/views/comments/update.js.rjs +0 -11
- data/app/views/contacts/create.js.rjs +0 -19
- data/app/views/contacts/destroy.js.rjs +0 -7
- data/app/views/contacts/edit.js.rjs +0 -36
- data/app/views/contacts/index.js.rjs +0 -8
- data/app/views/contacts/new.js.rjs +0 -11
- data/app/views/contacts/show.js.erb +0 -2
- data/app/views/contacts/update.js.rjs +0 -22
- data/app/views/emails/destroy.js.rjs +0 -6
- data/app/views/entities/attach.js.rjs +0 -24
- data/app/views/entities/contacts.js.rjs +0 -3
- data/app/views/entities/discard.js.rjs +0 -7
- data/app/views/entities/leads.js.rjs +0 -3
- data/app/views/entities/opportunities.js.rjs +0 -3
- data/app/views/entities/subscription_update.js.rjs +0 -4
- data/app/views/entities/versions.js.erb +0 -3
- data/app/views/fields/group.js.rjs +0 -7
- data/app/views/home/index.js.rjs +0 -7
- data/app/views/home/options.js.rjs +0 -8
- data/app/views/leads/convert.js.rjs +0 -37
- data/app/views/leads/create.js.rjs +0 -19
- data/app/views/leads/destroy.js.rjs +0 -7
- data/app/views/leads/edit.js.rjs +0 -36
- data/app/views/leads/index.js.rjs +0 -8
- data/app/views/leads/new.js.rjs +0 -9
- data/app/views/leads/promote.js.rjs +0 -27
- data/app/views/leads/reject.js.rjs +0 -10
- data/app/views/leads/show.js.erb +0 -2
- data/app/views/leads/update.js.rjs +0 -27
- data/app/views/lists/create.js.rjs +0 -9
- data/app/views/lists/destroy.js.rjs +0 -1
- data/app/views/opportunities/contacts.js.rjs +0 -3
- data/app/views/opportunities/create.js.rjs +0 -29
- data/app/views/opportunities/destroy.js.rjs +0 -11
- data/app/views/opportunities/edit.js.rjs +0 -36
- data/app/views/opportunities/index.js.rjs +0 -8
- data/app/views/opportunities/new.js.rjs +0 -12
- data/app/views/opportunities/show.js.erb +0 -2
- data/app/views/opportunities/update.js.rjs +0 -26
- data/app/views/tasks/complete.js.rjs +0 -17
- data/app/views/tasks/create.js.rjs +0 -41
- data/app/views/tasks/destroy.js.rjs +0 -7
- data/app/views/tasks/discard.rjs +0 -1
- data/app/views/tasks/edit.js.rjs +0 -23
- data/app/views/tasks/filter.js.rjs +0 -1
- data/app/views/tasks/new.js.rjs +0 -9
- data/app/views/tasks/update.js.rjs +0 -21
- data/app/views/users/avatar.js.rjs +0 -10
- data/app/views/users/change_password.js.rjs +0 -15
- data/app/views/users/edit.js.rjs +0 -10
- data/app/views/users/password.js.rjs +0 -11
- data/app/views/users/update.js.rjs +0 -10
- data/app/views/users/upload_avatar.js.rjs +0 -8
- data/lib/fat_free_crm/secret_token_generator.rb +0 -65
- data/spec/lib/secret_token_generator_spec.rb +0 -79
- data/spec/models/users/abilities/user_ability_spec.rb +0 -58
- data/spec/support/rjs_support.rb +0 -14
- data/vendor/assets/images/brief.png +0 -0
- data/vendor/assets/images/full.png +0 -0
- data/vendor/assets/images/long.png +0 -0
- data/vendor/assets/images/tab_icons/accounts.png +0 -0
- data/vendor/assets/images/tab_icons/accounts_active.png +0 -0
- data/vendor/assets/images/tab_icons/campaigns.png +0 -0
- data/vendor/assets/images/tab_icons/campaigns_active.png +0 -0
- data/vendor/assets/images/tab_icons/contacts.png +0 -0
- data/vendor/assets/images/tab_icons/contacts_active.png +0 -0
- data/vendor/assets/images/tab_icons/dashboard.png +0 -0
- data/vendor/assets/images/tab_icons/dashboard_active.png +0 -0
- data/vendor/assets/images/tab_icons/leads.png +0 -0
- data/vendor/assets/images/tab_icons/leads_active.png +0 -0
- data/vendor/assets/images/tab_icons/opportunities.png +0 -0
- data/vendor/assets/images/tab_icons/opportunities_active.png +0 -0
- data/vendor/assets/images/tab_icons/tasks.png +0 -0
- data/vendor/assets/images/tab_icons/tasks_active.png +0 -0
@@ -52,7 +52,7 @@ describe Field do
|
|
52
52
|
:label => "Availability",
|
53
53
|
:name => "availability"
|
54
54
|
)
|
55
|
-
object =
|
55
|
+
object = double('Object')
|
56
56
|
|
57
57
|
# as | value | expected
|
58
58
|
[["check_boxes", [1, 2, 3], "1, 2<br />3"],
|
@@ -60,7 +60,7 @@ describe Field do
|
|
60
60
|
["checkbox", 1, "yes"],
|
61
61
|
["date", DateTime.new(2011,4,19), DateTime.new(2011,4,19).strftime(I18n.t("date.formats.mmddyy")) ]].each do |as, value, expected|
|
62
62
|
field.as = as
|
63
|
-
object.stub
|
63
|
+
object.stub(field.name).and_return(value)
|
64
64
|
field.render_value(object).should == expected
|
65
65
|
end
|
66
66
|
end
|
@@ -11,7 +11,7 @@ describe EntityObserver do
|
|
11
11
|
let(:assignee) { FactoryGirl.create(:user) }
|
12
12
|
let(:assigner) { FactoryGirl.create(:user) }
|
13
13
|
let!(:entity) { FactoryGirl.build(entity_type, :user => assigner, :assignee => assignee) }
|
14
|
-
let(:mail) {
|
14
|
+
let(:mail) { double('mail', :deliver => true) }
|
15
15
|
|
16
16
|
before :each do
|
17
17
|
PaperTrail.stub(:whodunnit).and_return(assigner)
|
@@ -40,7 +40,7 @@ describe EntityObserver do
|
|
40
40
|
let(:assignee) { FactoryGirl.create(:user) }
|
41
41
|
let(:assigner) { FactoryGirl.create(:user) }
|
42
42
|
let!(:entity) { FactoryGirl.create(entity_type, :user => FactoryGirl.create(:user)) }
|
43
|
-
let(:mail) {
|
43
|
+
let(:mail) { double('mail', :deliver => true) }
|
44
44
|
|
45
45
|
before :each do
|
46
46
|
PaperTrail.stub(:whodunnit).and_return(assigner)
|
@@ -60,14 +60,14 @@ describe User do
|
|
60
60
|
it "should not destroy the user if she owns #{asset}" do
|
61
61
|
FactoryGirl.create(asset, :user => @user)
|
62
62
|
@user.destroy
|
63
|
-
|
63
|
+
expect { User.find(@user) }.to_not raise_error()
|
64
64
|
@user.destroyed?.should == false
|
65
65
|
end
|
66
66
|
|
67
67
|
it "should not destroy the user if she has #{asset} assigned" do
|
68
68
|
FactoryGirl.create(asset, :assignee => @user)
|
69
69
|
@user.destroy
|
70
|
-
|
70
|
+
expect { User.find(@user) }.to_not raise_error()
|
71
71
|
@user.destroyed?.should == false
|
72
72
|
end
|
73
73
|
end
|
@@ -77,20 +77,20 @@ describe User do
|
|
77
77
|
account = FactoryGirl.create(:account, :user => current_user)
|
78
78
|
FactoryGirl.create(:comment, :user => @user, :commentable => account)
|
79
79
|
@user.destroy
|
80
|
-
|
80
|
+
expect { User.find(@user) }.to_not raise_error()
|
81
81
|
@user.destroyed?.should == false
|
82
82
|
end
|
83
83
|
|
84
84
|
it "should not destroy the current user" do
|
85
85
|
login
|
86
86
|
current_user.destroy
|
87
|
-
|
87
|
+
expect { current_user.reload }.to_not raise_error()
|
88
88
|
current_user.should_not be_destroyed
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should destroy the user" do
|
92
92
|
@user.destroy
|
93
|
-
|
93
|
+
expect { User.find(@user) }.to raise_error(ActiveRecord::RecordNotFound)
|
94
94
|
@user.should be_destroyed
|
95
95
|
end
|
96
96
|
|
@@ -182,9 +182,9 @@ describe User do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
it "should update I18n.locale if proference[:locale] is set" do
|
185
|
-
@user.preference[:locale] = :
|
185
|
+
@user.preference[:locale] = :es
|
186
186
|
@user.set_individual_locale
|
187
|
-
I18n.locale.should == :
|
187
|
+
I18n.locale.should == :es
|
188
188
|
end
|
189
189
|
|
190
190
|
it "should not update I18n.locale if proference[:locale] is not set" do
|
@@ -12,14 +12,6 @@ describe CommentsController do
|
|
12
12
|
{ :get => "/comments" }.should route_to(:controller => "comments", :action => "index")
|
13
13
|
end
|
14
14
|
|
15
|
-
it "recognizes and generates #new" do
|
16
|
-
{ :get => "/comments/new" }.should route_to(:controller => "comments", :action => "new")
|
17
|
-
end
|
18
|
-
|
19
|
-
it "recognizes and generates #show" do
|
20
|
-
{ :get => "/comments/1" }.should route_to(:controller => "comments", :action => "show", :id => "1")
|
21
|
-
end
|
22
|
-
|
23
15
|
it "recognizes and generates #edit" do
|
24
16
|
{ :get => "/comments/1/edit" }.should route_to(:controller => "comments", :action => "edit", :id => "1")
|
25
17
|
end
|
@@ -37,4 +29,3 @@ describe CommentsController do
|
|
37
29
|
end
|
38
30
|
end
|
39
31
|
end
|
40
|
-
|
data/spec/shared/controllers.rb
CHANGED
@@ -3,103 +3,101 @@
|
|
3
3
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
4
4
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
5
|
#------------------------------------------------------------------------------
|
6
|
-
module SharedControllerSpecs
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
shared_examples "auto complete" do
|
8
|
+
before(:each) do
|
9
|
+
@query = "Hello"
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
it "should do the search and find records that match autocomplete query" do
|
13
|
+
post :auto_complete, :auto_complete_query => @query
|
14
|
+
assigns[:query].should == @query
|
15
|
+
assigns[:auto_complete].should == @auto_complete_matches # Each controller must define it.
|
16
|
+
end
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
it "should save current autocomplete controller in a session" do
|
19
|
+
post :auto_complete, :auto_complete_query => @query
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
21
|
+
# We don't save Admin/Users autocomplete controller in a session since Users are not
|
22
|
+
# exposed through the Jumpbox.
|
23
|
+
unless controller.class.to_s.starts_with?("Admin::")
|
24
|
+
session[:auto_complete].should == @controller.controller_name.to_sym
|
27
25
|
end
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
28
|
+
it "should render application/_auto_complete template" do
|
29
|
+
post :auto_complete, :auto_complete_query => @query
|
30
|
+
response.should render_template("application/_auto_complete")
|
33
31
|
end
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
44
|
-
if @model.is_a?(Account) && @attachment.respond_to?(:account) # Skip Tasks...
|
45
|
-
assigns[:account].should == @attachment.reload.account
|
46
|
-
end
|
47
|
-
response.should render_template("entities/attach")
|
34
|
+
shared_examples "attach" do
|
35
|
+
it "should attach existing asset to the parent asset of different type" do
|
36
|
+
xhr :put, :attach, :id => @model.id, :assets => @attachment.class.name.tableize, :asset_id => @attachment.id
|
37
|
+
@model.send(@attachment.class.name.tableize).should include(@attachment)
|
38
|
+
assigns[:attachment].should == @attachment
|
39
|
+
assigns[:attached].should == [ @attachment ]
|
40
|
+
if @model.is_a?(Campaign) && (@attachment.is_a?(Lead) || @attachment.is_a?(Opportunity))
|
41
|
+
assigns[:campaign].should == @attachment.reload.campaign
|
48
42
|
end
|
43
|
+
if @model.is_a?(Account) && @attachment.respond_to?(:account) # Skip Tasks...
|
44
|
+
assigns[:account].should == @attachment.reload.account
|
45
|
+
end
|
46
|
+
response.should render_template("entities/attach")
|
47
|
+
end
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
xhr :put, :attach, :id => @model.id, :assets => @attachment.class.name.tableize, :asset_id => @attachment.id
|
58
|
-
assigns[:attached].should == nil
|
59
|
-
response.should render_template("entities/attach")
|
49
|
+
it "should not attach the asset that is already attached" do
|
50
|
+
if @model.is_a?(Campaign) && (@attachment.is_a?(Lead) || @attachment.is_a?(Opportunity))
|
51
|
+
@attachment.update_attribute(:campaign_id, @model.id)
|
52
|
+
else
|
53
|
+
@model.send(@attachment.class.name.tableize) << @attachment
|
60
54
|
end
|
61
55
|
|
62
|
-
|
63
|
-
|
56
|
+
xhr :put, :attach, :id => @model.id, :assets => @attachment.class.name.tableize, :asset_id => @attachment.id
|
57
|
+
assigns[:attached].should == nil
|
58
|
+
response.should render_template("entities/attach")
|
59
|
+
end
|
64
60
|
|
65
|
-
|
66
|
-
|
67
|
-
response.body.should == "window.location.reload();"
|
68
|
-
end
|
69
|
-
it "should display flash warning when the attachment is no longer available" do
|
70
|
-
@attachment.destroy
|
61
|
+
it "should display flash warning when the model is no longer available" do
|
62
|
+
@model.destroy
|
71
63
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
end
|
64
|
+
xhr :put, :attach, :id => @model.id, :assets => @attachment.class.name.tableize, :asset_id => @attachment.id
|
65
|
+
flash[:warning].should_not == nil
|
66
|
+
response.body.should == "window.location.reload();"
|
76
67
|
end
|
68
|
+
it "should display flash warning when the attachment is no longer available" do
|
69
|
+
@attachment.destroy
|
77
70
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
assigns[:account].should == @model if @model.is_a?(Account)
|
84
|
-
assigns[:campaign].should == @model if @model.is_a?(Campaign)
|
71
|
+
xhr :put, :attach, :id => @model.id, :assets => @attachment.class.name.tableize, :asset_id => @attachment.id
|
72
|
+
flash[:warning].should_not == nil
|
73
|
+
response.body.should == "window.location.reload();"
|
74
|
+
end
|
75
|
+
end
|
85
76
|
|
86
|
-
|
87
|
-
|
77
|
+
shared_examples "discard" do
|
78
|
+
it "should discard the attachment without deleting it" do
|
79
|
+
xhr :post, :discard, :id => @model.id, :attachment => @attachment.class.name, :attachment_id => @attachment.id
|
80
|
+
assigns[:attachment].should == @attachment.reload # The attachment should still exist.
|
81
|
+
@model.reload.send("#{@attachment.class.name.tableize}").should == [] # But no longer associated with the model.
|
82
|
+
assigns[:account].should == @model if @model.is_a?(Account)
|
83
|
+
assigns[:campaign].should == @model if @model.is_a?(Campaign)
|
88
84
|
|
89
|
-
|
90
|
-
|
85
|
+
response.should render_template("entities/discard")
|
86
|
+
end
|
91
87
|
|
92
|
-
|
93
|
-
|
94
|
-
response.body.should == "window.location.reload();"
|
95
|
-
end
|
88
|
+
it "should display flash warning when the model is no longer available" do
|
89
|
+
@model.destroy
|
96
90
|
|
97
|
-
|
98
|
-
|
91
|
+
xhr :post, :discard, :id => @model.id, :attachment => @attachment.class.name, :attachment_id => @attachment.id
|
92
|
+
flash[:warning].should_not == nil
|
93
|
+
response.body.should == "window.location.reload();"
|
94
|
+
end
|
99
95
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
it "should display flash warning when the attachment is no longer available" do
|
97
|
+
@attachment.destroy
|
98
|
+
|
99
|
+
xhr :post, :discard, :id => @model.id, :attachment => @attachment.class.name, :attachment_id => @attachment.id
|
100
|
+
flash[:warning].should_not == nil
|
101
|
+
response.body.should == "window.location.reload();"
|
104
102
|
end
|
105
103
|
end
|
data/spec/shared/models.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
#------------------------------------------------------------------------------
|
6
6
|
require "cancan/matchers"
|
7
7
|
|
8
|
-
|
8
|
+
shared_examples_for "exportable" do
|
9
9
|
it "Model#export returns all records with extra attributes added" do
|
10
10
|
|
11
11
|
# User/assignee for the second record has no first/last name.
|
data/spec/spec_helper.rb
CHANGED
@@ -11,7 +11,7 @@ require 'rspec/rails'
|
|
11
11
|
require 'capybara/rails'
|
12
12
|
|
13
13
|
require 'acts_as_fu'
|
14
|
-
require '
|
14
|
+
require 'factory_girl'
|
15
15
|
require 'ffaker'
|
16
16
|
|
17
17
|
require 'coveralls'
|
@@ -38,7 +38,6 @@ RSpec.configure do |config|
|
|
38
38
|
|
39
39
|
# RSpec configuration options for Fat Free CRM.
|
40
40
|
config.include RSpec::Rails::Matchers
|
41
|
-
config.include(FactoryGirl::Syntax::Methods)
|
42
41
|
|
43
42
|
config.before(:each) do
|
44
43
|
# Overwrite locale settings within "config/settings.yml" if necessary.
|
data/spec/support/auth_macros.rb
CHANGED
@@ -17,8 +17,8 @@ end
|
|
17
17
|
#----------------------------------------------------------------------------
|
18
18
|
def login(user_stubs = {}, session_stubs = {})
|
19
19
|
User.current_user = @current_user = FactoryGirl.create(:user, user_stubs)
|
20
|
-
@current_user_session =
|
21
|
-
Authentication.stub
|
20
|
+
@current_user_session = double(Authentication, {:record => current_user}.merge(session_stubs))
|
21
|
+
Authentication.stub(:find).and_return(@current_user_session)
|
22
22
|
#set_timezone
|
23
23
|
end
|
24
24
|
alias :require_user :login
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
def logout
|
34
34
|
@current_user = nil
|
35
35
|
@current_user_session = nil
|
36
|
-
Authentication.stub
|
36
|
+
Authentication.stub(:find).and_return(nil)
|
37
37
|
end
|
38
38
|
alias :require_no_user :logout
|
39
39
|
|
@@ -5,31 +5,31 @@
|
|
5
5
|
#------------------------------------------------------------------------------
|
6
6
|
module MockIMAP
|
7
7
|
def mock_imap
|
8
|
-
@imap =
|
8
|
+
@imap = double
|
9
9
|
@settings = @crawler.instance_variable_get("@settings")
|
10
10
|
@settings[:address] = @mock_address
|
11
|
-
Net::IMAP.stub
|
11
|
+
Net::IMAP.stub(:new).with(@settings[:server], @settings[:port], @settings[:ssl]).and_return(@imap)
|
12
12
|
end
|
13
13
|
|
14
14
|
def mock_connect
|
15
15
|
mock_imap
|
16
|
-
@imap.stub
|
17
|
-
@imap.stub
|
16
|
+
@imap.stub(:login).and_return(true)
|
17
|
+
@imap.stub(:select).and_return(true)
|
18
18
|
end
|
19
19
|
|
20
20
|
def mock_disconnect
|
21
|
-
@imap.stub
|
22
|
-
@imap.stub
|
23
|
-
@imap.stub
|
21
|
+
@imap.stub(:disconnected?).and_return(false)
|
22
|
+
@imap.stub(:logout).and_return(true)
|
23
|
+
@imap.stub(:disconnect).and_return(true)
|
24
24
|
end
|
25
25
|
|
26
26
|
def mock_message(body)
|
27
|
-
@fetch_data =
|
28
|
-
@fetch_data.stub
|
29
|
-
@imap.stub
|
30
|
-
@imap.stub
|
31
|
-
@imap.stub
|
32
|
-
@imap.stub
|
27
|
+
@fetch_data = double
|
28
|
+
@fetch_data.stub(:attr).and_return("RFC822" => body)
|
29
|
+
@imap.stub(:uid_search).and_return([ :uid ])
|
30
|
+
@imap.stub(:uid_fetch).and_return([ @fetch_data ])
|
31
|
+
@imap.stub(:uid_copy).and_return(true)
|
32
|
+
@imap.stub(:uid_store).and_return(true)
|
33
33
|
body
|
34
34
|
end
|
35
35
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
4
4
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
5
|
#------------------------------------------------------------------------------
|
6
|
-
require
|
6
|
+
require 'spec_helper'
|
7
7
|
|
8
8
|
describe "/accounts/_edit" do
|
9
9
|
include AccountsHelper
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
4
4
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
5
|
#------------------------------------------------------------------------------
|
6
|
-
require
|
6
|
+
require 'spec_helper'
|
7
7
|
|
8
8
|
describe "/accounts/create" do
|
9
9
|
include AccountsHelper
|
@@ -23,21 +23,18 @@ describe "/accounts/create" do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should hide [Create Account] form and insert account partial" do
|
26
|
-
rendered.should
|
27
|
-
|
28
|
-
end
|
29
|
-
rendered.should include(%Q/$("account_#{@account.id}").visualEffect("highlight"/)
|
26
|
+
rendered.should include("jQuery('#accounts').prepend('<li class=\\'account highlight\\' id=\\'account_#{@account.id}\\'")
|
27
|
+
rendered.should include(%Q/jQuery('#account_#{@account.id}').effect("highlight"/)
|
30
28
|
end
|
31
29
|
|
32
30
|
it "should update pagination" do
|
33
|
-
rendered.should
|
31
|
+
rendered.should include("#paginate")
|
34
32
|
end
|
35
33
|
|
36
34
|
it "should refresh accounts sidebar" do
|
37
|
-
rendered.should
|
38
|
-
|
39
|
-
|
40
|
-
end
|
35
|
+
rendered.should include("#sidebar")
|
36
|
+
rendered.should have_text("Account Categories")
|
37
|
+
rendered.should have_text("Recent Items")
|
41
38
|
end
|
42
39
|
end
|
43
40
|
|
@@ -47,10 +44,8 @@ describe "/accounts/create" do
|
|
47
44
|
assign(:users, [ current_user ])
|
48
45
|
render
|
49
46
|
|
50
|
-
rendered.should
|
51
|
-
|
52
|
-
end
|
53
|
-
rendered.should include('$("create_account").visualEffect("shake"')
|
47
|
+
rendered.should include("#create_account")
|
48
|
+
rendered.should include(%Q/jQuery('#create_account').effect("shake"/)
|
54
49
|
end
|
55
50
|
end
|
56
51
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
4
4
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
5
|
#------------------------------------------------------------------------------
|
6
|
-
require
|
6
|
+
require 'spec_helper'
|
7
7
|
|
8
8
|
describe "/accounts/destroy" do
|
9
9
|
include AccountsHelper
|
@@ -17,19 +17,17 @@ describe "/accounts/destroy" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should blind up destroyed account partial" do
|
20
|
-
rendered.should include(
|
20
|
+
rendered.should include("slideUp")
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should update accounts pagination" do
|
24
|
-
rendered.should
|
24
|
+
rendered.should include("#paginate")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should update accounts sidebar" do
|
28
|
-
rendered.should
|
29
|
-
|
30
|
-
|
31
|
-
end
|
28
|
+
rendered.should include("#sidebar")
|
29
|
+
rendered.should have_text("Account Categories")
|
30
|
+
rendered.should have_text("Recent Items")
|
32
31
|
end
|
33
32
|
|
34
33
|
end
|
35
|
-
|