fat_free_crm 0.17.2 → 0.19.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 -5
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +71 -148
- data/.travis.yml +35 -14
- data/CHANGELOG.md +88 -5
- data/CONTRIBUTORS.md +96 -53
- data/Dockerfile +45 -14
- data/Gemfile +23 -13
- data/Gemfile.lock +249 -241
- data/Procfile +1 -1
- data/README.md +9 -6
- data/Rakefile +1 -1
- data/app/assets/javascripts/crm.js.coffee +3 -3
- data/app/assets/javascripts/crm_select2.js.coffee +15 -14
- data/app/assets/stylesheets/common.scss +1 -1
- data/app/controllers/admin/application_controller.rb +1 -1
- data/app/controllers/admin/field_groups_controller.rb +9 -4
- data/app/controllers/admin/fields_controller.rb +4 -4
- data/app/controllers/admin/groups_controller.rb +1 -1
- data/app/controllers/admin/tags_controller.rb +2 -4
- data/app/controllers/admin/users_controller.rb +5 -8
- data/app/controllers/application_controller.rb +22 -45
- data/app/controllers/comments_controller.rb +16 -11
- data/{config/initializers/authlogic.rb → app/controllers/confirmations_controller.rb} +4 -2
- data/app/controllers/emails_controller.rb +0 -2
- data/app/controllers/entities/accounts_controller.rb +1 -3
- data/app/controllers/entities/campaigns_controller.rb +8 -5
- data/app/controllers/entities/contacts_controller.rb +4 -24
- data/app/controllers/entities/leads_controller.rb +16 -12
- data/app/controllers/entities/opportunities_controller.rb +17 -16
- data/app/controllers/entities_controller.rb +31 -12
- data/app/controllers/home_controller.rb +2 -4
- data/app/controllers/lists_controller.rb +5 -1
- data/app/controllers/passwords_controller.rb +3 -59
- data/{spec/features/support/maintain_sessions.rb → app/controllers/registrations_controller.rb} +12 -5
- data/{lib/development_tasks/gem.rake → app/controllers/sessions_controller.rb} +6 -6
- data/app/controllers/tasks_controller.rb +22 -17
- data/app/controllers/users_controller.rb +8 -29
- data/app/helpers/accounts_helper.rb +1 -1
- data/app/helpers/admin/users_helper.rb +1 -1
- data/app/helpers/application_helper.rb +28 -33
- data/app/helpers/campaigns_helper.rb +1 -1
- data/app/helpers/contacts_helper.rb +1 -3
- data/app/helpers/leads_helper.rb +1 -1
- data/app/helpers/opportunities_helper.rb +48 -3
- data/app/helpers/tags_helper.rb +1 -1
- data/app/helpers/tasks_helper.rb +1 -1
- data/app/helpers/users_helper.rb +1 -3
- data/{config/initializers/paper_trail.rb → app/mailers/devise_mailer.rb} +5 -1
- data/app/mailers/user_mailer.rb +0 -9
- data/app/models/entities/account.rb +10 -10
- data/app/models/entities/campaign.rb +4 -6
- data/app/models/entities/contact.rb +24 -12
- data/app/models/entities/lead.rb +7 -14
- data/app/models/entities/opportunity.rb +10 -11
- data/app/models/fields/custom_field.rb +1 -0
- data/app/models/fields/custom_field_date_pair.rb +2 -0
- data/app/models/fields/field.rb +1 -3
- data/app/models/list.rb +1 -1
- data/app/models/observers/entity_observer.rb +3 -7
- data/app/models/observers/lead_observer.rb +2 -4
- data/app/models/observers/opportunity_observer.rb +5 -7
- data/app/models/observers/task_observer.rb +1 -1
- data/app/models/polymorphic/email.rb +2 -2
- data/app/models/polymorphic/task.rb +13 -9
- data/app/models/polymorphic/version.rb +3 -2
- data/app/models/setting.rb +2 -0
- data/app/models/users/ability.rb +3 -4
- data/app/models/users/permission.rb +3 -3
- data/app/models/users/preference.rb +2 -1
- data/app/models/users/user.rb +67 -42
- data/app/views/accounts/_top_section.html.haml +1 -1
- data/app/views/accounts/edit.js.haml +1 -1
- data/app/views/accounts/update.js.haml +2 -2
- data/app/views/admin/users/_user.html.haml +4 -4
- data/app/views/campaigns/_metrics.html.haml +3 -3
- data/app/views/contacts/_index_brief.html.haml +1 -1
- data/app/views/contacts/_index_full.html.haml +1 -1
- data/app/views/contacts/_index_long.html.haml +1 -1
- data/app/views/devise/confirmations/new.html.haml +9 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/devise/mailer/password_change.html.haml +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/devise/passwords/edit.html.haml +18 -0
- data/app/views/devise/passwords/new.html.haml +10 -0
- data/app/views/devise/registrations/new.html.haml +21 -0
- data/app/views/devise/sessions/new.html.haml +32 -0
- data/app/views/home/_opportunity.html.haml +4 -19
- data/app/views/layouts/_about.html.haml +5 -5
- data/app/views/layouts/_header.html.haml +3 -3
- data/app/views/layouts/admin/_header.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -24
- data/app/views/opportunities/_sidebar_show.html.haml +3 -3
- data/app/views/opportunities/_top_section.html.haml +1 -1
- data/app/views/shared/_address.html.haml +5 -5
- data/app/views/shared/_paginate_with_per_page.html.haml +1 -0
- data/app/views/users/_avatar.html.haml +1 -1
- data/bin/bundle +1 -1
- data/bin/rails +1 -1
- data/bin/setup +38 -0
- data/bin/update +33 -0
- data/bin/yarn +13 -0
- data/config/application.rb +8 -6
- data/config/boot.rb +1 -1
- data/config/brakeman.ignore +2 -2
- data/config/database.postgres.docker.yml +5 -5
- data/config/environment.rb +1 -1
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +7 -0
- data/config/initializers/action_mailer.rb +1 -3
- data/config/initializers/application_controller_renderer.rb +9 -0
- data/config/initializers/assets.rb +6 -11
- data/config/initializers/backtrace_silencers.rb +0 -6
- data/config/initializers/content_security_policy.rb +26 -0
- data/config/initializers/cookies_serializer.rb +3 -6
- data/config/initializers/devise.rb +289 -0
- data/config/initializers/filter_parameter_logging.rb +0 -5
- data/config/initializers/gravatar.rb +0 -1
- data/config/initializers/inflections.rb +0 -6
- data/config/initializers/mime_types.rb +1 -9
- data/config/initializers/new_framework_defaults_5_2.rb +40 -0
- data/config/initializers/relative_url_root.rb +1 -3
- data/config/initializers/session_store.rb +1 -3
- data/config/initializers/wrap_parameters.rb +4 -9
- data/config/locales/fat_free_crm.en-GB.yml +5 -5
- data/config/locales/fat_free_crm.en-US.yml +5 -5
- data/config/locales/fat_free_crm.fr.yml +1 -1
- data/config/locales/fat_free_crm.ru.yml +1 -0
- data/config/routes.rb +20 -9
- data/db/demo/users.yml +62 -81
- data/db/migrate/20100928030620_remove_uuid.rb +1 -2
- data/db/migrate/20120316045804_activities_to_versions.rb +1 -0
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +1 -0
- data/db/migrate/20180107082701_authlogic_to_devise.rb +58 -0
- data/db/schema.rb +48 -46
- data/docker-compose.yml +10 -0
- data/fat_free_crm.gemspec +12 -14
- data/lib/development_tasks/license.rake +2 -2
- data/lib/fat_free_crm/callback.rb +2 -2
- data/lib/fat_free_crm/comment_extensions.rb +2 -4
- data/lib/fat_free_crm/core_ext/string.rb +1 -1
- data/lib/fat_free_crm/engine.rb +2 -2
- data/lib/fat_free_crm/errors.rb +1 -1
- data/lib/fat_free_crm/export_csv.rb +1 -0
- data/lib/fat_free_crm/exportable.rb +1 -1
- data/lib/fat_free_crm/fields.rb +2 -2
- data/lib/fat_free_crm/gem_dependencies.rb +1 -1
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +1 -3
- data/lib/fat_free_crm/i18n.rb +2 -2
- data/lib/fat_free_crm/mail_processor/base.rb +4 -10
- data/lib/fat_free_crm/mail_processor/dropbox.rb +5 -15
- data/lib/fat_free_crm/permissions.rb +7 -18
- data/lib/fat_free_crm/sortable.rb +1 -1
- data/lib/fat_free_crm/tabs.rb +2 -2
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/gravatar_image_tag.rb +7 -8
- data/lib/missing_translation_detector.rb +1 -0
- data/lib/tasks/ffcrm/missing_translations.rake +1 -0
- data/lib/tasks/ffcrm/setup.rake +13 -4
- data/lib/tasks/ffcrm/update_data.rake +2 -2
- data/script/rails +2 -2
- data/spec/controllers/admin/users_controller_spec.rb +25 -81
- data/spec/controllers/comments_controller_spec.rb +19 -19
- data/spec/controllers/emails_controller_spec.rb +2 -2
- data/spec/controllers/entities/accounts_controller_spec.rb +56 -56
- data/spec/controllers/entities/campaigns_controller_spec.rb +66 -66
- data/spec/controllers/entities/contacts_controller_spec.rb +69 -68
- data/spec/controllers/entities/leads_controller_spec.rb +126 -126
- data/spec/controllers/entities/opportunities_controller_spec.rb +101 -101
- data/spec/controllers/entities_controller_spec.rb +5 -0
- data/spec/controllers/home_controller_spec.rb +30 -30
- data/spec/controllers/tasks_controller_spec.rb +42 -40
- data/spec/controllers/users_controller_spec.rb +43 -113
- data/spec/factories/account_factories.rb +13 -13
- data/spec/factories/campaign_factories.rb +8 -8
- data/spec/factories/contact_factories.rb +18 -18
- data/spec/factories/field_factories.rb +11 -10
- data/spec/factories/lead_factories.rb +13 -13
- data/spec/factories/list_factories.rb +3 -3
- data/spec/factories/opportunity_factories.rb +9 -9
- data/spec/factories/sequences.rb +1 -1
- data/spec/factories/setting_factories.rb +5 -5
- data/spec/factories/shared_factories.rb +25 -23
- data/spec/factories/subscription_factories.rb +1 -1
- data/spec/factories/tag_factories.rb +1 -1
- data/spec/factories/task_factories.rb +11 -11
- data/spec/factories/user_factories.rb +27 -30
- data/spec/features/accounts_spec.rb +17 -4
- data/spec/features/admin/groups_spec.rb +2 -2
- data/spec/features/admin/users_spec.rb +4 -2
- data/spec/features/campaigns_spec.rb +5 -5
- data/spec/features/contacts_spec.rb +11 -5
- data/spec/features/dashboard_spec.rb +8 -8
- data/spec/features/devise/sign_in_spec.rb +58 -0
- data/spec/features/devise/sign_up_spec.rb +36 -0
- data/spec/features/leads_spec.rb +5 -5
- data/spec/features/opportunities_overview_spec.rb +16 -16
- data/spec/features/opportunities_spec.rb +35 -9
- data/spec/features/support/autocomlete_helper.rb +17 -0
- data/spec/features/support/browser.rb +5 -9
- data/spec/features/tasks_spec.rb +5 -5
- data/spec/helpers/admin/field_groups_helper_spec.rb +1 -1
- data/spec/helpers/application_helper_spec.rb +1 -1
- data/spec/helpers/tasks_helper_spec.rb +1 -1
- data/spec/helpers/users_helper_spec.rb +7 -7
- data/spec/lib/comment_extensions_spec.rb +11 -5
- data/spec/lib/errors_spec.rb +2 -2
- data/spec/lib/mail_processor/base_spec.rb +3 -3
- data/spec/lib/mail_processor/comment_replies_spec.rb +3 -3
- data/spec/lib/mail_processor/dropbox_spec.rb +17 -17
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +8 -8
- data/spec/lib/permissions_spec.rb +15 -28
- data/spec/mailers/devise_mailer_spec.rb +35 -0
- data/spec/mailers/user_mailer_spec.rb +6 -32
- data/spec/models/entities/account_spec.rb +58 -32
- data/spec/models/entities/campaign_spec.rb +18 -25
- data/spec/models/entities/contact_spec.rb +113 -21
- data/spec/models/entities/lead_spec.rb +9 -11
- data/spec/models/entities/opportunity_spec.rb +45 -45
- data/spec/models/fields/custom_field_date_pair_spec.rb +4 -2
- data/spec/models/fields/custom_field_spec.rb +21 -19
- data/spec/models/list_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +7 -7
- data/spec/models/polymorphic/address_spec.rb +1 -1
- data/spec/models/polymorphic/avatar_spec.rb +5 -5
- data/spec/models/polymorphic/comment_spec.rb +5 -5
- data/spec/models/polymorphic/task_spec.rb +65 -58
- data/spec/models/polymorphic/version_spec.rb +31 -31
- data/spec/models/setting_spec.rb +2 -2
- data/spec/models/users/preference_spec.rb +6 -6
- data/spec/models/users/user_spec.rb +46 -50
- data/spec/routing/users_routing_spec.rb +30 -8
- data/spec/shared/controllers.rb +3 -9
- data/spec/shared/models.rb +22 -22
- data/spec/spec_helper.rb +12 -4
- data/spec/support/assert_select.rb +1 -0
- data/spec/support/devise_helpers.rb +28 -0
- data/spec/{features/support/helpers.rb → support/feature_helpers.rb} +11 -11
- data/spec/support/macros.rb +7 -4
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +2 -2
- data/spec/views/accounts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/accounts/edit.js.haml_spec.rb +2 -2
- data/spec/views/accounts/index.haml_spec.rb +2 -2
- data/spec/views/accounts/index.js.haml_spec.rb +1 -1
- data/spec/views/accounts/show.haml_spec.rb +4 -4
- data/spec/views/accounts/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/destroy.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/edit.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/index.haml_spec.rb +1 -1
- data/spec/views/admin/users/index.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -1
- data/spec/views/application/auto_complete.haml_spec.rb +3 -3
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +3 -3
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/index.haml_spec.rb +1 -1
- data/spec/views/campaigns/index.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/show.haml_spec.rb +4 -4
- data/spec/views/campaigns/update.js.haml_spec.rb +1 -1
- data/spec/views/contacts/_edit.haml_spec.rb +7 -7
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +4 -4
- data/spec/views/contacts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/contacts/edit.js.haml_spec.rb +3 -3
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/index.js.html_spec.rb +1 -1
- data/spec/views/contacts/new.js.haml_spec.rb +1 -1
- data/spec/views/contacts/show.haml_spec.rb +3 -3
- data/spec/views/contacts/update.js.haml_spec.rb +3 -3
- data/spec/views/home/index.haml_spec.rb +1 -1
- data/spec/views/home/index.js.haml_spec.rb +1 -1
- data/spec/views/home/options.js.haml_spec.rb +2 -2
- data/spec/views/leads/_convert.haml_spec.rb +3 -3
- data/spec/views/leads/_edit.haml_spec.rb +2 -2
- data/spec/views/leads/_new.haml_spec.rb +2 -2
- data/spec/views/leads/_sidebar_show.haml_spec.rb +5 -5
- data/spec/views/leads/convert.js.haml_spec.rb +4 -4
- data/spec/views/leads/create.js.haml_spec.rb +5 -5
- data/spec/views/leads/destroy.js.haml_spec.rb +2 -2
- data/spec/views/leads/edit.js.haml_spec.rb +4 -4
- data/spec/views/leads/index.haml_spec.rb +1 -1
- data/spec/views/leads/index.js.haml_spec.rb +1 -1
- data/spec/views/leads/new.js.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +7 -7
- data/spec/views/leads/reject.js.haml_spec.rb +2 -2
- data/spec/views/leads/show.haml_spec.rb +2 -2
- data/spec/views/leads/update.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/_edit.haml_spec.rb +7 -7
- data/spec/views/opportunities/_new.haml_spec.rb +2 -2
- data/spec/views/opportunities/create.js.haml_spec.rb +6 -6
- data/spec/views/opportunities/destroy.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/edit.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/index.haml_spec.rb +1 -1
- data/spec/views/opportunities/index.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/new.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/show.haml_spec.rb +3 -3
- data/spec/views/opportunities/update.js.haml_spec.rb +5 -5
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +4 -4
- data/spec/views/tasks/create.js.haml_spec.rb +6 -6
- data/spec/views/tasks/destroy.js.haml_spec.rb +2 -2
- data/spec/views/tasks/index.haml_spec.rb +4 -4
- data/spec/views/tasks/new.js.haml_spec.rb +1 -1
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +2 -2
- data/spec/views/tasks/update.js.haml_spec.rb +18 -18
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- data/vendor/gems/ransack_ui-1.3.4/.gitignore +17 -0
- data/vendor/gems/ransack_ui-1.3.4/Gemfile +7 -0
- data/vendor/gems/ransack_ui-1.3.4/LICENSE.txt +22 -0
- data/vendor/gems/ransack_ui-1.3.4/README.md +57 -0
- data/vendor/gems/ransack_ui-1.3.4/Rakefile +1 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/images/ransack_ui/calendar.png +0 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/images/ransack_ui/delete.png +0 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/javascripts/ransack/predicates.js.coffee +41 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/javascripts/ransack_ui_bootstrap/button_group_select.js.coffee +26 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/javascripts/ransack_ui_bootstrap/index.js.coffee +2 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/javascripts/ransack_ui_jquery/index.js +2 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/javascripts/ransack_ui_jquery/search_form.js.coffee.erb +499 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/stylesheets/ransack_ui_bootstrap/index.css +3 -0
- data/vendor/gems/ransack_ui-1.3.4/app/assets/stylesheets/ransack_ui_bootstrap/search.css.scss +41 -0
- data/vendor/gems/ransack_ui-1.3.4/app/views/ransack_ui/_condition_fields.html.erb +15 -0
- data/vendor/gems/ransack_ui-1.3.4/app/views/ransack_ui/_grouping_fields.html.erb +16 -0
- data/vendor/gems/ransack_ui-1.3.4/app/views/ransack_ui/_search.html.erb +29 -0
- data/vendor/gems/ransack_ui-1.3.4/app/views/ransack_ui/_sort_fields.html.erb +4 -0
- data/vendor/gems/ransack_ui-1.3.4/config/locales/en.yml +24 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui.rb +9 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/adapters/active_record.rb +6 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/adapters/active_record/base.rb +46 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/controller_helpers.rb +18 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/rails/engine.rb +21 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/adapters/active_record/base.rb +47 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/configuration.rb +15 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/context.rb +9 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/helpers/form_builder.rb +262 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/nodes/attribute.rb +13 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/nodes/condition.rb +13 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/ransack_overrides/nodes/grouping.rb +20 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/version.rb +3 -0
- data/vendor/gems/ransack_ui-1.3.4/lib/ransack_ui/view_helpers.rb +30 -0
- data/vendor/gems/ransack_ui-1.3.4/ransack_ui.gemspec +23 -0
- metadata +83 -70
- data/app/controllers/authentications_controller.rb +0 -53
- data/app/models/users/authentication.rb +0 -56
- data/app/views/authentications/new.html.haml +0 -19
- data/app/views/passwords/edit.html.haml +0 -15
- data/app/views/passwords/new.html.haml +0 -10
- data/app/views/user_mailer/password_reset_instructions.html.haml +0 -6
- data/app/views/users/new.html.haml +0 -19
- data/spec/controllers/authentications_controller_spec.rb +0 -150
- data/spec/controllers/passwords_controller_spec.rb +0 -32
- data/spec/models/users/authentication_spec.rb +0 -19
- data/spec/support/auth_macros.rb +0 -49
- data/spec/views/authentications/new.haml_spec.rb +0 -31
@@ -5,9 +5,9 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :list do
|
10
|
-
name "Foo List"
|
11
|
-
url "/controller/action"
|
10
|
+
name { "Foo List" }
|
11
|
+
url { "/controller/action" }
|
12
12
|
end
|
13
13
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
sequence :opportunity_status do |_s|
|
10
10
|
%w[prospecting analysis presentation proposal negotiation final_review won lost].sample
|
11
11
|
end
|
@@ -18,22 +18,22 @@ FactoryGirl.define do
|
|
18
18
|
user
|
19
19
|
campaign
|
20
20
|
account
|
21
|
-
assigned_to nil
|
21
|
+
assigned_to { nil }
|
22
22
|
name { FFaker::Lorem.sentence[0, 64] }
|
23
|
-
access "Public"
|
23
|
+
access { "Public" }
|
24
24
|
source { %w[campaign cold_call conference online referral self web word_of_mouth other].sample }
|
25
|
-
stage {
|
25
|
+
stage { FactoryBot.generate(:opportunity_status) }
|
26
26
|
probability { rand(50) }
|
27
27
|
amount { rand(1000) }
|
28
28
|
discount { rand(100) }
|
29
|
-
closes_on {
|
29
|
+
closes_on { FactoryBot.generate(:date) }
|
30
30
|
background_info { FFaker::Lorem.paragraph[0, 255] }
|
31
|
-
deleted_at nil
|
32
|
-
updated_at {
|
33
|
-
created_at {
|
31
|
+
deleted_at { nil }
|
32
|
+
updated_at { FactoryBot.generate(:time) }
|
33
|
+
created_at { FactoryBot.generate(:time) }
|
34
34
|
end
|
35
35
|
|
36
36
|
factory :opportunity_in_pipeline, parent: :opportunity do
|
37
|
-
stage {
|
37
|
+
stage { FactoryBot.generate(:opportunity_open_status) }
|
38
38
|
end
|
39
39
|
end
|
data/spec/factories/sequences.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
sequence :address do |_n|
|
10
10
|
FFaker::Address.street_address + " " + FFaker::Address.secondary_address + "\n" + FFaker::Address.city + ", " + FFaker::AddressUS.state_abbr + " " + FFaker::AddressUS.zip_code
|
11
11
|
end
|
@@ -5,11 +5,11 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :setting do
|
10
|
-
name "foo"
|
11
|
-
value nil
|
12
|
-
updated_at {
|
13
|
-
created_at {
|
10
|
+
name { "foo" }
|
11
|
+
value { nil }
|
12
|
+
updated_at { FactoryBot.generate(:time) }
|
13
|
+
created_at { FactoryBot.generate(:time) }
|
14
14
|
end
|
15
15
|
end
|
@@ -5,23 +5,25 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :version do
|
10
|
-
whodunnit ""
|
10
|
+
whodunnit { "" }
|
11
11
|
item { raise "Please specify :item for the version" }
|
12
|
-
event "create"
|
13
|
-
created_at {
|
12
|
+
event { "create" }
|
13
|
+
created_at { FactoryBot.generate(:time) }
|
14
14
|
end
|
15
15
|
|
16
16
|
factory :comment do
|
17
17
|
user
|
18
18
|
commentable { raise "Please specify :commentable for the comment" }
|
19
|
-
title {
|
20
|
-
|
19
|
+
title { FactoryBot.generate(:title) }
|
20
|
+
|
21
|
+
private { false }
|
22
|
+
|
21
23
|
comment { FFaker::Lorem.paragraph }
|
22
|
-
state "Expanded"
|
23
|
-
updated_at {
|
24
|
-
created_at {
|
24
|
+
state { "Expanded" }
|
25
|
+
updated_at { FactoryBot.generate(:time) }
|
26
|
+
created_at { FactoryBot.generate(:time) }
|
25
27
|
end
|
26
28
|
|
27
29
|
factory :email do
|
@@ -31,16 +33,16 @@ FactoryGirl.define do
|
|
31
33
|
sent_from { FFaker::Internet.email }
|
32
34
|
sent_to { FFaker::Internet.email }
|
33
35
|
cc { FFaker::Internet.email }
|
34
|
-
bcc nil
|
36
|
+
bcc { nil }
|
35
37
|
subject { FFaker::Lorem.sentence }
|
36
38
|
body { FFaker::Lorem.paragraph[0, 255] }
|
37
|
-
header nil
|
38
|
-
sent_at {
|
39
|
-
received_at {
|
40
|
-
deleted_at nil
|
41
|
-
state "Expanded"
|
42
|
-
updated_at {
|
43
|
-
created_at {
|
39
|
+
header { nil }
|
40
|
+
sent_at { FactoryBot.generate(:time) }
|
41
|
+
received_at { FactoryBot.generate(:time) }
|
42
|
+
deleted_at { nil }
|
43
|
+
state { "Expanded" }
|
44
|
+
updated_at { FactoryBot.generate(:time) }
|
45
|
+
created_at { FactoryBot.generate(:time) }
|
44
46
|
end
|
45
47
|
|
46
48
|
factory :address do
|
@@ -51,18 +53,18 @@ FactoryGirl.define do
|
|
51
53
|
state { FFaker::AddressUS.state_abbr }
|
52
54
|
zipcode { FFaker::AddressUS.zip_code }
|
53
55
|
country { FFaker::AddressUK.country }
|
54
|
-
full_address {
|
56
|
+
full_address { FactoryBot.generate(:address) }
|
55
57
|
address_type { %w[Business Billing Shipping].sample }
|
56
|
-
updated_at {
|
57
|
-
created_at {
|
58
|
-
deleted_at nil
|
58
|
+
updated_at { FactoryBot.generate(:time) }
|
59
|
+
created_at { FactoryBot.generate(:time) }
|
60
|
+
deleted_at { nil }
|
59
61
|
end
|
60
62
|
|
61
63
|
factory :avatar do
|
62
64
|
user
|
63
65
|
entity { raise "Please specify :entity for the avatar" }
|
64
66
|
image { File.new(Rails.root.join('spec', 'fixtures', 'rails.png')) }
|
65
|
-
updated_at {
|
66
|
-
created_at {
|
67
|
+
updated_at { FactoryBot.generate(:time) }
|
68
|
+
created_at { FactoryBot.generate(:time) }
|
67
69
|
end
|
68
70
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :tag do
|
10
10
|
name { FFaker::Internet.user_name }
|
11
11
|
end
|
@@ -5,22 +5,22 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :task do
|
10
10
|
user
|
11
|
-
asset nil
|
12
|
-
assigned_to nil
|
13
|
-
completed_by nil
|
11
|
+
asset { nil }
|
12
|
+
assigned_to { nil }
|
13
|
+
completed_by { nil }
|
14
14
|
name { FFaker::Lorem.sentence[0, 64] }
|
15
|
-
priority nil
|
15
|
+
priority { nil }
|
16
16
|
category { %w[call email follow_up lunch meeting money presentation trip].sample }
|
17
|
-
bucket "due_asap"
|
18
|
-
due_at {
|
17
|
+
bucket { "due_asap" }
|
18
|
+
due_at { FactoryBot.generate(:time) }
|
19
19
|
background_info { FFaker::Lorem.paragraph[0, 255] }
|
20
|
-
completed_at nil
|
21
|
-
deleted_at nil
|
22
|
-
updated_at {
|
23
|
-
created_at {
|
20
|
+
completed_at { nil }
|
21
|
+
deleted_at { nil }
|
22
|
+
updated_at { FactoryBot.generate(:time) }
|
23
|
+
created_at { FactoryBot.generate(:time) }
|
24
24
|
end
|
25
25
|
|
26
26
|
factory :completed_task, parent: :task do
|
@@ -5,62 +5,59 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
8
|
+
FactoryBot.define do
|
9
9
|
factory :user do
|
10
|
-
username {
|
10
|
+
username { FactoryBot.generate(:username) }
|
11
11
|
email { FFaker::Internet.email }
|
12
12
|
first_name { FFaker::Name.first_name }
|
13
13
|
last_name { FFaker::Name.last_name }
|
14
|
-
title {
|
14
|
+
title { FactoryBot.generate(:title) }
|
15
15
|
company { FFaker::Company.name }
|
16
16
|
alt_email { FFaker::Internet.email }
|
17
17
|
phone { FFaker::PhoneNumber.phone_number }
|
18
18
|
mobile { FFaker::PhoneNumber.phone_number }
|
19
|
-
aim nil
|
20
|
-
yahoo nil
|
21
|
-
google nil
|
22
|
-
skype nil
|
23
|
-
admin false
|
24
|
-
|
19
|
+
aim { nil }
|
20
|
+
yahoo { nil }
|
21
|
+
google { nil }
|
22
|
+
skype { nil }
|
23
|
+
admin { false }
|
24
|
+
encrypted_password { SecureRandom.hex(64) }
|
25
25
|
password_salt { SecureRandom.hex(64) }
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
suspended_at nil
|
38
|
-
password "password"
|
39
|
-
password_confirmation "password"
|
26
|
+
last_sign_in_at { FactoryBot.generate(:time) }
|
27
|
+
current_sign_in_at { FactoryBot.generate(:time) }
|
28
|
+
last_sign_in_ip { "127.0.0.1" }
|
29
|
+
current_sign_in_ip { "127.0.0.1" }
|
30
|
+
sign_in_count { rand(1..100) }
|
31
|
+
deleted_at { nil }
|
32
|
+
updated_at { FactoryBot.generate(:time) }
|
33
|
+
created_at { FactoryBot.generate(:time) }
|
34
|
+
suspended_at { nil }
|
35
|
+
password { "password" }
|
36
|
+
password_confirmation { "password" }
|
40
37
|
end
|
41
38
|
|
42
39
|
factory :admin do
|
43
|
-
admin true
|
40
|
+
admin { true }
|
44
41
|
end
|
45
42
|
|
46
43
|
factory :permission do
|
47
44
|
user
|
48
45
|
asset { raise "Please specify :asset for the permission" }
|
49
|
-
updated_at {
|
50
|
-
created_at {
|
46
|
+
updated_at { FactoryBot.generate(:time) }
|
47
|
+
created_at { FactoryBot.generate(:time) }
|
51
48
|
end
|
52
49
|
|
53
50
|
factory :preference do
|
54
51
|
user
|
55
52
|
name { raise "Please specify :name for the preference" }
|
56
53
|
value { raise "Please specify :value for the preference" }
|
57
|
-
updated_at {
|
58
|
-
created_at {
|
54
|
+
updated_at { FactoryBot.generate(:time) }
|
55
|
+
created_at { FactoryBot.generate(:time) }
|
59
56
|
end
|
60
57
|
|
61
58
|
factory :group do
|
62
59
|
name { FFaker::Company.name }
|
63
|
-
updated_at {
|
64
|
-
created_at {
|
60
|
+
updated_at { FactoryBot.generate(:time) }
|
61
|
+
created_at { FactoryBot.generate(:time) }
|
65
62
|
end
|
66
63
|
end
|
@@ -17,7 +17,7 @@ feature 'Accounts', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should view a list of accounts' do
|
20
|
-
2.times { |i|
|
20
|
+
2.times { |i| create(:account, name: "Account #{i}") }
|
21
21
|
visit accounts_page
|
22
22
|
expect(page).to have_content('Account 0')
|
23
23
|
expect(page).to have_content('Account 1')
|
@@ -70,7 +70,7 @@ feature 'Accounts', '
|
|
70
70
|
end
|
71
71
|
|
72
72
|
scenario 'should view and edit an account', js: true, versioning: true do
|
73
|
-
|
73
|
+
create(:account, name: "A new account")
|
74
74
|
with_versioning do
|
75
75
|
visit accounts_page
|
76
76
|
find('div#accounts').click_link('A new account')
|
@@ -86,7 +86,7 @@ feature 'Accounts', '
|
|
86
86
|
end
|
87
87
|
|
88
88
|
scenario 'should delete an account', js: true do
|
89
|
-
|
89
|
+
create(:account, name: "My new account")
|
90
90
|
visit accounts_page
|
91
91
|
find('div#accounts').click_link('My new account')
|
92
92
|
click_link 'Delete?'
|
@@ -96,7 +96,7 @@ feature 'Accounts', '
|
|
96
96
|
end
|
97
97
|
|
98
98
|
scenario 'should search for an account', js: true do
|
99
|
-
2.times { |i|
|
99
|
+
2.times { |i| create(:account, name: "Account #{i}") }
|
100
100
|
visit accounts_page
|
101
101
|
expect(find('#accounts')).to have_content("Account 0")
|
102
102
|
expect(find('#accounts')).to have_content("Account 1")
|
@@ -110,4 +110,17 @@ feature 'Accounts', '
|
|
110
110
|
expect(find('#accounts')).not_to have_content("Account 0")
|
111
111
|
expect(find('#accounts')).not_to have_content("Account 1")
|
112
112
|
end
|
113
|
+
|
114
|
+
scenario 'should attach task to account', js: true, versioning: true do
|
115
|
+
create(:task, name: 'Task', user: @user)
|
116
|
+
create(:account, name: 'Account')
|
117
|
+
with_versioning do
|
118
|
+
visit accounts_page
|
119
|
+
expect(find('#accounts')).to have_content("Account")
|
120
|
+
click_link 'Account'
|
121
|
+
click_link 'Select Task'
|
122
|
+
fill_autocomplete('auto_complete_query', with: 'Ta')
|
123
|
+
expect(find('#tasks')).to have_content('Task re: Account')
|
124
|
+
end
|
125
|
+
end
|
113
126
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('../acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Groups tab', '
|
11
11
|
In order to increase customer satisfaction
|
@@ -17,7 +17,7 @@ feature 'Groups tab', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should create a new group', js: true do
|
20
|
-
|
20
|
+
create(:user, first_name: "Mr", last_name: "Spock")
|
21
21
|
visit admin_groups_path
|
22
22
|
expect(page).to have_content("Couldn't find any Groups.")
|
23
23
|
click_link 'create a new group'
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('../acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Users tab', '
|
11
11
|
In order to increase customer satisfaction
|
@@ -17,7 +17,7 @@ feature 'Users tab', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should create a new user', js: true do
|
20
|
-
|
20
|
+
create(:group, name: "Superheroes")
|
21
21
|
visit admin_users_path
|
22
22
|
click_link 'Create User'
|
23
23
|
expect(page).to have_selector('#user_username', visible: true)
|
@@ -25,6 +25,8 @@ feature 'Users tab', '
|
|
25
25
|
fill_in 'user_email', with: 'lightning@example.com'
|
26
26
|
fill_in 'user_first_name', with: 'Captain'
|
27
27
|
fill_in 'user_last_name', with: 'Thunder'
|
28
|
+
fill_in 'user_password', with: 'password'
|
29
|
+
fill_in 'user_password_confirmation', with: 'password'
|
28
30
|
fill_in 'user_title', with: 'Chief'
|
29
31
|
fill_in 'user_company', with: 'Weather Inc.'
|
30
32
|
select 'Superheroes', from: 'user_group_ids'
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Campaigns', '
|
11
11
|
In order to increase customer satisfaction
|
@@ -17,7 +17,7 @@ feature 'Campaigns', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should view a list of campaigns' do
|
20
|
-
3.times { |i|
|
20
|
+
3.times { |i| create(:campaign, name: "Campaign #{i}") }
|
21
21
|
visit campaigns_page
|
22
22
|
expect(page).to have_content('Campaign 0')
|
23
23
|
expect(page).to have_content('Campaign 1')
|
@@ -60,7 +60,7 @@ feature 'Campaigns', '
|
|
60
60
|
end
|
61
61
|
|
62
62
|
scenario 'should view and edit a campaign', js: true do
|
63
|
-
|
63
|
+
create(:campaign, name: "My Cool Campaign")
|
64
64
|
with_versioning do
|
65
65
|
visit campaigns_page
|
66
66
|
click_link 'My Cool Campaign'
|
@@ -76,7 +76,7 @@ feature 'Campaigns', '
|
|
76
76
|
end
|
77
77
|
|
78
78
|
scenario 'should delete a campaign', js: true do
|
79
|
-
|
79
|
+
create(:campaign, name: "Old Campaign")
|
80
80
|
visit campaigns_page
|
81
81
|
click_link 'Old Campaign'
|
82
82
|
click_link 'Delete?'
|
@@ -87,7 +87,7 @@ feature 'Campaigns', '
|
|
87
87
|
end
|
88
88
|
|
89
89
|
scenario 'should search for a campaign', js: true do
|
90
|
-
2.times { |i|
|
90
|
+
2.times { |i| create(:campaign, name: "Campaign #{i}") }
|
91
91
|
visit campaigns_page
|
92
92
|
expect(find('#campaigns')).to have_content("Campaign 0")
|
93
93
|
expect(find('#campaigns')).to have_content("Campaign 1")
|