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,65 +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 "/contacts/create" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "create success" do
|
18
|
-
before do
|
19
|
-
assign(:contact, @contact = build_stubbed(:contact))
|
20
|
-
assign(:contacts, [@contact].paginate)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should hide [Create Contact] form and insert contact partial" do
|
24
|
-
render
|
25
|
-
|
26
|
-
expect(rendered).to include("$('#contacts').prepend('<li class=\\'highlight contact\\' id=\\'contact_#{@contact.id}\\'")
|
27
|
-
expect(rendered).to include(%/$('#contact_#{@contact.id}').effect("highlight"/)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should refresh sidebar when called from contacts index" do
|
31
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
32
|
-
render
|
33
|
-
|
34
|
-
expect(rendered).to include("#sidebar")
|
35
|
-
expect(rendered).to have_text("Recent Items")
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should update pagination when called from contacts index" do
|
39
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
40
|
-
render
|
41
|
-
|
42
|
-
expect(rendered).to include("#paginate")
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should update recently viewed items when called from related asset" do
|
46
|
-
render
|
47
|
-
|
48
|
-
expect(rendered).to include("#recently")
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe "create failure" do
|
53
|
-
it "create (failure): should re-render [create] template in :create_contact div" do
|
54
|
-
assign(:contact, build(:contact, first_name: nil)) # make it invalid
|
55
|
-
@account = build_stubbed(:account)
|
56
|
-
assign(:users, [build_stubbed(:user)])
|
57
|
-
assign(:account, @account)
|
58
|
-
assign(:accounts, [@account])
|
59
|
-
|
60
|
-
render
|
61
|
-
|
62
|
-
expect(rendered).to include("$('#create_contact').html")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,45 +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 "/contacts/destroy" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
assign(:contact, @contact = build_stubbed(:contact))
|
16
|
-
assign(:contacts, [@contact].paginate)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should blind up destroyed contact partial" do
|
20
|
-
render
|
21
|
-
expect(rendered).to include("slideUp")
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should update contacts sidebar when called from contacts index" do
|
25
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
26
|
-
render
|
27
|
-
|
28
|
-
expect(rendered).to include("#sidebar")
|
29
|
-
expect(rendered).to have_text("Recent Items")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should update pagination when called from contacts index" do
|
33
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
34
|
-
render
|
35
|
-
|
36
|
-
expect(rendered).to include("#paginate")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should update recently viewed items when called from related asset" do
|
40
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/123"
|
41
|
-
render
|
42
|
-
|
43
|
-
expect(rendered).to include("#recently")
|
44
|
-
end
|
45
|
-
end
|
@@ -1,74 +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 "/contacts/edit" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
assign(:contact, @contact = build_stubbed(:contact, user: current_user))
|
16
|
-
assign(:users, [current_user])
|
17
|
-
assign(:account, @account = build_stubbed(:account))
|
18
|
-
assign(:accounts, [@account])
|
19
|
-
end
|
20
|
-
|
21
|
-
it "cancel from contact index page: should replace [Edit Contact] form with contact partial" do
|
22
|
-
params[:cancel] = "true"
|
23
|
-
|
24
|
-
render
|
25
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').replaceWith('<li class=\\'highlight contact\\' id=\\'contact_#{@contact.id}\\'")
|
26
|
-
end
|
27
|
-
|
28
|
-
it "cancel from contact landing page: should hide [Edit Contact] form" do
|
29
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts/123"
|
30
|
-
params[:cancel] = "true"
|
31
|
-
|
32
|
-
render
|
33
|
-
expect(rendered).to include("crm.flip_form('edit_contact'")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "edit: should hide previously open [Edit Contact] for and replace it with contact partial" do
|
37
|
-
params[:cancel] = nil
|
38
|
-
assign(:previous, previous = build_stubbed(:contact, user: current_user))
|
39
|
-
|
40
|
-
render
|
41
|
-
expect(rendered).to include("$('#contact_#{previous.id}').replaceWith")
|
42
|
-
end
|
43
|
-
|
44
|
-
it "edit: should hide and remove previously open [Edit Contact] if it's no longer available" do
|
45
|
-
params[:cancel] = nil
|
46
|
-
assign(:previous, previous = 41)
|
47
|
-
|
48
|
-
render
|
49
|
-
expect(rendered).to include("crm.flick('contact_#{previous}', 'remove');")
|
50
|
-
end
|
51
|
-
|
52
|
-
it "edit from contacts index page: should turn off highlight, hide [Create Contact] form, and replace current contact with [Edit Contact] form" do
|
53
|
-
params[:cancel] = nil
|
54
|
-
|
55
|
-
render
|
56
|
-
expect(rendered).to include("crm.highlight_off('contact_#{@contact.id}');")
|
57
|
-
expect(rendered).to include("crm.hide_form('create_contact')")
|
58
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').html")
|
59
|
-
expect(rendered).to include("crm.create_or_select_account(false)")
|
60
|
-
end
|
61
|
-
|
62
|
-
it "edit from contact landing page: should show [Edit Contact] form" do
|
63
|
-
params[:cancel] = "false"
|
64
|
-
|
65
|
-
render
|
66
|
-
expect(rendered).to include("$('#edit_contact').html")
|
67
|
-
expect(rendered).to include("crm.flip_form('edit_contact'")
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should show handle new or existing account for the contact" do
|
71
|
-
render
|
72
|
-
expect(rendered).to include("crm.create_or_select_account(false)")
|
73
|
-
end
|
74
|
-
end
|
@@ -1,37 +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 "/contacts/index" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
view.lookup_context.prefixes << 'entities'
|
15
|
-
assign :per_page, Contact.per_page
|
16
|
-
assign :sort_by, Contact.sort_by
|
17
|
-
assign :ransack_search, Contact.ransack
|
18
|
-
login
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should render a list of contacts if it's not empty" do
|
22
|
-
assign(:contacts, [build_stubbed(:contact)].paginate)
|
23
|
-
|
24
|
-
render
|
25
|
-
expect(view).to render_template(partial: "_contact")
|
26
|
-
expect(view).to render_template(partial: "shared/_paginate_with_per_page")
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should render a message if there're no contacts" do
|
30
|
-
assign(:contacts, [].paginate)
|
31
|
-
|
32
|
-
render
|
33
|
-
expect(view).not_to render_template(partial: "_contact")
|
34
|
-
expect(view).to render_template(partial: "shared/_empty")
|
35
|
-
expect(view).to render_template(partial: "shared/_paginate_with_per_page")
|
36
|
-
end
|
37
|
-
end
|
@@ -1,34 +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 "/contacts/index" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should render [contact] template with @contacts collection if there are contacts" do
|
18
|
-
assign(:contacts, [build_stubbed(:contact, id: 42)].paginate)
|
19
|
-
|
20
|
-
render template: 'contacts/index', formats: [:js]
|
21
|
-
|
22
|
-
expect(rendered).to include("$('#contacts').html('<li class=\\'highlight contact\\' id=\\'contact_42\\'")
|
23
|
-
expect(rendered).to include("#paginate")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should render [empty] template if @contacts collection if there are no contacts" do
|
27
|
-
assign(:contacts, [].paginate)
|
28
|
-
|
29
|
-
render template: 'contacts/index', formats: [:js]
|
30
|
-
|
31
|
-
expect(rendered).to include("$('#contacts').html('<div id=\\'empty\\'>")
|
32
|
-
expect(rendered).to include("#paginate")
|
33
|
-
end
|
34
|
-
end
|
@@ -1,47 +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 "/contacts/new" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
@account = build_stubbed(:account)
|
16
|
-
assign(:contact, Contact.new(user: current_user))
|
17
|
-
assign(:users, [current_user])
|
18
|
-
assign(:account, @account)
|
19
|
-
assign(:accounts, [@account])
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should toggle empty message div if it exists" do
|
23
|
-
render
|
24
|
-
|
25
|
-
expect(rendered).to include("crm.flick('empty', 'toggle')")
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "new contact" do
|
29
|
-
it "should render [new] template into :create_contact div" do
|
30
|
-
params[:cancel] = nil
|
31
|
-
render
|
32
|
-
|
33
|
-
expect(rendered).to include("$('#create_contact').html")
|
34
|
-
expect(rendered).to include("crm.create_or_select_account(false)")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe "cancel new contact" do
|
39
|
-
it "should hide [create contact] form" do
|
40
|
-
params[:cancel] = "true"
|
41
|
-
render
|
42
|
-
|
43
|
-
expect(rendered).not_to include("$('#create_contact').html")
|
44
|
-
expect(rendered).to include("crm.flip_form('create_contact');")
|
45
|
-
end
|
46
|
-
end
|
47
|
-
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 File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
9
|
-
|
10
|
-
describe "/contacts/show" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
@contact = create(:contact, id: 42,
|
16
|
-
opportunities: [create(:opportunity)])
|
17
|
-
assign(:contact, @contact)
|
18
|
-
assign(:users, [current_user])
|
19
|
-
assign(:comment, Comment.new)
|
20
|
-
assign(:timeline, [create(:comment, commentable: @contact)])
|
21
|
-
|
22
|
-
# controller#controller_name and controller#action_name are not set in view specs
|
23
|
-
allow(view).to receive(:template_for_current_view).and_return(nil)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should render contact landing page" do
|
27
|
-
render
|
28
|
-
expect(view).to render_template(partial: "comments/_new")
|
29
|
-
expect(view).to render_template(partial: "shared/_timeline")
|
30
|
-
expect(view).to render_template(partial: "shared/_tasks")
|
31
|
-
expect(view).to render_template(partial: "opportunities/_opportunity")
|
32
|
-
|
33
|
-
expect(rendered).to have_tag("div[id=edit_contact]")
|
34
|
-
end
|
35
|
-
end
|
@@ -1,128 +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 "/contacts/update" do
|
11
|
-
include ContactsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
|
16
|
-
assign(:contact, @contact = build_stubbed(:contact, user: current_user))
|
17
|
-
assign(:users, [current_user])
|
18
|
-
assign(:account, @account = build_stubbed(:account))
|
19
|
-
assign(:accounts, [@account])
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "no errors:" do
|
23
|
-
describe "on contact landing page -" do
|
24
|
-
before do
|
25
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts/123"
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should flip [edit_contact] form" do
|
29
|
-
render
|
30
|
-
expect(rendered).not_to include("contact_#{@contact.id}")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should update sidebar" do
|
34
|
-
render
|
35
|
-
expect(rendered).to include("#sidebar")
|
36
|
-
expect(rendered).to have_text("Recent Items")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "on contacts index page -" do
|
41
|
-
before do
|
42
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should replace [Edit Contact] with contact partial and highlight it" do
|
46
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
47
|
-
|
48
|
-
render
|
49
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').replaceWith('<li class=\\'highlight contact\\' id=\\'contact_#{@contact.id}\\'")
|
50
|
-
expect(rendered).to include(%/$('#contact_#{@contact.id}').effect("highlight"/)
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should update sidebar" do
|
54
|
-
render
|
55
|
-
expect(rendered).to include("#sidebar")
|
56
|
-
expect(rendered).to have_text("Recent Items")
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe "on related asset page -" do
|
61
|
-
before do
|
62
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/123"
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should replace [Edit Contact] with contact partial and highlight it" do
|
66
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
67
|
-
|
68
|
-
render
|
69
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').replaceWith('<li class=\\'highlight contact\\' id=\\'contact_#{@contact.id}\\'")
|
70
|
-
expect(rendered).to include(%/$('#contact_#{@contact.id}').effect("highlight"/)
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should update recently viewed items" do
|
74
|
-
render
|
75
|
-
expect(rendered).to include("#recently")
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "validation errors:" do
|
81
|
-
before do
|
82
|
-
@contact.errors.add(:first_name)
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "on contact landing page -" do
|
86
|
-
before do
|
87
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts/123"
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should redraw the [edit_contact] form" do
|
91
|
-
render
|
92
|
-
expect(rendered).to include("$('#edit_contact').html")
|
93
|
-
expect(rendered).to include('crm.create_or_select_account(false)')
|
94
|
-
expect(rendered).to include('focus()')
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
describe "on contacts index page -" do
|
99
|
-
before do
|
100
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
101
|
-
end
|
102
|
-
|
103
|
-
it "should redraw the [edit_contact] form" do
|
104
|
-
render
|
105
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').html")
|
106
|
-
expect(rendered).to include('crm.create_or_select_account(false)')
|
107
|
-
expect(rendered).to include('focus()')
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
describe "on related asset page -" do
|
112
|
-
before do
|
113
|
-
controller.request.env["HTTP_REFERER"] = @referer = "http://localhost/accounts/123"
|
114
|
-
end
|
115
|
-
|
116
|
-
it "errors: should show disabled accounts dropdown" do
|
117
|
-
render
|
118
|
-
expect(rendered).to include("crm.create_or_select_account(#{@referer =~ %r{/accounts/}})")
|
119
|
-
end
|
120
|
-
|
121
|
-
it "should redraw the [edit_contact] form" do
|
122
|
-
render
|
123
|
-
expect(rendered).to include("$('#contact_#{@contact.id}').html")
|
124
|
-
expect(rendered).to include('focus()')
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
@@ -1,36 +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 "/home/index" do
|
11
|
-
include HomeHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should render list of activities if it's not empty" do
|
18
|
-
assign(:activities, [build_stubbed(:version, event: "update", item: build_stubbed(:account))])
|
19
|
-
assign(:my_tasks, [])
|
20
|
-
assign(:my_opportunities, [])
|
21
|
-
assign(:my_accounts, [])
|
22
|
-
render template: 'home/index', formats: [:html]
|
23
|
-
expect(view).to render_template(partial: "_activity")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should render a message if there're no activities" do
|
27
|
-
assign(:activities, [])
|
28
|
-
assign(:my_tasks, [])
|
29
|
-
assign(:my_opportunities, [])
|
30
|
-
assign(:my_accounts, [])
|
31
|
-
render template: 'home/index', formats: [:html]
|
32
|
-
expect(view).not_to render_template(partial: "_activity")
|
33
|
-
|
34
|
-
expect(rendered).to include("No activity records found.")
|
35
|
-
end
|
36
|
-
end
|
@@ -1,33 +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 "/home/index" do
|
11
|
-
include HomeHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should render [activity] template with @activities collection" do
|
18
|
-
assign(:activities, [build_stubbed(:version, id: 42, event: "update", item: build_stubbed(:account), whodunnit: current_user.id.to_s)])
|
19
|
-
|
20
|
-
render template: 'home/index', formats: [:js]
|
21
|
-
|
22
|
-
expect(rendered).to include("$('#activities').html")
|
23
|
-
expect(rendered).to include("li class=\\'version\\' id=\\'version_42\\'")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should render a message if there're no activities" do
|
27
|
-
assign(:activities, [])
|
28
|
-
|
29
|
-
render template: 'home/index', formats: [:js]
|
30
|
-
|
31
|
-
expect(rendered).to include("No activity records found.")
|
32
|
-
end
|
33
|
-
end
|
@@ -1,53 +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 "/home/options" do
|
11
|
-
before do
|
12
|
-
login
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should render [options] template into :options div and show it" do
|
16
|
-
params[:cancel] = nil
|
17
|
-
|
18
|
-
assign(:asset, "all")
|
19
|
-
assign(:user, "all_users")
|
20
|
-
assign(:action, "all_actions")
|
21
|
-
assign(:duration, "two_days")
|
22
|
-
assign(:all_users, [build_stubbed(:user)])
|
23
|
-
|
24
|
-
render
|
25
|
-
|
26
|
-
expect(rendered).to include("$('#options').html")
|
27
|
-
expect(rendered).to include("$(\\\'#asset\\\').html(\\\'campaign\\\')")
|
28
|
-
expect(rendered).to include("crm.flip_form('options')")
|
29
|
-
expect(rendered).to include("crm.set_title('title', 'Recent Activity Options')")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should load :options partial with JavaScript code for menus" do
|
33
|
-
params[:cancel] = nil
|
34
|
-
assign(:asset, "all")
|
35
|
-
assign(:action, "all_actions")
|
36
|
-
assign(:user, "all_users")
|
37
|
-
assign(:duration, "two_days")
|
38
|
-
assign(:all_users, [build_stubbed(:user)])
|
39
|
-
|
40
|
-
render
|
41
|
-
|
42
|
-
expect(view).to render_template(partial: "_options")
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should hide options form on Cancel" do
|
46
|
-
params[:cancel] = "true"
|
47
|
-
render
|
48
|
-
|
49
|
-
expect(rendered).not_to include("$('#options').html")
|
50
|
-
expect(rendered).to include("crm.flip_form('options')")
|
51
|
-
expect(rendered).to include("crm.set_title('title', 'Recent Activity')")
|
52
|
-
end
|
53
|
-
end
|
@@ -1,30 +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 "/leads/_convert" do
|
11
|
-
include LeadsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
@account = build_stubbed(:account)
|
16
|
-
assign(:lead, build_stubbed(:lead))
|
17
|
-
assign(:users, [current_user])
|
18
|
-
assign(:account, @account)
|
19
|
-
assign(:accounts, [@account])
|
20
|
-
assign(:opportunity, build_stubbed(:opportunity))
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should render [convert lead] form" do
|
24
|
-
render
|
25
|
-
expect(view).to render_template(partial: "leads/_opportunity")
|
26
|
-
expect(view).to render_template(partial: "leads/_convert_permissions")
|
27
|
-
|
28
|
-
expect(rendered).to have_tag("form[class=edit_lead]")
|
29
|
-
end
|
30
|
-
end
|
@@ -1,47 +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 "/leads/_edit" do
|
11
|
-
include LeadsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
assign(:lead, @lead = build_stubbed(:lead))
|
16
|
-
assign(:users, [current_user])
|
17
|
-
assign(:campaign, @campaign = build_stubbed(:campaign))
|
18
|
-
assign(:campaigns, [@campaign])
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should render [edit lead] form" do
|
22
|
-
render
|
23
|
-
expect(view).to render_template(partial: "leads/_top_section")
|
24
|
-
expect(view).to render_template(partial: "leads/_status")
|
25
|
-
expect(view).to render_template(partial: "leads/_contact")
|
26
|
-
expect(view).to render_template(partial: "leads/_web")
|
27
|
-
expect(view).to render_template(partial: "entities/_permissions")
|
28
|
-
|
29
|
-
expect(rendered).to have_tag('form[class="simple_form edit_lead"]') do
|
30
|
-
with_tag "input[type=hidden][id=lead_user_id][value='#{@lead.user_id}']"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should render background info field if settings require so" do
|
35
|
-
Setting.background_info = [:lead]
|
36
|
-
|
37
|
-
render
|
38
|
-
expect(rendered).to have_tag("textarea[id=lead_background_info]")
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should not render background info field if settings do not require so" do
|
42
|
-
Setting.background_info = []
|
43
|
-
|
44
|
-
render
|
45
|
-
expect(rendered).not_to have_tag("textarea[id=lead_background_info]")
|
46
|
-
end
|
47
|
-
end
|