fat_free_crm 0.20.1 → 0.21.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/manifest.js +3 -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/polymorphic/avatar.rb +1 -30
- data/app/models/polymorphic/task.rb +1 -0
- data/app/views/home/index.xls.builder +1 -0
- data/app/views/shared/_address.html.haml +1 -1
- data/config/application.rb +13 -0
- data/config/environments/development.rb +3 -0
- data/config/puma.rb +2 -2
- data/config/storage.yml +34 -0
- 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 +91 -0
- data/db/schema.rb +65 -35
- data/db/seeds/fields.rb +7 -21
- data/lib/development_tasks/license.rake +10 -10
- 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/version.rb +3 -3
- metadata +16 -279
- 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/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/fixtures/rails.png +0 -0
- 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
@@ -1,173 +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
|
-
DROPBOX_EMAILS = {
|
9
|
-
plain: <<~EMAIL,
|
10
|
-
From: Aaron Assembler <aaron@example.com>
|
11
|
-
To: Ben Bootloader <ben@example.com>
|
12
|
-
Subject: Hi there
|
13
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
14
|
-
Message-ID: <1234@local.machine.example>
|
15
|
-
Content-Type: text/plain
|
16
|
-
|
17
|
-
#{FFaker::Lorem.paragraph}
|
18
|
-
|
19
|
-
Aaron
|
20
|
-
EMAIL
|
21
|
-
|
22
|
-
html: <<~EMAIL,
|
23
|
-
From: Aaron Assembler <aaron@example.com>
|
24
|
-
To: Ben Bootloader <ben@example.com>
|
25
|
-
Subject: Hi there
|
26
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
27
|
-
Message-ID: <1234@local.machine.example>
|
28
|
-
Content-Type: text/html
|
29
|
-
|
30
|
-
<html>
|
31
|
-
<head></head>
|
32
|
-
<body>
|
33
|
-
<p>#{FFaker::Lorem.paragraph}</p>
|
34
|
-
<p>Aaron</p>
|
35
|
-
</body>
|
36
|
-
</html>
|
37
|
-
EMAIL
|
38
|
-
|
39
|
-
first_line: <<~EMAIL,
|
40
|
-
From: Aaron Assembler <aaron@example.com>
|
41
|
-
To: Ben Bootloader <ben@example.com>
|
42
|
-
Subject: Hi there
|
43
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
44
|
-
Message-ID: <1234@local.machine.example>
|
45
|
-
Content-Type: text/plain
|
46
|
-
|
47
|
-
.campaign Got milk
|
48
|
-
#{FFaker::Lorem.paragraph}
|
49
|
-
|
50
|
-
Aaron
|
51
|
-
EMAIL
|
52
|
-
|
53
|
-
first_line_lead: <<~EMAIL,
|
54
|
-
From: Aaron Assembler <aaron@example.com>
|
55
|
-
To: Ben Bootloader <ben@example.com>
|
56
|
-
Subject: Hi there
|
57
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
58
|
-
Message-ID: <1234@local.machine.example>
|
59
|
-
Content-Type: text/plain
|
60
|
-
|
61
|
-
.lead Cindy Cluster
|
62
|
-
#{FFaker::Lorem.paragraph}
|
63
|
-
|
64
|
-
Aaron
|
65
|
-
EMAIL
|
66
|
-
|
67
|
-
first_line_contact: <<~EMAIL,
|
68
|
-
From: Aaron Assembler <aaron@example.com>
|
69
|
-
To: Ben Bootloader <ben@example.com>
|
70
|
-
Subject: Hi there
|
71
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
72
|
-
Message-ID: <1234@local.machine.example>
|
73
|
-
Content-Type: text/plain
|
74
|
-
|
75
|
-
.contact Cindy Cluster
|
76
|
-
#{FFaker::Lorem.paragraph}
|
77
|
-
|
78
|
-
Aaron
|
79
|
-
EMAIL
|
80
|
-
|
81
|
-
forwarded: <<~EMAIL,
|
82
|
-
From: Aaron Assembler <aaron@example.com>
|
83
|
-
To: dropbox@example.com
|
84
|
-
Subject: Hi there
|
85
|
-
Date: Mon, 26 May 2003 11:22:33 -0600
|
86
|
-
Message-ID: <1234@local.machine.example>
|
87
|
-
Content-Type: text/plain
|
88
|
-
|
89
|
-
---------- Forwarded message ----------
|
90
|
-
From: Ben Bootloader <ben@example.com>
|
91
|
-
Date: Sun, Mar 22, 2009 at 3:28 PM
|
92
|
-
Subject: Fwd:
|
93
|
-
To: Cindy Cluster <cindy@example.com>
|
94
|
-
|
95
|
-
#{FFaker::Lorem.paragraph}
|
96
|
-
|
97
|
-
Ben
|
98
|
-
EMAIL
|
99
|
-
|
100
|
-
multipart: <<~EMAIL
|
101
|
-
From: Aaron Assembler <aaron@example.com>
|
102
|
-
To: Ben Bootloader <ben@example.com>
|
103
|
-
Subject: Hi there
|
104
|
-
Date: Fri, 30 Mar 2012 15:04:05 +0800
|
105
|
-
Message-ID: <1234@local.machine.example>
|
106
|
-
Content-Type: multipart/related;
|
107
|
-
boundary="_006_200DA2FF7EAFC04BAD979DB9CF293BB365151E88CLEARWATERtesta_";
|
108
|
-
type="text/html"
|
109
|
-
|
110
|
-
--_006_200DA2FF7EAFC04BAD979DB9CF293BB365151E88CLEARWATERtesta_
|
111
|
-
Content-Type: text/html; charset="iso-8859-1"
|
112
|
-
Content-Transfer-Encoding: quoted-printable
|
113
|
-
|
114
|
-
<html>
|
115
|
-
<head>
|
116
|
-
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
|
117
|
-
1">
|
118
|
-
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
|
119
|
-
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
|
120
|
-
o\:* {behavior:url(#default#VML);}
|
121
|
-
w\:* {behavior:url(#default#VML);}
|
122
|
-
.shape {behavior:url(#default#VML);}
|
123
|
-
</style><![endif]--><style><!--
|
124
|
-
/* Font Definitions */
|
125
|
-
@font-face
|
126
|
-
{font-family:Calibri;
|
127
|
-
panose-1:2 15 5 2 2 2 4 3 2 4;}
|
128
|
-
/* Style Definitions */
|
129
|
-
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
130
|
-
{margin:0in;
|
131
|
-
margin-bottom:.0001pt;
|
132
|
-
font-size:11.0pt;
|
133
|
-
font-family:"Calibri","sans-serif";}
|
134
|
-
div.WordSection1
|
135
|
-
{page:WordSection1;}
|
136
|
-
--></style><!--[if gte mso 9]><xml>
|
137
|
-
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
|
138
|
-
</xml><![endif]--><!--[if gte mso 9]><xml>
|
139
|
-
<o:shapelayout v:ext=3D"edit">
|
140
|
-
<o:idmap v:ext=3D"edit" data=3D"1" />
|
141
|
-
</o:shapelayout></xml><![endif]-->
|
142
|
-
</head>
|
143
|
-
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
|
144
|
-
<div class=3D"WordSection1">
|
145
|
-
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>Hello,</o:p></spa=
|
146
|
-
n></p>
|
147
|
-
</div>
|
148
|
-
</body>
|
149
|
-
</html>
|
150
|
-
|
151
|
-
--_006_200DA2FF7EAFC04BAD979DB9CF293BB365151E88CLEARWATERtesta_
|
152
|
-
Content-Type: image/gif; name="image007.gif"
|
153
|
-
Content-Description: image007.gif
|
154
|
-
Content-Disposition: inline; filename="image007.gif"; size=633;
|
155
|
-
creation-date="Fri, 30 Mar 2012 07:04:05 GMT";
|
156
|
-
modification-date="Fri, 30 Mar 2012 07:04:05 GMT"
|
157
|
-
Content-ID:<image007.gif@01CD0DBA.FB4A2170>
|
158
|
-
Content-Transfer-Encoding: base64
|
159
|
-
|
160
|
-
R0lGODlhXQASALMAAIiIiBESESIjIt3d3VVWVURFRLu7u2ZnZpmZmaqqqjM0M3d4d+7u7gABAMzM
|
161
|
-
zP///yH5BAAAAAAALAAAAABdABIAAAT/8MlJ63Q2683tAAvTjdKwAFqyJBLQoGQsP0MgKGy3PuDi
|
162
|
-
/4tHotHAWASN4MNRGMyeHYKAkshZGMnHQcFt3LhCr5IqhppH4IliXMGy3eRFQEQpELIS+oRR9Rgl
|
163
|
-
VU4VBgmCFwkGFAxcdIshent4eZJhBi8Ulgh4QzkMd0QBElwLRCJyRA0HewqoiUsFqAIYQ6g4qKVt
|
164
|
-
lHATQ55TEwQFu5wSBQEADB+iATgIWscMDC6qDwWyDAhONQUODA4KAQN8XIjjBH25b5S9mRIOL8MN
|
165
|
-
LC5WanPulxOkGAIEFVJ6GATw9yCNKDaKdK1rIKJAAQkHpsRjISWDQReGHliiCG+CAGoTzAooEDVS
|
166
|
-
DcJI6tj0CtPt2IOJBUtWMEgKEhYUnhq43KUvVEwKazTwfLmQTj8A92CKtCgTIyZ5F+6gCACyWEmD
|
167
|
-
BU9OSkmGDlIF1GC6cAVUpiUYEkhlfCAgiLWAVEkCJXhFoUqGEwIU2QoI6qIACJIpwXoAmrQASg50
|
168
|
-
G4LCQQBu3gjc+6lGwIA/KBPe1bOALkwasIj8wqoFFWKPqEA6QEKEmxqZQvTi1UxbEQebFRwkwJxh
|
169
|
-
ADpMhSwQ4p2Bz9o8V84oX868ufPn0KNLn64hAgA7
|
170
|
-
|
171
|
-
--_006_200DA2FF7EAFC04BAD979DB9CF293BB365151E88CLEARWATERtesta_--
|
172
|
-
EMAIL
|
173
|
-
}
|
@@ -1,155 +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::Permissions do
|
11
|
-
before do
|
12
|
-
ActiveRecord::Base.connection.create_table(:user_with_permissions) do |t|
|
13
|
-
t.string :access
|
14
|
-
end
|
15
|
-
class UserWithPermission < ActiveRecord::Base
|
16
|
-
uses_user_permissions
|
17
|
-
end
|
18
|
-
end
|
19
|
-
after do
|
20
|
-
ActiveRecord::Base.connection.drop_table(:user_with_permissions)
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "initialization" do
|
24
|
-
it "should add 'has_many permissions' to the model" do
|
25
|
-
entity = UserWithPermission.new
|
26
|
-
expect(entity).to respond_to(:permissions)
|
27
|
-
end
|
28
|
-
it "should add scope called 'my'" do
|
29
|
-
expect(UserWithPermission).to respond_to(:my)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "user_ids" do
|
34
|
-
before(:each) do
|
35
|
-
@entity = UserWithPermission.create(access: "Shared")
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should assign permissions to the object" do
|
39
|
-
expect(@entity.permissions.size).to eq(0)
|
40
|
-
@entity.user_ids = %w[1 2 3]
|
41
|
-
@entity.save!
|
42
|
-
expect(@entity.permissions.where(user_id: [1, 2, 3]).size).to eq(3)
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should handle [] permissions" do
|
46
|
-
@entity.user_ids = []
|
47
|
-
@entity.save!
|
48
|
-
expect(@entity.permissions.size).to eq(0)
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should replace existing permissions" do
|
52
|
-
@entity.permissions << create(:permission, user_id: 1, asset: @entity)
|
53
|
-
@entity.permissions << create(:permission, user_id: 2, asset: @entity)
|
54
|
-
@entity.user_ids = %w[2 3]
|
55
|
-
@entity.save!
|
56
|
-
expect(@entity.permissions.size).to eq(2)
|
57
|
-
expect(@entity.permissions.where(user_id: [1]).size).to eq(0)
|
58
|
-
expect(@entity.permissions.where(user_id: [2]).size).to eq(1)
|
59
|
-
expect(@entity.permissions.where(user_id: [3]).size).to eq(1)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "group_ids" do
|
64
|
-
before(:each) do
|
65
|
-
@entity = UserWithPermission.create(access: "Shared")
|
66
|
-
end
|
67
|
-
it "should assign permissions to the object" do
|
68
|
-
expect(@entity.permissions.size).to eq(0)
|
69
|
-
@entity.group_ids = %w[1 2 3]
|
70
|
-
@entity.save!
|
71
|
-
expect(@entity.permissions.where(group_id: [1, 2, 3]).size).to eq(3)
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should handle [] permissions" do
|
75
|
-
@entity.group_ids = []
|
76
|
-
@entity.save!
|
77
|
-
expect(@entity.permissions.size).to eq(0)
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should replace existing permissions" do
|
81
|
-
@entity.permissions << build(:permission, group_id: 1, user_id: nil, asset: @entity)
|
82
|
-
@entity.permissions << build(:permission, group_id: 2, user_id: nil, asset: @entity)
|
83
|
-
expect(@entity.permissions.size).to eq(2)
|
84
|
-
@entity.group_ids = ['3']
|
85
|
-
@entity.save!
|
86
|
-
expect(@entity.permissions.size).to eq(1)
|
87
|
-
expect(@entity.permissions.where(group_id: [1, 2]).size).to eq(0)
|
88
|
-
expect(@entity.permissions.where(group_id: [3]).size).to eq(1)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe "access" do
|
93
|
-
before(:each) do
|
94
|
-
@entity = UserWithPermission.create
|
95
|
-
end
|
96
|
-
it "should delete all permissions if access is set to Public" do
|
97
|
-
perm = create(:permission, user_id: 1, asset: @entity)
|
98
|
-
expect(perm).to receive(:destroy)
|
99
|
-
expect(Permission).to receive(:where).with(asset_id: @entity.id, asset_type: @entity.class.to_s).and_return([perm])
|
100
|
-
@entity.update_attribute(:access, 'Public')
|
101
|
-
end
|
102
|
-
it "should delete all permissions if access is set to Private" do
|
103
|
-
perm = create(:permission, user_id: 1, asset: @entity)
|
104
|
-
expect(perm).to receive(:destroy)
|
105
|
-
expect(Permission).to receive(:where).with(asset_id: @entity.id, asset_type: @entity.class.to_s).and_return([perm])
|
106
|
-
@entity.update_attribute(:access, 'Private')
|
107
|
-
end
|
108
|
-
it "should not remove permissions if access is set to Shared" do
|
109
|
-
perm = create(:permission, user_id: 1, asset: @entity)
|
110
|
-
expect(perm).not_to receive(:destroy)
|
111
|
-
@entity.permissions << perm
|
112
|
-
expect(Permission).not_to receive(:find_all_by_asset_id)
|
113
|
-
@entity.update_attribute(:access, 'Shared')
|
114
|
-
expect(@entity.permissions.size).to eq(1)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
describe "save_with_model_permissions" do
|
119
|
-
it "should copy permissions from original model" do
|
120
|
-
entity = UserWithPermission.new
|
121
|
-
model = mock_model(Account, access: "Shared", user_ids: [1, 2, 3], group_ids: [4, 5, 6])
|
122
|
-
expect(entity).to receive(:access=).with("Shared")
|
123
|
-
expect(entity).to receive(:user_ids=).with([1, 2, 3])
|
124
|
-
expect(entity).to receive(:group_ids=).with([4, 5, 6])
|
125
|
-
expect(entity).to receive(:save)
|
126
|
-
entity.save_with_model_permissions(model)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
describe 'remove_permissions' do
|
131
|
-
context 'with a new record' do
|
132
|
-
before :each do
|
133
|
-
@entity = UserWithPermission.new
|
134
|
-
end
|
135
|
-
it 'should have no relationships to destroy' do
|
136
|
-
expect(@entity.remove_permissions).to eq []
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
context 'with an existing record' do
|
141
|
-
before :each do
|
142
|
-
@entity = UserWithPermission.create
|
143
|
-
|
144
|
-
@permission1 = Permission.create(user_id: 1, group_id: 1, asset_id: @entity.id, asset_type: 'UserWithPermission')
|
145
|
-
@permission2 = Permission.create(user_id: 1, group_id: 2, asset_id: @entity.id, asset_type: 'UserWithPermission')
|
146
|
-
end
|
147
|
-
it 'should remove the related permissions' do
|
148
|
-
current = Permission.all.count
|
149
|
-
|
150
|
-
expect(@entity.remove_permissions.length).to eq 2
|
151
|
-
expect(Permission.all.count).to eq(current - 2)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2014 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
|
-
|
9
|
-
require 'spec_helper'
|
10
|
-
require 'fat_free_crm/secret_token_generator'
|
11
|
-
|
12
|
-
describe FatFreeCRM::SecretTokenGenerator do
|
13
|
-
let(:token) { 'e5a4b315c062dec4ecb40dabcde84fd6c067cb016a813702d2f4299ad16255c88ed1020bd47fb527e8e5f7052b04be1fbb8e63c043b8fb36f88d3c7d79a68681' }
|
14
|
-
|
15
|
-
describe "setup!" do
|
16
|
-
it "should not generate a new token if one exists" do
|
17
|
-
allow(FatFreeCRM::SecretTokenGenerator).to receive(:token_exists?).and_return(true)
|
18
|
-
expect(FatFreeCRM::SecretTokenGenerator).not_to receive(:new_token!)
|
19
|
-
FatFreeCRM::SecretTokenGenerator.setup!
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should generate a token if none exists" do
|
23
|
-
allow(FatFreeCRM::SecretTokenGenerator).to receive(:token_exists?).and_return(false)
|
24
|
-
expect(FatFreeCRM::SecretTokenGenerator).to receive(:new_token!)
|
25
|
-
FatFreeCRM::SecretTokenGenerator.setup!
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should generate a random token if not persisted" do
|
29
|
-
allow(FatFreeCRM::SecretTokenGenerator).to receive(:token_exists?).and_return(false)
|
30
|
-
allow(FatFreeCRM::SecretTokenGenerator).to receive(:new_token)
|
31
|
-
expect(FatFreeCRM::SecretTokenGenerator).to receive(:generate_token).exactly(:twice)
|
32
|
-
FatFreeCRM::SecretTokenGenerator.setup!
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
describe "token_exists?" do
|
37
|
-
it "should be true" do
|
38
|
-
allow(Setting).to receive(:secret_token).and_return(token)
|
39
|
-
expect(FatFreeCRM::SecretTokenGenerator.send(:token_exists?)).to eql(true)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should be false" do
|
43
|
-
allow(Setting).to receive(:secret_token).and_return(nil)
|
44
|
-
expect(FatFreeCRM::SecretTokenGenerator.send(:token_exists?)).to eql(false)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "token" do
|
49
|
-
it "should delegate to Setting" do
|
50
|
-
expect(Setting).to receive(:secret_token).and_return(token)
|
51
|
-
expect(FatFreeCRM::SecretTokenGenerator.send(:token)).to eql(token)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "new_token!" do
|
56
|
-
it "should generate and set a new token" do
|
57
|
-
expect(FatFreeCRM::SecretTokenGenerator).to receive(:generate_token).and_return(token)
|
58
|
-
expect(Setting).to receive(:secret_token=).with(token)
|
59
|
-
FatFreeCRM::SecretTokenGenerator.send(:new_token!)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "generate_token!" do
|
64
|
-
it "should generate a random token" do
|
65
|
-
expect(SecureRandom).to receive(:hex).with(64).and_return(token)
|
66
|
-
FatFreeCRM::SecretTokenGenerator.send(:generate_token)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,69 +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
|
-
require "fat_free_crm/view_factory"
|
10
|
-
|
11
|
-
describe FatFreeCRM::ViewFactory do
|
12
|
-
before(:each) do
|
13
|
-
FatFreeCRM::ViewFactory.send(:class_variable_set, '@@views', [])
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "initialization" do
|
17
|
-
before(:each) do
|
18
|
-
@view_params = { name: 'brief', title: 'Brief View', icon: 'fa-bars', controllers: ['contacts'], actions: %w[show index] }
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should initialize with required parameters" do
|
22
|
-
view = FatFreeCRM::ViewFactory.new @view_params
|
23
|
-
expect(view.name).to eq('brief')
|
24
|
-
expect(view.title).to eq('Brief View')
|
25
|
-
expect(view.controllers).to include('contacts')
|
26
|
-
expect(view.actions).to include('show')
|
27
|
-
expect(view.actions).to include('index')
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should register view with ViewFactory" do
|
31
|
-
expect(FatFreeCRM::ViewFactory.send(:class_variable_get, '@@views').size).to eq(0)
|
32
|
-
FatFreeCRM::ViewFactory.new @view_params
|
33
|
-
expect(FatFreeCRM::ViewFactory.send(:class_variable_get, '@@views').size).to eq(1)
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should not register the same view twice" do
|
37
|
-
FatFreeCRM::ViewFactory.new @view_params
|
38
|
-
FatFreeCRM::ViewFactory.new @view_params
|
39
|
-
views = FatFreeCRM::ViewFactory.send(:class_variable_get, '@@views')
|
40
|
-
expect(views.size).to eq(1)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "views_for" do
|
45
|
-
before(:each) do
|
46
|
-
@v1 = FatFreeCRM::ViewFactory.new name: 'brief', title: 'Brief View', controllers: ['contacts'], actions: %w[show index]
|
47
|
-
@v2 = FatFreeCRM::ViewFactory.new name: 'long', title: 'Long View', controllers: ['contacts'], actions: ['show']
|
48
|
-
@v3 = FatFreeCRM::ViewFactory.new name: 'full', title: 'Full View', controllers: ['accounts'], actions: ['show']
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should return 'brief' view for ContactsController#index" do
|
52
|
-
expect(FatFreeCRM::ViewFactory.views_for(controller: 'contacts', action: 'index')).to eq([@v1])
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should return 'brief' and 'long' view for ContactsController#show" do
|
56
|
-
views = FatFreeCRM::ViewFactory.views_for(controller: 'contacts', action: 'show')
|
57
|
-
expect(views).to include(@v1)
|
58
|
-
expect(views).to include(@v2)
|
59
|
-
end
|
60
|
-
|
61
|
-
it "should return 'full' view for AccountsController#show" do
|
62
|
-
expect(FatFreeCRM::ViewFactory.views_for(controller: 'accounts', action: 'show')).to eq([@v3])
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should return no views for TasksController#show" do
|
66
|
-
expect(FatFreeCRM::ViewFactory.views_for(controller: 'tasks', action: 'show')).to eq([])
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,35 +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
|
-
describe DeviseMailer do
|
11
|
-
describe "reset_password_instructions" do
|
12
|
-
let(:user) { build(:user, email: "forgot_my_password@example.com") }
|
13
|
-
let(:mail) { DeviseMailer.reset_password_instructions(user, user.reset_password_token) }
|
14
|
-
|
15
|
-
before(:each) do
|
16
|
-
allow(user).to receive(:reset_password_token).and_return("62fe5299b45513f9d22a2e1454f35dd43d62ba50")
|
17
|
-
end
|
18
|
-
|
19
|
-
it "sets fatfree as the sender" do
|
20
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
21
|
-
end
|
22
|
-
|
23
|
-
it "sets user 'forgot_my_password@example.com' as recipient" do
|
24
|
-
expect(mail.to).to eq(["forgot_my_password@example.com"])
|
25
|
-
end
|
26
|
-
|
27
|
-
it "sets the subject" do
|
28
|
-
expect(mail.subject).to eq("Reset password instructions")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "includes password reset link in body" do
|
32
|
-
expect(mail.body.encoded).to have_link('Change my password', href: "http://www.example.com/users/password/edit?reset_password_token=#{user.reset_password_token}")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,48 +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
|
-
describe SubscriptionMailer do
|
11
|
-
describe "comment notification" do
|
12
|
-
let(:user) { build(:user, email: 'notify_me@example.com') }
|
13
|
-
let(:campaign) { build(:campaign, user: user) }
|
14
|
-
let(:account) { build(:account, user: user) }
|
15
|
-
let(:commentable) { build_stubbed(:opportunity, id: 47, name: 'Opportunity name', account: account, campaign: campaign, user: user) }
|
16
|
-
let(:comment) { build(:comment, commentable: commentable, user: user) }
|
17
|
-
let(:mail) { SubscriptionMailer.comment_notification(user, comment) }
|
18
|
-
|
19
|
-
it "sets user 'notify_me@example.com' as recipient" do
|
20
|
-
expect(mail.to).to eq(["notify_me@example.com"])
|
21
|
-
end
|
22
|
-
|
23
|
-
it "sets the subject" do
|
24
|
-
expect(mail.subject).to eq("RE: [opportunity:47] Opportunity name")
|
25
|
-
end
|
26
|
-
|
27
|
-
it "includes link to opportunity in body" do
|
28
|
-
expect(mail.body.encoded).to match('http://www.example.com/opportunities/47')
|
29
|
-
end
|
30
|
-
|
31
|
-
it "uses email defined in settings as the sender" do
|
32
|
-
allow(Setting).to receive(:dig).with(:email_comment_replies, :address).and_return("email_comment_reply@example.com")
|
33
|
-
expect(mail.from).to eql(["email_comment_reply@example.com"])
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should fallback to smtp from address as the sender" do
|
37
|
-
allow(Setting).to receive(:dig).with(:email_comment_replies, :address).and_return("")
|
38
|
-
allow(Setting).to receive(:dig).with(:smtp, :from).and_return("smtp_from@example.com")
|
39
|
-
expect(mail.from).to eql(["smtp_from@example.com"])
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should set default reply-to address if email doesn't exist" do
|
43
|
-
allow(Setting).to receive(:dig).with(:email_comment_replies, :address).and_return("")
|
44
|
-
allow(Setting).to receive(:dig).with(:smtp, :from).and_return("")
|
45
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,115 +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
|
-
describe UserMailer do
|
11
|
-
describe "assigned_entity_notification" do
|
12
|
-
let(:assigner) { build(:user, first_name: "Bob", last_name: "Hope") }
|
13
|
-
let(:assignee) { build(:user, email: "assignee@example.com") }
|
14
|
-
|
15
|
-
context "for an account" do
|
16
|
-
let(:account) { build_stubbed(:account, id: 16, name: 'Ghostbusters', user: assigner, assignee: assignee) }
|
17
|
-
let(:mail) { UserMailer.assigned_entity_notification(account, assigner) }
|
18
|
-
|
19
|
-
it "sets fatfree as the sender" do
|
20
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
21
|
-
end
|
22
|
-
|
23
|
-
it "sets user 'assignee@example.com' as recipient" do
|
24
|
-
expect(mail.to).to eq(["assignee@example.com"])
|
25
|
-
end
|
26
|
-
|
27
|
-
it "sets the subject" do
|
28
|
-
expect(mail.subject).to eq("Fat Free CRM: You have been assigned Ghostbusters Account")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "includes the name of the person who re-assigned the lead in the body" do
|
32
|
-
expect(mail.body.encoded).to match("Bob")
|
33
|
-
end
|
34
|
-
|
35
|
-
it "includes link to the lead in the body" do
|
36
|
-
expect(mail.body.encoded).to match("http://www.example.com/accounts/16")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context "for a contact" do
|
41
|
-
let(:contact) { build_stubbed(:contact, id: 56, first_name: 'Harold', last_name: 'Ramis', user: assigner, assignee: assignee) }
|
42
|
-
let(:mail) { UserMailer.assigned_entity_notification(contact, assigner) }
|
43
|
-
|
44
|
-
it "sets fatfree as the sender" do
|
45
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
46
|
-
end
|
47
|
-
|
48
|
-
it "sets user 'assignee@example.com' as recipient" do
|
49
|
-
expect(mail.to).to eq(["assignee@example.com"])
|
50
|
-
end
|
51
|
-
|
52
|
-
it "sets the subject" do
|
53
|
-
expect(mail.subject).to eq("Fat Free CRM: You have been assigned Harold Ramis Contact")
|
54
|
-
end
|
55
|
-
|
56
|
-
it "includes the name of the person who re-assigned the lead in the body" do
|
57
|
-
expect(mail.body.encoded).to match("Bob")
|
58
|
-
end
|
59
|
-
|
60
|
-
it "includes link to the lead in the body" do
|
61
|
-
expect(mail.body.encoded).to match("http://www.example.com/contacts/56")
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
context "for a lead" do
|
66
|
-
let(:lead) { build_stubbed(:lead, id: 42, first_name: 'Bill', last_name: 'Murray', user: assigner, assignee: assignee) }
|
67
|
-
let(:mail) { UserMailer.assigned_entity_notification(lead, assigner) }
|
68
|
-
|
69
|
-
it "sets fatfree as the sender" do
|
70
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
71
|
-
end
|
72
|
-
|
73
|
-
it "sets user 'assignee@example.com' as recipient" do
|
74
|
-
expect(mail.to).to eq(["assignee@example.com"])
|
75
|
-
end
|
76
|
-
|
77
|
-
it "sets the subject" do
|
78
|
-
expect(mail.subject).to eq("Fat Free CRM: You have been assigned Bill Murray Lead")
|
79
|
-
end
|
80
|
-
|
81
|
-
it "includes the name of the person who re-assigned the lead in the body" do
|
82
|
-
expect(mail.body.encoded).to match("Bob")
|
83
|
-
end
|
84
|
-
|
85
|
-
it "includes link to the lead in the body" do
|
86
|
-
expect(mail.body.encoded).to match("http://www.example.com/leads/42")
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
context "for an opportunity" do
|
91
|
-
let(:opportunity) { create(:opportunity, id: 24, name: 'Big', user: assigner, assignee: assignee) }
|
92
|
-
let(:mail) { UserMailer.assigned_entity_notification(opportunity, assigner) }
|
93
|
-
|
94
|
-
it "sets fatfree as the sender" do
|
95
|
-
expect(mail.from).to eql(["noreply@fatfreecrm.com"])
|
96
|
-
end
|
97
|
-
|
98
|
-
it "sets user 'assignee@example.com' as recipient" do
|
99
|
-
expect(mail.to).to eq(["assignee@example.com"])
|
100
|
-
end
|
101
|
-
|
102
|
-
it "sets the subject" do
|
103
|
-
expect(mail.subject).to eq("Fat Free CRM: You have been assigned Big Opportunity")
|
104
|
-
end
|
105
|
-
|
106
|
-
it "includes the name of the person who re-assigned the lead in the body" do
|
107
|
-
expect(mail.body.encoded).to match("Bob")
|
108
|
-
end
|
109
|
-
|
110
|
-
it "includes link to the lead in the body" do
|
111
|
-
expect(mail.body.encoded).to match("http://www.example.com/opportunities/24")
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|