fat_free_crm 0.20.1 → 0.22.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 +4 -4
- data/CHANGELOG.md +170 -0
- data/README.md +3 -6
- data/app/assets/config/fat_free_crm.js +3 -0
- data/app/assets/config/manifest.js +1 -0
- data/app/controllers/admin/field_groups_controller.rb +0 -2
- data/app/controllers/admin/tags_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/controllers/application_controller.rb +11 -0
- data/app/controllers/comments_controller.rb +2 -0
- data/app/controllers/emails_controller.rb +2 -0
- data/app/controllers/entities/accounts_controller.rb +3 -1
- data/app/controllers/entities/campaigns_controller.rb +3 -1
- data/app/controllers/entities/contacts_controller.rb +3 -1
- data/app/controllers/entities/leads_controller.rb +4 -2
- data/app/controllers/entities/opportunities_controller.rb +3 -1
- data/app/controllers/entities_controller.rb +2 -0
- data/app/controllers/home_controller.rb +2 -0
- data/app/controllers/lists_controller.rb +2 -0
- data/app/controllers/tasks_controller.rb +3 -1
- data/app/controllers/users_controller.rb +2 -0
- data/app/helpers/accounts_helper.rb +2 -0
- data/app/helpers/application_helper.rb +22 -3
- data/app/helpers/tasks_helper.rb +1 -2
- data/app/models/entities/account.rb +1 -1
- data/app/models/entities/campaign.rb +1 -1
- data/app/models/entities/contact.rb +1 -1
- data/app/models/entities/lead.rb +1 -1
- data/app/models/entities/opportunity.rb +1 -1
- data/app/models/fields/custom_field.rb +2 -2
- data/app/models/observers/entity_observer.rb +1 -1
- data/app/models/polymorphic/avatar.rb +1 -30
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/polymorphic/task.rb +1 -0
- data/app/models/setting.rb +4 -5
- data/app/models/users/user.rb +1 -1
- data/app/views/home/index.xls.builder +1 -0
- data/app/views/shared/_address.html.haml +1 -1
- data/bin/bundle +108 -2
- data/bin/rails +3 -3
- data/bin/rake +2 -2
- data/bin/setup +12 -15
- data/config/application.rb +22 -4
- data/config/boot.rb +3 -5
- data/config/cable.yml +10 -0
- data/config/database.yml +26 -0
- data/config/environment.rb +4 -3
- data/config/environments/development.rb +47 -11
- data/config/environments/production.rb +17 -15
- data/config/environments/test.rb +19 -9
- data/config/initializers/action_mailer.rb +1 -0
- data/config/initializers/content_security_policy.rb +21 -26
- data/config/initializers/custom_field_ransack_translations.rb +1 -0
- data/config/initializers/filter_parameter_logging.rb +6 -2
- data/config/initializers/inflections.rb +4 -4
- data/config/initializers/permissions_policy.rb +12 -0
- data/config/puma.rb +2 -2
- data/config/storage.yml +34 -0
- data/db/demo/field_groups.yml +2 -1
- data/db/migrate/20100928030617_drop_openid_tables.rb +2 -1
- data/db/migrate/20230526211831_create_active_storage_tables.active_storage.rb +51 -0
- data/db/migrate/20230526212613_convert_to_active_storage.rb +107 -0
- data/db/schema.rb +108 -76
- data/db/seeds/fields.rb +7 -21
- data/lib/development_tasks/license.rake +10 -10
- data/lib/fat_free_crm/callback.rb +2 -3
- data/lib/fat_free_crm/errors.rb +2 -10
- data/lib/fat_free_crm/exceptions.rb +1 -0
- data/lib/fat_free_crm/fields.rb +4 -5
- data/lib/fat_free_crm/gem_dependencies.rb +0 -1
- data/lib/fat_free_crm/i18n.rb +1 -1
- data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
- data/lib/fat_free_crm/version.rb +3 -3
- data/public/avatars/User/2/large_rails.png +0 -0
- data/public/avatars/User/2/medium_rails.png +0 -0
- data/public/avatars/User/2/small_rails.png +0 -0
- data/public/avatars/User/2/thumb_rails.png +0 -0
- data/public/avatars/User/3/large_rails.png +0 -0
- data/public/avatars/User/3/medium_rails.png +0 -0
- data/public/avatars/User/3/original_rails.png +0 -0
- data/public/avatars/User/3/small_rails.png +0 -0
- data/public/avatars/User/3/thumb_rails.png +0 -0
- data/public/avatars/User/4/large_rails.png +0 -0
- data/public/avatars/User/4/medium_rails.png +0 -0
- data/public/avatars/User/4/original_rails.png +0 -0
- data/public/avatars/User/4/small_rails.png +0 -0
- data/public/avatars/User/4/thumb_rails.png +0 -0
- data/public/avatars/User/6/large_rails.png +0 -0
- data/public/avatars/User/6/medium_rails.png +0 -0
- data/public/avatars/User/6/original_rails.png +0 -0
- data/public/avatars/User/6/small_rails.png +0 -0
- data/public/avatars/User/6/thumb_rails.png +0 -0
- data/public/avatars/User/7/large_rails.png +0 -0
- data/public/avatars/User/7/medium_rails.png +0 -0
- data/public/avatars/User/7/original_rails.png +0 -0
- data/public/avatars/User/7/small_rails.png +0 -0
- data/public/avatars/User/7/thumb_rails.png +0 -0
- metadata +73 -288
- data/.docker/nginx/sites-enabled/ffcrm.conf +0 -8
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/rubocop-analysis.yml +0 -40
- data/.github/workflows/ruby.yml +0 -52
- data/.gitignore +0 -39
- data/.rubocop.yml +0 -73
- data/.rubocop_todo.yml +0 -286
- data/.teatro.yml +0 -3
- data/.travis.yml +0 -60
- data/CONTRIBUTORS.md +0 -135
- data/Capfile +0 -27
- data/Dockerfile +0 -51
- data/Gemfile +0 -106
- data/Gemfile.lock +0 -529
- data/Guardfile +0 -26
- data/Procfile +0 -1
- data/SECURITY.md +0 -11
- data/Vagrantfile +0 -92
- data/config/initializers/new_framework_defaults_6_0.rb +0 -46
- data/custom_plan.rb +0 -11
- data/docker-compose.yml +0 -27
- data/fat_free_crm.gemspec +0 -62
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/.gitkeep~master +0 -0
- data/script/rails +0 -8
- data/spec/controllers/admin/groups_controller_spec.rb +0 -11
- data/spec/controllers/admin/users_controller_spec.rb +0 -251
- data/spec/controllers/applications_controller_spec.rb +0 -43
- data/spec/controllers/comments_controller_spec.rb +0 -195
- data/spec/controllers/emails_controller_spec.rb +0 -37
- data/spec/controllers/entities/accounts_controller_spec.rb +0 -607
- data/spec/controllers/entities/campaigns_controller_spec.rb +0 -645
- data/spec/controllers/entities/contacts_controller_spec.rb +0 -705
- data/spec/controllers/entities/leads_controller_spec.rb +0 -1009
- data/spec/controllers/entities/opportunities_controller_spec.rb +0 -904
- data/spec/controllers/entities_controller_spec.rb +0 -47
- data/spec/controllers/home_controller_spec.rb +0 -235
- data/spec/controllers/lists_controller_spec.rb +0 -11
- data/spec/controllers/tasks_controller_spec.rb +0 -517
- data/spec/controllers/users_controller_spec.rb +0 -375
- data/spec/factories/account_factories.rb +0 -40
- data/spec/factories/campaign_factories.rb +0 -30
- data/spec/factories/contact_factories.rb +0 -45
- data/spec/factories/field_factories.rb +0 -40
- data/spec/factories/lead_factories.rb +0 -36
- data/spec/factories/list_factories.rb +0 -13
- data/spec/factories/opportunity_factories.rb +0 -39
- data/spec/factories/sequences.rb +0 -32
- data/spec/factories/setting_factories.rb +0 -15
- data/spec/factories/shared_factories.rb +0 -70
- data/spec/factories/subscription_factories.rb +0 -13
- data/spec/factories/tag_factories.rb +0 -12
- data/spec/factories/task_factories.rb +0 -29
- data/spec/factories/user_factories.rb +0 -66
- data/spec/features/acceptance_helper.rb +0 -11
- data/spec/features/accounts_spec.rb +0 -126
- data/spec/features/admin/groups_spec.rb +0 -31
- data/spec/features/admin/users_spec.rb +0 -40
- data/spec/features/campaigns_spec.rb +0 -104
- data/spec/features/contacts_spec.rb +0 -134
- data/spec/features/dashboard_spec.rb +0 -67
- data/spec/features/devise/sign_in_spec.rb +0 -58
- data/spec/features/devise/sign_up_spec.rb +0 -36
- data/spec/features/leads_spec.rb +0 -138
- data/spec/features/opportunities_overview_spec.rb +0 -88
- data/spec/features/opportunities_spec.rb +0 -132
- data/spec/features/support/autocomlete_helper.rb +0 -17
- data/spec/features/support/browser.rb +0 -28
- data/spec/features/support/headless.rb +0 -19
- data/spec/features/support/paths.rb +0 -48
- data/spec/features/support/selector_helpers.rb +0 -36
- data/spec/features/tasks_spec.rb +0 -94
- data/spec/helpers/accounts_helper_spec.rb +0 -73
- data/spec/helpers/admin/field_groups_helper_spec.rb +0 -20
- data/spec/helpers/admin/plugins_helper_spec.rb +0 -11
- data/spec/helpers/admin/settings_helper_spec.rb +0 -11
- data/spec/helpers/admin/users_helper_spec.rb +0 -11
- data/spec/helpers/application_helper_spec.rb +0 -86
- data/spec/helpers/authentications_helper_spec.rb +0 -16
- data/spec/helpers/campaigns_helper_spec.rb +0 -16
- data/spec/helpers/comments_helper_spec.rb +0 -16
- data/spec/helpers/contacts_helper_spec.rb +0 -16
- data/spec/helpers/emails_helper_spec.rb +0 -11
- data/spec/helpers/fields_helper_spec.rb +0 -12
- data/spec/helpers/groups_helper_spec.rb +0 -21
- data/spec/helpers/home_helper_spec.rb +0 -16
- data/spec/helpers/leads_helper_spec.rb +0 -16
- data/spec/helpers/lists_helper_spec.rb +0 -21
- data/spec/helpers/opportunities_helper_spec.rb +0 -16
- data/spec/helpers/passwords_helper_spec.rb +0 -16
- data/spec/helpers/tasks_helper_spec.rb +0 -20
- data/spec/helpers/users_helper_spec.rb +0 -39
- data/spec/lib/comment_extensions_spec.rb +0 -42
- data/spec/lib/core_ext/string_spec.rb +0 -23
- data/spec/lib/errors_spec.rb +0 -32
- data/spec/lib/fields_spec.rb +0 -101
- data/spec/lib/mail_processor/base_spec.rb +0 -169
- data/spec/lib/mail_processor/comment_replies_spec.rb +0 -70
- data/spec/lib/mail_processor/dropbox_spec.rb +0 -306
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +0 -173
- data/spec/lib/permissions_spec.rb +0 -155
- data/spec/lib/secret_token_generator_spec.rb +0 -69
- data/spec/lib/view_factory_spec.rb +0 -69
- data/spec/mailers/devise_mailer_spec.rb +0 -35
- data/spec/mailers/subscription_mailer_spec.rb +0 -48
- data/spec/mailers/user_mailer_spec.rb +0 -115
- data/spec/models/entities/account_contact_spec.rb +0 -34
- data/spec/models/entities/account_opportunity_spec.rb +0 -34
- data/spec/models/entities/account_spec.rb +0 -206
- data/spec/models/entities/campaign_spec.rb +0 -131
- data/spec/models/entities/contact_opportunity_spec.rb +0 -34
- data/spec/models/entities/contact_spec.rb +0 -314
- data/spec/models/entities/lead_spec.rb +0 -102
- data/spec/models/entities/opportunity_spec.rb +0 -299
- data/spec/models/fields/custom_field_date_pair_spec.rb +0 -92
- data/spec/models/fields/custom_field_pair_spec.rb +0 -76
- data/spec/models/fields/custom_field_spec.rb +0 -129
- data/spec/models/fields/field_group_spec.rb +0 -29
- data/spec/models/fields/field_spec.rb +0 -69
- data/spec/models/list_spec.rb +0 -19
- data/spec/models/observers/entity_observer_spec.rb +0 -74
- data/spec/models/polymorphic/address_spec.rb +0 -34
- data/spec/models/polymorphic/avatar_spec.rb +0 -46
- data/spec/models/polymorphic/comment_spec.rb +0 -45
- data/spec/models/polymorphic/email_spec.rb +0 -53
- data/spec/models/polymorphic/task_spec.rb +0 -395
- data/spec/models/polymorphic/version_spec.rb +0 -241
- data/spec/models/setting_spec.rb +0 -77
- data/spec/models/users/abilities/user_ability_spec.rb +0 -70
- data/spec/models/users/group_spec.rb +0 -11
- data/spec/models/users/permission_spec.rb +0 -58
- data/spec/models/users/preference_spec.rb +0 -71
- data/spec/models/users/user_spec.rb +0 -238
- data/spec/routing/accounts_routing_spec.rb +0 -60
- data/spec/routing/admin/users_routing_spec.rb +0 -40
- data/spec/routing/campaigns_routing_spec.rb +0 -64
- data/spec/routing/comments_routing_spec.rb +0 -32
- data/spec/routing/contacts_routing_spec.rb +0 -60
- data/spec/routing/emails_routing_spec.rb +0 -40
- data/spec/routing/leads_routing_spec.rb +0 -88
- data/spec/routing/opportunities_routing_spec.rb +0 -64
- data/spec/routing/tasks_routing_spec.rb +0 -68
- data/spec/routing/users_routing_spec.rb +0 -106
- data/spec/shared/controllers.rb +0 -99
- data/spec/shared/models.rb +0 -141
- data/spec/spec_helper.rb +0 -117
- data/spec/support/assert_select.rb +0 -167
- data/spec/support/devise_helpers.rb +0 -28
- data/spec/support/feature_helpers.rb +0 -32
- data/spec/support/macros.rb +0 -49
- data/spec/support/mail_processor_mocks.rb +0 -37
- data/spec/support/uploaded_file.rb +0 -10
- data/spec/views/accounts/_edit.haml_spec.rb +0 -43
- data/spec/views/accounts/_new.haml_spec.rb +0 -42
- data/spec/views/accounts/create.js.haml_spec.rb +0 -52
- data/spec/views/accounts/destroy.js.haml_spec.rb +0 -34
- data/spec/views/accounts/edit.js.haml_spec.rb +0 -66
- data/spec/views/accounts/index.haml_spec.rb +0 -43
- data/spec/views/accounts/index.js.haml_spec.rb +0 -34
- data/spec/views/accounts/new.js.haml_spec.rb +0 -44
- data/spec/views/accounts/show.haml_spec.rb +0 -38
- data/spec/views/accounts/update.js.haml_spec.rb +0 -93
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -30
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +0 -31
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +0 -24
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +0 -25
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -29
- data/spec/views/admin/users/_create.haml_spec.rb +0 -23
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -41
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -47
- data/spec/views/admin/users/edit.js.haml_spec.rb +0 -44
- data/spec/views/admin/users/index.haml_spec.rb +0 -22
- data/spec/views/admin/users/index.js.haml_spec.rb +0 -26
- data/spec/views/admin/users/new.js.haml_spec.rb +0 -34
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/show.haml_spec.rb +0 -18
- data/spec/views/admin/users/suspend.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/update.js.haml_spec.rb +0 -37
- data/spec/views/application/auto_complete.haml_spec.rb +0 -48
- data/spec/views/campaigns/_edit.haml_spec.rb +0 -44
- data/spec/views/campaigns/_new.haml_spec.rb +0 -41
- data/spec/views/campaigns/create.js.haml_spec.rb +0 -49
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -31
- data/spec/views/campaigns/edit.js.haml_spec.rb +0 -66
- data/spec/views/campaigns/index.haml_spec.rb +0 -37
- data/spec/views/campaigns/index.js.haml_spec.rb +0 -34
- data/spec/views/campaigns/new.js.haml_spec.rb +0 -50
- data/spec/views/campaigns/show.haml_spec.rb +0 -38
- data/spec/views/campaigns/update.js.haml_spec.rb +0 -78
- data/spec/views/comments/edit.js.haml_spec.rb +0 -30
- data/spec/views/contacts/_edit.haml_spec.rb +0 -73
- data/spec/views/contacts/_new.haml_spec.rb +0 -52
- data/spec/views/contacts/create.js.haml_spec.rb +0 -65
- data/spec/views/contacts/destroy.js.haml_spec.rb +0 -45
- data/spec/views/contacts/edit.js.haml_spec.rb +0 -74
- data/spec/views/contacts/index.haml_spec.rb +0 -37
- data/spec/views/contacts/index.js.html_spec.rb +0 -34
- data/spec/views/contacts/new.js.haml_spec.rb +0 -47
- data/spec/views/contacts/show.haml_spec.rb +0 -35
- data/spec/views/contacts/update.js.haml_spec.rb +0 -128
- data/spec/views/home/index.haml_spec.rb +0 -36
- data/spec/views/home/index.js.haml_spec.rb +0 -33
- data/spec/views/home/options.js.haml_spec.rb +0 -53
- data/spec/views/leads/_convert.haml_spec.rb +0 -30
- data/spec/views/leads/_edit.haml_spec.rb +0 -47
- data/spec/views/leads/_new.haml_spec.rb +0 -45
- data/spec/views/leads/_sidebar_show.haml_spec.rb +0 -31
- data/spec/views/leads/convert.js.haml_spec.rb +0 -79
- data/spec/views/leads/create.js.haml_spec.rb +0 -67
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -47
- data/spec/views/leads/edit.js.haml_spec.rb +0 -76
- data/spec/views/leads/index.haml_spec.rb +0 -37
- data/spec/views/leads/index.js.haml_spec.rb +0 -34
- data/spec/views/leads/new.js.haml_spec.rb +0 -47
- data/spec/views/leads/promote.js.haml_spec.rb +0 -135
- data/spec/views/leads/reject.js.haml_spec.rb +0 -45
- data/spec/views/leads/show.haml_spec.rb +0 -32
- data/spec/views/leads/update.js.haml_spec.rb +0 -118
- data/spec/views/opportunities/_edit.haml_spec.rb +0 -70
- data/spec/views/opportunities/_new.haml_spec.rb +0 -51
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -86
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -64
- data/spec/views/opportunities/edit.js.haml_spec.rb +0 -75
- data/spec/views/opportunities/index.haml_spec.rb +0 -38
- data/spec/views/opportunities/index.js.haml_spec.rb +0 -35
- data/spec/views/opportunities/new.js.haml_spec.rb +0 -54
- data/spec/views/opportunities/show.haml_spec.rb +0 -35
- data/spec/views/opportunities/update.js.haml_spec.rb +0 -143
- data/spec/views/tasks/_edit.haml_spec.rb +0 -50
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -67
- data/spec/views/tasks/create.js.haml_spec.rb +0 -119
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -57
- data/spec/views/tasks/edit.js.haml_spec.rb +0 -76
- data/spec/views/tasks/index.haml_spec.rb +0 -46
- data/spec/views/tasks/new.js.haml_spec.rb +0 -49
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -45
- data/spec/views/tasks/update.js.haml_spec.rb +0 -140
- data/spec/views/users/avatar.js.haml_spec.rb +0 -35
- data/spec/views/users/change_password.js.haml_spec.rb +0 -51
- data/spec/views/users/edit.js.haml_spec.rb +0 -35
- data/spec/views/users/password.js.haml_spec.rb +0 -36
- data/spec/views/users/update.js.haml_spec.rb +0 -46
- data/spec/views/users/upload_avatar.js.haml_spec.rb +0 -45
- data/vendor/gems/globby-0.1.2/LICENSE.txt +0 -20
- data/vendor/gems/globby-0.1.2/README.md +0 -65
- data/vendor/gems/globby-0.1.2/Rakefile +0 -9
- data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +0 -90
- data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +0 -18
- data/vendor/gems/globby-0.1.2/lib/globby/result.rb +0 -20
- data/vendor/gems/globby-0.1.2/lib/globby.rb +0 -47
- data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +0 -109
- data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +0 -93
- data/zeus.json +0 -22
- /data/{spec/fixtures/rails.png → public/avatars/User/2/original_rails.png} +0 -0
data/spec/features/tasks_spec.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
|
-
|
10
|
-
feature 'Tasks', '
|
11
|
-
In order to increase keep track of things
|
12
|
-
As a user
|
13
|
-
I want to manage tasks
|
14
|
-
' do
|
15
|
-
before :each do
|
16
|
-
do_login_if_not_already(first_name: 'Bill', last_name: 'Murray')
|
17
|
-
end
|
18
|
-
|
19
|
-
scenario 'should view a list of tasks which are assigned to the logged in user' do
|
20
|
-
4.times { |i| create(:task, name: "Task #{i}", user: @user) }
|
21
|
-
visit tasks_page
|
22
|
-
expect(page).to have_content('Task 0')
|
23
|
-
expect(page).to have_content('Task 1')
|
24
|
-
expect(page).to have_content('Task 2')
|
25
|
-
expect(page).to have_content('Task 3')
|
26
|
-
expect(page).to have_content('Create Task')
|
27
|
-
end
|
28
|
-
|
29
|
-
scenario 'should create a new task', js: true do
|
30
|
-
with_versioning do
|
31
|
-
visit tasks_page
|
32
|
-
expect(page).to have_content('Create Task')
|
33
|
-
click_link 'Create Task'
|
34
|
-
expect(page).to have_selector('#task_name', visible: true)
|
35
|
-
fill_in 'task_name', with: 'Task I Need To Do'
|
36
|
-
select2 'Tomorrow', from: 'Due:'
|
37
|
-
select2 'Myself', from: 'Assign to:'
|
38
|
-
select2 'Call', from: 'Category:'
|
39
|
-
click_button 'Create Task'
|
40
|
-
expect(page).to have_content('Task I Need To Do')
|
41
|
-
|
42
|
-
click_link 'Dashboard'
|
43
|
-
expect(page).to have_content('Bill Murray created task Task I Need To Do')
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
scenario 'creating a task for another user', js: true do
|
48
|
-
create(:user, first_name: 'Another', last_name: 'User')
|
49
|
-
with_versioning do
|
50
|
-
visit tasks_page
|
51
|
-
click_link 'Create Task'
|
52
|
-
expect(page).to have_selector('#task_name', visible: true)
|
53
|
-
fill_in 'task_name', with: 'Task For Someone Else'
|
54
|
-
select2 'Tomorrow', from: 'Due:'
|
55
|
-
select2 'Another User', from: 'Assign to:'
|
56
|
-
select2 'Call', from: 'Category:'
|
57
|
-
click_button 'Create Task'
|
58
|
-
expect(page).to have_content('The task has been created and assigned to Another User')
|
59
|
-
|
60
|
-
click_link 'Tasks'
|
61
|
-
page.uncheck('filters_due_tomorrow')
|
62
|
-
expect(page).not_to have_content('Task For Someone Else')
|
63
|
-
|
64
|
-
click_filter_tab('Assigned')
|
65
|
-
page.check('filters_due_tomorrow')
|
66
|
-
expect(find('#main')).to have_content('Task For Someone Else')
|
67
|
-
expect(find('#main')).to have_content('Another User')
|
68
|
-
|
69
|
-
click_link 'Dashboard'
|
70
|
-
expect(page).to have_content('Bill Murray created task Task For Someone Else')
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
scenario 'should view and edit a task', js: true do
|
75
|
-
create(:task, id: 42, name: 'Example Task', user: @user)
|
76
|
-
with_versioning do
|
77
|
-
visit tasks_page
|
78
|
-
click_edit_for_task_id(42)
|
79
|
-
fill_in 'task_name', with: 'Updated Task'
|
80
|
-
click_button 'Save Task'
|
81
|
-
expect(page).to have_content('Updated Task')
|
82
|
-
click_link 'Dashboard'
|
83
|
-
expect(page).to have_content('Bill Murray updated task Updated Task')
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
scenario 'should delete a task', js: true do
|
88
|
-
create(:task, id: 42, name: 'Outdated Task', user: @user)
|
89
|
-
visit tasks_page
|
90
|
-
click_delete_for_task_id(42)
|
91
|
-
click_link 'Tasks'
|
92
|
-
expect(page).not_to have_content('Outdated Task')
|
93
|
-
end
|
94
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe AccountsHelper do
|
11
|
-
let(:assignee) { create(:user) }
|
12
|
-
# Delete this example and add some real ones or delete this file
|
13
|
-
it "should be included in the object returned by #helper" do
|
14
|
-
included_modules = (class << helper; self; end).send :included_modules
|
15
|
-
expect(included_modules).to include(AccountsHelper)
|
16
|
-
end
|
17
|
-
describe '#display_pipeline' do
|
18
|
-
context 'when the pipeline is zero' do
|
19
|
-
it 'returns "N/A"' do
|
20
|
-
expect(display_value(0)).to eq('N/A')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
context 'when the pipeline is has 300' do
|
24
|
-
it 'returns "$300"' do
|
25
|
-
expect(display_value(300)).to eq('$300')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
describe '#display_won' do
|
30
|
-
context 'when the won is zero' do
|
31
|
-
it 'returns "N/A"' do
|
32
|
-
expect(display_value(0)).to eq('N/A')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
context 'when the won is has 300' do
|
36
|
-
it 'returns "$300"' do
|
37
|
-
expect(display_value(300)).to eq('$300')
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
describe '#display_lost' do
|
42
|
-
context 'when the lost is zero' do
|
43
|
-
it 'returns "N/A"' do
|
44
|
-
expect(display_value(0)).to eq('N/A')
|
45
|
-
end
|
46
|
-
end
|
47
|
-
context 'when the lost is has 300' do
|
48
|
-
it 'returns "$300"' do
|
49
|
-
expect(display_value(300)).to eq('$300')
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
describe '#display_assigned' do
|
54
|
-
context 'when the name is under 16 chars' do
|
55
|
-
it 'returns the name' do
|
56
|
-
@account = create(:account)
|
57
|
-
allow(@account).to receive(:assignee).and_return(assignee)
|
58
|
-
allow(assignee).to receive(:full_name).and_return('Abe Lincoln')
|
59
|
-
allow(@account).to receive(:assigned_to).and_return(1)
|
60
|
-
expect(display_assigned(@account)).to eq('Abe Lincoln')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
context 'when the name is over 16 chars' do
|
64
|
-
it 'returns the truncated name' do
|
65
|
-
@account = create(:account)
|
66
|
-
allow(@account).to receive(:assignee).and_return(assignee)
|
67
|
-
allow(assignee).to receive(:full_name).and_return('Richard Milhouse Nixon')
|
68
|
-
allow(@account).to receive(:assigned_to).and_return(1)
|
69
|
-
expect(display_assigned(@account)).to eq('Richard Milho...')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
9
|
-
|
10
|
-
describe Admin::FieldGroupsHelper do
|
11
|
-
it "should return the correct info text about tag restrictions and classes for groups" do
|
12
|
-
field_group = create(:field_group, klass_name: "Contact", label: "Test Field Group")
|
13
|
-
html = helper.field_group_subtitle(field_group)
|
14
|
-
expect(html).to include("Test Field Group")
|
15
|
-
expect(html).to include("This field group applies to contacts tagged with")
|
16
|
-
field_group.tag = nil
|
17
|
-
field_group.klass_name = "Account"
|
18
|
-
expect(field_group_subtitle(field_group)).to include("This field group applies to all accounts")
|
19
|
-
end
|
20
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
9
|
-
|
10
|
-
describe Admin::PluginsHelper do
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
9
|
-
|
10
|
-
describe Admin::SettingsHelper do
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
9
|
-
|
10
|
-
describe Admin::UsersHelper do
|
11
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe ApplicationHelper do
|
11
|
-
it "should be included in the object returned by #helper" do
|
12
|
-
included_modules = (class << helper; self; end).send :included_modules
|
13
|
-
expect(included_modules).to include(ApplicationHelper)
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "link_to_emails" do
|
17
|
-
it "should add Bcc: if dropbox address is set" do
|
18
|
-
allow(Setting).to receive(:email_dropbox).and_return(address: "drop@example.com")
|
19
|
-
expect(helper.link_to_email("hello@example.com")).to eq('<a title="hello@example.com" href="mailto:hello@example.com?bcc=drop@example.com">hello@example.com</a>')
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should not add Bcc: if dropbox address is not set" do
|
23
|
-
allow(Setting).to receive(:email_dropbox).and_return(address: nil)
|
24
|
-
expect(helper.link_to_email("hello@example.com")).to eq('<a title="hello@example.com" href="mailto:hello@example.com">hello@example.com</a>')
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should truncate long emails" do
|
28
|
-
allow(Setting).to receive(:email_dropbox).and_return(address: nil)
|
29
|
-
expect(helper.link_to_email("hello@example.com", 5)).to eq('<a title="hello@example.com" href="mailto:hello@example.com">he...</a>')
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should escape HTML entities" do
|
33
|
-
allow(Setting).to receive(:email_dropbox).and_return(address: 'dr&op@example.com')
|
34
|
-
expect(helper.link_to_email("hell&o@example.com")).to eq('<a title="hell&o@example.com" href="mailto:hell&o@example.com?bcc=dr&op@example.com">hell&o@example.com</a>')
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
it "link_to_discard" do
|
39
|
-
lead = create(:lead)
|
40
|
-
allow(controller.request).to receive(:fullpath).and_return("http://www.example.com/leads/#{lead.id}")
|
41
|
-
|
42
|
-
link = helper.link_to_discard(lead)
|
43
|
-
expect(link).to match(%r{leads/#{lead.id}/discard})
|
44
|
-
expect(link).to match(/attachment=Lead&attachment_id=#{lead.id}/)
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "shown_on_landing_page?" do
|
48
|
-
it "should return true for Ajax request made from the asset landing page" do
|
49
|
-
allow(controller.request).to receive(:xhr?).and_return(true)
|
50
|
-
allow(controller.request).to receive(:referer).and_return("http://www.example.com/leads/123")
|
51
|
-
expect(helper.shown_on_landing_page?).to eq(true)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should return true for regular request to display asset landing page" do
|
55
|
-
allow(controller.request).to receive(:xhr?).and_return(false)
|
56
|
-
allow(controller.request).to receive(:fullpath).and_return("http://www.example.com/leads/123")
|
57
|
-
expect(helper.shown_on_landing_page?).to eq(true)
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should return false for Ajax request made from page other than the asset landing page" do
|
61
|
-
allow(controller.request).to receive(:xhr?).and_return(true)
|
62
|
-
allow(controller.request).to receive(:referer).and_return("http://www.example.com/leads")
|
63
|
-
expect(helper.shown_on_landing_page?).to eq(false)
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should return false for regular request to display page other than asset landing page" do
|
67
|
-
allow(controller.request).to receive(:xhr?).and_return(false)
|
68
|
-
allow(controller.request).to receive(:fullpath).and_return("http://www.example.com/leads")
|
69
|
-
expect(helper.shown_on_landing_page?).to eq(false)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "current_view_name" do
|
74
|
-
before(:each) do
|
75
|
-
@user = mock_model(User)
|
76
|
-
allow(helper).to receive(:current_user).and_return(@user)
|
77
|
-
allow(controller).to receive(:action_name).and_return('show')
|
78
|
-
allow(controller).to receive(:controller_name).and_return('contacts')
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should return the contact 'show' outline stored in the user preferences" do
|
82
|
-
expect(@user).to receive(:pref).and_return(contacts_show_view: 'long')
|
83
|
-
expect(helper.send(:current_view_name)).to eq('long')
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe AuthenticationsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(AuthenticationsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe CampaignsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(CampaignsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe CommentsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(CommentsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe ContactsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(ContactsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe EmailsHelper do # Helper methods can be called directly in the examples (it blocks)
|
11
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
include FieldsHelper
|
10
|
-
|
11
|
-
describe FieldsHelper do
|
12
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require 'spec_helper'
|
9
|
-
|
10
|
-
# Specs in this file have access to a helper object that includes
|
11
|
-
# the GroupsHelper. For example:
|
12
|
-
#
|
13
|
-
# describe GroupsHelper do
|
14
|
-
# describe "string concat" do
|
15
|
-
# it "concats two strings with spaces" do
|
16
|
-
# helper.concat_strings("this","that").should == "this that"
|
17
|
-
# end
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
describe GroupsHelper do
|
21
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe HomeHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(HomeHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe LeadsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(LeadsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require 'spec_helper'
|
9
|
-
|
10
|
-
# Specs in this file have access to a helper object that includes
|
11
|
-
# the ListsHelper. For example:
|
12
|
-
#
|
13
|
-
# describe ListsHelper do
|
14
|
-
# describe "string concat" do
|
15
|
-
# it "concats two strings with spaces" do
|
16
|
-
# helper.concat_strings("this","that").should == "this that"
|
17
|
-
# end
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
describe ListsHelper do
|
21
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe OpportunitiesHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(OpportunitiesHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe PasswordsHelper do
|
11
|
-
# Delete this example and add some real ones or delete this file
|
12
|
-
it "should be included in the object returned by #helper" do
|
13
|
-
included_modules = (class << helper; self; end).send :included_modules
|
14
|
-
expect(included_modules).to include(PasswordsHelper)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe TasksHelper do
|
11
|
-
describe "responding with generated links" do
|
12
|
-
before do
|
13
|
-
@task = create(:task)
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should render link to uncomplete of a task" do
|
17
|
-
expect(link_to_task_uncomplete(@task, nil)).to include(t(:task_uncomplete))
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe UsersHelper do
|
11
|
-
let(:myself) { create(:user, id: 54) }
|
12
|
-
let(:user1) { create(:user, id: 60, first_name: 'Bob', last_name: "Hope") }
|
13
|
-
let(:user2) { create(:user, id: 75, first_name: 'Billy', last_name: "Joel") }
|
14
|
-
|
15
|
-
describe "user_options_for_select" do
|
16
|
-
it "includes 'myself'" do
|
17
|
-
expect(user_options_for_select([user1, user2], myself)).to include(["Myself", 54])
|
18
|
-
end
|
19
|
-
|
20
|
-
it "includes other users" do
|
21
|
-
expect(user_options_for_select([user1, user2], myself)).to include(["Bob Hope", 60], ["Billy Joel", 75])
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "user_select" do
|
26
|
-
it "includes blank option" do
|
27
|
-
expect(user_select(:lead, [user1, user2], myself)).to match(%r{<option value="">Unassigned</option>})
|
28
|
-
end
|
29
|
-
|
30
|
-
it "includes myself" do
|
31
|
-
expect(user_select(:lead, [user1, user2], myself)).to match(%r{<option value="54">Myself</option>})
|
32
|
-
end
|
33
|
-
|
34
|
-
it "includes other users" do
|
35
|
-
expect(user_select(:lead, [user1, user2], myself)).to match(%r{<option value="60">Bob Hope</option>})
|
36
|
-
expect(user_select(:lead, [user1, user2], myself)).to match(%r{<option value="75">Billy Joel</option>})
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
9
|
-
|
10
|
-
describe FatFreeCRM::CommentExtensions do
|
11
|
-
describe "add_comment_by_user" do
|
12
|
-
let(:user) { create(:user) }
|
13
|
-
|
14
|
-
before do
|
15
|
-
ActiveRecord::Base.connection.create_table(:commentable_entities) do |t|
|
16
|
-
t.string :subscribed_users
|
17
|
-
end
|
18
|
-
|
19
|
-
class CommentableEntity < ActiveRecord::Base
|
20
|
-
serialize :subscribed_users, Set
|
21
|
-
acts_as_commentable
|
22
|
-
uses_comment_extensions
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
ActiveRecord::Base.connection.drop_table(:commentable_entities)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should create a comment for user" do
|
31
|
-
entity = CommentableEntity.create
|
32
|
-
entity.add_comment_by_user("I will handle this one", user)
|
33
|
-
expect(entity.reload.comments.map(&:comment)).to include("I will handle this one")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should not create a comment if body is blank" do
|
37
|
-
entity = CommentableEntity.create
|
38
|
-
entity.add_comment_by_user("", user)
|
39
|
-
expect(entity.reload.comments).to be_empty
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require "fat_free_crm/core_ext/string"
|
9
|
-
|
10
|
-
describe "String" do
|
11
|
-
it "should generate all possible combinations of first and last name from a query" do
|
12
|
-
expected = [
|
13
|
-
["Stephanie", "Man Chi Lo"],
|
14
|
-
["Stephanie Man", "Chi Lo"],
|
15
|
-
["Stephanie Man Chi", "Lo"],
|
16
|
-
["Lo", "Stephanie Man Chi"],
|
17
|
-
["Chi Lo", "Stephanie Man"],
|
18
|
-
["Man Chi Lo", "Stephanie"]
|
19
|
-
]
|
20
|
-
result = "Stephanie Man Chi Lo".name_permutations
|
21
|
-
expect(result.sort).to eq(expected.sort)
|
22
|
-
end
|
23
|
-
end
|