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
@@ -1,67 +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 'Dashboard', '
|
11
|
-
In order to monitor activity
|
12
|
-
As a user
|
13
|
-
I want to see a dashboard
|
14
|
-
' do
|
15
|
-
background do
|
16
|
-
@me = create(:user)
|
17
|
-
login_as_user(@me)
|
18
|
-
|
19
|
-
create(:task, name: 'Do your homework!', assignee: @me)
|
20
|
-
create(:opportunity, name: 'Work with the Dolphins', assignee: @me, stage: 'proposal')
|
21
|
-
create(:account, name: 'Dolphin Manufacturer', assignee: @me)
|
22
|
-
end
|
23
|
-
|
24
|
-
scenario "Viewing my dashboard" do
|
25
|
-
visit homepage
|
26
|
-
|
27
|
-
# My Tasks
|
28
|
-
within "#tasks" do
|
29
|
-
expect(page).to have_content("Do your homework!")
|
30
|
-
end
|
31
|
-
|
32
|
-
# My Opportunities
|
33
|
-
within "#opportunities" do
|
34
|
-
expect(page).to have_content("Work with the Dolphins")
|
35
|
-
end
|
36
|
-
|
37
|
-
# My Accounts
|
38
|
-
within "#accounts" do
|
39
|
-
expect(page).to have_content("Dolphin Manufacturer")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
scenario "Only show a maximum of 10 entities" do
|
44
|
-
10.times do
|
45
|
-
create(:task, assignee: @me)
|
46
|
-
create(:opportunity, assignee: @me, stage: 'proposal')
|
47
|
-
create(:account, assignee: @me)
|
48
|
-
end
|
49
|
-
|
50
|
-
visit homepage
|
51
|
-
|
52
|
-
# My Tasks
|
53
|
-
within "#tasks" do
|
54
|
-
expect(page).to have_content("Not showing 1 hidden task.")
|
55
|
-
end
|
56
|
-
|
57
|
-
# My Opportunities
|
58
|
-
within "#opportunities" do
|
59
|
-
expect(page).to have_content("Not showing 1 hidden opportunity.")
|
60
|
-
end
|
61
|
-
|
62
|
-
# My Accounts
|
63
|
-
within "#accounts" do
|
64
|
-
expect(page).to have_content("Not showing 1 hidden account.")
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,58 +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 'features/acceptance_helper'
|
9
|
-
|
10
|
-
feature 'Devise Sign-in' do
|
11
|
-
background do
|
12
|
-
Setting.user_signup = :needs_approval
|
13
|
-
@user = create :user,
|
14
|
-
username: 'john',
|
15
|
-
password: 'password',
|
16
|
-
password_confirmation: 'password',
|
17
|
-
email: 'john@example.com',
|
18
|
-
sign_in_count: 0
|
19
|
-
end
|
20
|
-
|
21
|
-
scenario 'without confirmation' do
|
22
|
-
login_process('john', 'password')
|
23
|
-
expect(page).to have_content("You have to confirm your email address before continuing.")
|
24
|
-
end
|
25
|
-
|
26
|
-
scenario 'without approval' do
|
27
|
-
@user.confirm
|
28
|
-
login_process('john', 'password')
|
29
|
-
expect(page).to have_content("Your account has not been approved yet.")
|
30
|
-
end
|
31
|
-
|
32
|
-
scenario 'with approved and confirmed account' do
|
33
|
-
@user.confirm
|
34
|
-
@user.update_attribute(:suspended_at, nil)
|
35
|
-
login_process('john', 'password')
|
36
|
-
expect(page).to have_content("Signed in successfully.")
|
37
|
-
end
|
38
|
-
|
39
|
-
scenario 'invalid credentials' do
|
40
|
-
login_process('jo', 'pass')
|
41
|
-
expect(current_path).to eq "/users/sign_in"
|
42
|
-
expect(page).to have_content("Invalid Email or password")
|
43
|
-
end
|
44
|
-
|
45
|
-
scenario 'login with email' do
|
46
|
-
@user.confirm
|
47
|
-
@user.update_attribute(:suspended_at, nil)
|
48
|
-
login_process('john@example.com', 'password')
|
49
|
-
expect(page).to have_content("Signed in successfully")
|
50
|
-
end
|
51
|
-
|
52
|
-
def login_process(username, password)
|
53
|
-
visit '/users/sign_in'
|
54
|
-
fill_in 'user[email]', with: username
|
55
|
-
fill_in 'user[password]', with: password
|
56
|
-
click_button 'Login'
|
57
|
-
end
|
58
|
-
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 'features/acceptance_helper'
|
9
|
-
|
10
|
-
feature 'Devise Sign-up' do
|
11
|
-
scenario 'with valid credentials' do
|
12
|
-
visit "/users/sign_up"
|
13
|
-
|
14
|
-
fill_in "user[email]", with: "john@example.com"
|
15
|
-
fill_in "user[username]", with: "john"
|
16
|
-
fill_in "user[password]", with: "password"
|
17
|
-
fill_in "user[password_confirmation]", with: "password"
|
18
|
-
click_button("Sign Up")
|
19
|
-
|
20
|
-
expect(current_path).to eq "/users/sign_in"
|
21
|
-
expect(page).to have_content("A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.")
|
22
|
-
end
|
23
|
-
|
24
|
-
scenario 'without credentials' do
|
25
|
-
visit "/users/sign_up"
|
26
|
-
click_button("Sign Up")
|
27
|
-
|
28
|
-
expect(page).to have_content("6 errors prohibited this User from being saved")
|
29
|
-
expect(page).to have_content("Please specify email address")
|
30
|
-
expect(page).to have_content("Email is too short (minimum is 3 characters)")
|
31
|
-
expect(page).to have_content("Email is invalid")
|
32
|
-
expect(page).to have_content("Please specify username")
|
33
|
-
expect(page).to have_content("Username is invalid")
|
34
|
-
expect(page).to have_content("Password can't be blank")
|
35
|
-
end
|
36
|
-
end
|
data/spec/features/leads_spec.rb
DELETED
@@ -1,138 +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 'Leads', '
|
11
|
-
In order to increase sales
|
12
|
-
As a user
|
13
|
-
I want to manage leads
|
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 leads' do
|
20
|
-
4.times { |i| create(:lead, first_name: "L", last_name: "Ead #{i}") }
|
21
|
-
visit leads_page
|
22
|
-
expect(leads_element).to have_content('L Ead 0')
|
23
|
-
expect(leads_element).to have_content('L Ead 1')
|
24
|
-
expect(leads_element).to have_content('L Ead 2')
|
25
|
-
expect(leads_element).to have_content('L Ead 3')
|
26
|
-
expect(page).to have_content('Create Lead')
|
27
|
-
end
|
28
|
-
|
29
|
-
scenario 'should create a new lead', js: true do
|
30
|
-
with_versioning do
|
31
|
-
visit leads_page
|
32
|
-
click_link 'Create Lead'
|
33
|
-
expect(page).to have_selector('#lead_first_name', visible: true)
|
34
|
-
fill_in 'lead_first_name', with: 'Mr'
|
35
|
-
fill_in 'lead_last_name', with: 'Lead'
|
36
|
-
fill_in 'lead_email', with: 'mr_lead@example.com'
|
37
|
-
fill_in 'lead_phone', with: '+44 1234 567890'
|
38
|
-
click_link 'Status'
|
39
|
-
select2 'Myself', from: 'Assigned to:'
|
40
|
-
select2 'Contacted', from: 'Status:'
|
41
|
-
select2 'Campaign', from: 'Source:'
|
42
|
-
click_link 'Comment'
|
43
|
-
fill_in 'comment_body', with: 'This is an important lead.'
|
44
|
-
|
45
|
-
# TODO: Refactor to a page object
|
46
|
-
# This panel is already open, so clicking status again closed the div.
|
47
|
-
# click_link 'Status'
|
48
|
-
select2 'Contacted', from: 'Status:'
|
49
|
-
click_button 'Create Lead'
|
50
|
-
expect(leads_element).to have_content('Mr Lead')
|
51
|
-
|
52
|
-
leads_element.click_link('Mr Lead')
|
53
|
-
expect(summary_element).to have_content('Contacted')
|
54
|
-
expect(summary_element).to have_content('mr_lead@example.com')
|
55
|
-
expect(summary_element).to have_content('+44 1234 567890')
|
56
|
-
expect(main_element).to have_content('This is an important lead.')
|
57
|
-
|
58
|
-
click_link "Dashboard"
|
59
|
-
expect(activities_element).to have_content("Bill Murray created lead Mr Lead")
|
60
|
-
expect(activities_element).to have_content("Bill Murray created comment on Mr Lead")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
scenario "remembers the comment field when the creation was unsuccessful", js: true do
|
65
|
-
visit leads_page
|
66
|
-
click_link 'Create Lead'
|
67
|
-
|
68
|
-
click_link 'Comment'
|
69
|
-
fill_in 'comment_body', with: 'This is an important lead.'
|
70
|
-
click_button 'Create Lead'
|
71
|
-
|
72
|
-
expect(page).to have_field('comment_body', with: 'This is an important lead.')
|
73
|
-
end
|
74
|
-
|
75
|
-
scenario 'should view and edit a lead', js: true do
|
76
|
-
create(:lead, first_name: "Mr", last_name: "Lead", email: "mr_lead@example.com")
|
77
|
-
with_versioning do
|
78
|
-
visit leads_page
|
79
|
-
click_link 'Mr Lead'
|
80
|
-
expect(page).to have_content('Mr Lead')
|
81
|
-
click_link('Edit')
|
82
|
-
fill_in 'lead_first_name', with: 'Mrs'
|
83
|
-
fill_in 'lead_phone', with: '+44 0987 654321'
|
84
|
-
click_link('Status')
|
85
|
-
select2 'Rejected', from: 'Status:'
|
86
|
-
click_button 'Save Lead'
|
87
|
-
sleep(3) # TODO: A better AJAX observing call, or just a redirect on save.
|
88
|
-
expect(find('#title')).to have_content('Mrs Lead')
|
89
|
-
|
90
|
-
click_link "Dashboard"
|
91
|
-
expect(activities_element).to have_content("Bill Murray updated lead Mrs Lead")
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
scenario 'should delete a lead', js: true do
|
96
|
-
create(:lead, first_name: "Mr", last_name: "Lead", email: "mr_lead@example.com")
|
97
|
-
visit leads_page
|
98
|
-
click_link 'Mr Lead'
|
99
|
-
click_link 'Delete?'
|
100
|
-
expect(page).to have_content('Are you sure you want to delete this lead?')
|
101
|
-
click_link 'Yes'
|
102
|
-
expect(page).to have_content('Mr Lead has been deleted.')
|
103
|
-
expect(page).not_to have_content('Mr Lead')
|
104
|
-
expect(page).not_to have_content('mr_lead@example.com')
|
105
|
-
end
|
106
|
-
|
107
|
-
scenario 'should search for a lead', js: true do
|
108
|
-
2.times { |i| create(:lead, first_name: "Lead", last_name: "\##{i}", email: "lead#{i}@example.com") }
|
109
|
-
visit leads_page
|
110
|
-
expect(leads_element).to have_content('Lead #0')
|
111
|
-
expect(leads_element).to have_content('Lead #1')
|
112
|
-
fill_in 'query', with: 'Lead #0'
|
113
|
-
expect(leads_element).to have_content('Lead #0')
|
114
|
-
expect(leads_element).not_to have_content('Lead #1')
|
115
|
-
fill_in 'query', with: 'Lead'
|
116
|
-
expect(leads_element).to have_content('Lead #0')
|
117
|
-
expect(leads_element).to have_content('Lead #1')
|
118
|
-
fill_in 'query', with: 'Non-existant lead'
|
119
|
-
expect(leads_element).not_to have_content('Lead #0')
|
120
|
-
expect(leads_element).not_to have_content('Lead #1')
|
121
|
-
end
|
122
|
-
|
123
|
-
def main_element
|
124
|
-
find('#main')
|
125
|
-
end
|
126
|
-
|
127
|
-
def summary_element
|
128
|
-
find('#summary')
|
129
|
-
end
|
130
|
-
|
131
|
-
def leads_element
|
132
|
-
find('#leads')
|
133
|
-
end
|
134
|
-
|
135
|
-
def activities_element
|
136
|
-
find('#activities')
|
137
|
-
end
|
138
|
-
end
|
@@ -1,88 +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 'Opportunities Overview', "
|
11
|
-
In order to keep track of my team's responsibilities
|
12
|
-
As a user
|
13
|
-
I want to see an overview of opportunities broken down by user
|
14
|
-
" do
|
15
|
-
background do
|
16
|
-
@me = create(:user)
|
17
|
-
|
18
|
-
login_as_user(@me)
|
19
|
-
end
|
20
|
-
|
21
|
-
scenario "Accessing Opportunity Overview via the nav" do
|
22
|
-
visit homepage
|
23
|
-
within ".tabs" do
|
24
|
-
click_link "Team"
|
25
|
-
end
|
26
|
-
|
27
|
-
expect(current_path).to eq(opportunity_overview_page)
|
28
|
-
end
|
29
|
-
|
30
|
-
scenario "Viewing Opportunity Overview when all opportunities have been assigned" do
|
31
|
-
user1 = create(:user, first_name: "Brian", last_name: 'Doyle-Murray')
|
32
|
-
create(:opportunity, name: "Acting", stage: 'prospecting', assignee: user1)
|
33
|
-
create(:opportunity, name: "Directing", stage: 'won', assignee: user1)
|
34
|
-
|
35
|
-
user2 = create(:user, first_name: "Dean", last_name: 'Stockwell')
|
36
|
-
account1 = create(:account, name: 'Quantum Leap')
|
37
|
-
create(:opportunity, name: "Leaping", stage: 'prospecting', account: account1, assignee: user2)
|
38
|
-
create(:opportunity, name: "Return Home", stage: 'prospecting', account: account1, assignee: user2)
|
39
|
-
|
40
|
-
user3 = create(:user, first_name: "Chris", last_name: 'Jarvis')
|
41
|
-
create(:opportunity, stage: 'won', assignee: user3)
|
42
|
-
create(:opportunity, stage: 'lost', assignee: user3)
|
43
|
-
|
44
|
-
visit opportunity_overview_page
|
45
|
-
|
46
|
-
within "#user_#{user1.id}" do
|
47
|
-
expect(page).to have_selector('.title', text: 'Brian Doyle-Murray')
|
48
|
-
expect(page).to have_content('Acting')
|
49
|
-
expect(page).not_to have_content('Directing')
|
50
|
-
end
|
51
|
-
|
52
|
-
within "#user_#{user2.id}" do
|
53
|
-
expect(page).to have_selector('.title', text: 'Dean Stockwell')
|
54
|
-
expect(page).to have_content('Leaping from Quantum Leap')
|
55
|
-
expect(page).to have_content('Return Home from Quantum Leap')
|
56
|
-
end
|
57
|
-
|
58
|
-
expect(page).not_to have_selector("#user_#{user3.id}")
|
59
|
-
|
60
|
-
expect(page).not_to have_selector('#unassigned')
|
61
|
-
end
|
62
|
-
|
63
|
-
scenario "Viewing Opportunity Overview when all opportunities are unassigned" do
|
64
|
-
create(:opportunity, name: "Acting", stage: 'prospecting', assignee: nil)
|
65
|
-
create(:opportunity, name: "Presenting", stage: 'won', assignee: nil)
|
66
|
-
|
67
|
-
visit opportunity_overview_page
|
68
|
-
|
69
|
-
within "#unassigned" do
|
70
|
-
expect(page).to have_selector('.title', text: 'Unassigned Opportunities')
|
71
|
-
expect(page).to have_content('Acting')
|
72
|
-
expect(page).not_to have_content('Presenting')
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
scenario "Viewing Opportunity Overview when there are no opportunities in the pipeline" do
|
77
|
-
create(:opportunity, name: "Presenting", stage: 'lost', assignee: create(:user))
|
78
|
-
create(:opportunity, name: "Eating", stage: 'won', assignee: nil)
|
79
|
-
|
80
|
-
visit opportunity_overview_page
|
81
|
-
|
82
|
-
expect(page).to have_content('There are currently no outstanding opportunities.')
|
83
|
-
within "#main" do
|
84
|
-
expect(page).not_to have_content("Presenting")
|
85
|
-
expect(page).not_to have_content("Eating")
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
@@ -1,132 +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 'Opportunities', '
|
11
|
-
In order to increase sales
|
12
|
-
As a user
|
13
|
-
I want to manage opportunities
|
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 opportunities' do
|
20
|
-
3.times { |i| create(:opportunity, name: "Opportunity #{i}") }
|
21
|
-
visit opportunities_page
|
22
|
-
expect(page).to have_content('Opportunity 0')
|
23
|
-
expect(page).to have_content('Opportunity 1')
|
24
|
-
expect(page).to have_content('Opportunity 2')
|
25
|
-
expect(page).to have_content('Create Opportunity')
|
26
|
-
end
|
27
|
-
|
28
|
-
scenario 'should create a new opportunity', js: true do
|
29
|
-
create(:account, name: 'Example Account')
|
30
|
-
with_versioning do
|
31
|
-
visit opportunities_page
|
32
|
-
click_link 'Create Opportunity'
|
33
|
-
expect(page).to have_selector('#opportunity_name', visible: true)
|
34
|
-
fill_in 'opportunity_name', with: 'My Awesome Opportunity'
|
35
|
-
click_link 'select existing'
|
36
|
-
find('#select2-account_id-container').click
|
37
|
-
find('.select2-search--dropdown').find('input').set('Example Account')
|
38
|
-
sleep(1)
|
39
|
-
find('li', text: 'Example Account').click
|
40
|
-
expect(page).to have_content('Example Account')
|
41
|
-
select2 'Prospecting', from: 'Stage'
|
42
|
-
click_link 'Comment'
|
43
|
-
fill_in 'comment_body', with: 'This is a very important opportunity.'
|
44
|
-
click_button 'Create Opportunity'
|
45
|
-
expect(page).to have_content('My Awesome Opportunity')
|
46
|
-
|
47
|
-
find('div#opportunities').click_link('My Awesome Opportunity')
|
48
|
-
expect(page).to have_content('This is a very important opportunity.')
|
49
|
-
|
50
|
-
click_link "Dashboard"
|
51
|
-
expect(page).to have_content("Bill Murray created opportunity My Awesome Opportunity")
|
52
|
-
expect(page).to have_content("Bill Murray created comment on My Awesome Opportunity")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
scenario 'should not display ammount with zero value', js: true do
|
57
|
-
with_amount = create(:opportunity, name: 'With Amount', amount: 3000, probability: 90, discount: nil, stage: 'proposal')
|
58
|
-
without_amount = create(:opportunity, name: 'Without Amount', amount: nil, probability: nil, discount: nil, stage: 'proposal')
|
59
|
-
with_versioning do
|
60
|
-
visit opportunities_page
|
61
|
-
click_link 'Long format'
|
62
|
-
expect(find("#opportunity_#{with_amount.id}")).to have_content('$3,000 | Probability 90%')
|
63
|
-
expect(find("#opportunity_#{without_amount.id}")).not_to have_content('$0 | Discount $0 | Probability 0%')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
scenario "remembers the comment field when the creation was unsuccessful", js: true do
|
68
|
-
visit opportunities_page
|
69
|
-
click_link 'Create Opportunity'
|
70
|
-
select2 'Prospecting', from: 'Stage:'
|
71
|
-
|
72
|
-
click_link 'Comment'
|
73
|
-
fill_in 'comment_body', with: 'This is a very important opportunity.'
|
74
|
-
click_button 'Create Opportunity'
|
75
|
-
|
76
|
-
expect(page).to have_field('comment_body', with: 'This is a very important opportunity.')
|
77
|
-
end
|
78
|
-
|
79
|
-
scenario 'should view and edit an opportunity', js: true do
|
80
|
-
create(:account, name: 'Example Account')
|
81
|
-
create(:account, name: 'Other Example Account')
|
82
|
-
create(:opportunity, name: 'A Cool Opportunity')
|
83
|
-
with_versioning do
|
84
|
-
visit opportunities_page
|
85
|
-
click_link 'A Cool Opportunity'
|
86
|
-
click_link 'Edit'
|
87
|
-
fill_in 'opportunity_name', with: 'An Even Cooler Opportunity'
|
88
|
-
select2 'Other Example Account', from: 'Account (create new or select existing):'
|
89
|
-
select2 'Analysis', from: 'Stage:'
|
90
|
-
click_button 'Save Opportunity'
|
91
|
-
expect(page).to have_content('An Even Cooler Opportunity')
|
92
|
-
click_link "Dashboard"
|
93
|
-
expect(page).to have_content("Bill Murray updated opportunity An Even Cooler Opportunity")
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
scenario 'should delete an opportunity', js: true do
|
98
|
-
create(:opportunity, name: 'Outdated Opportunity')
|
99
|
-
visit opportunities_page
|
100
|
-
click_link 'Outdated Opportunity'
|
101
|
-
click_link 'Delete?'
|
102
|
-
expect(page).to have_content('Are you sure you want to delete this opportunity?')
|
103
|
-
click_link 'Yes'
|
104
|
-
expect(page).to have_content('Outdated Opportunity has been deleted.')
|
105
|
-
end
|
106
|
-
|
107
|
-
scenario 'should search for an opportunity', js: true do
|
108
|
-
2.times { |i| create(:opportunity, name: "Opportunity #{i}") }
|
109
|
-
visit opportunities_page
|
110
|
-
expect(find('#opportunities')).to have_content("Opportunity 0")
|
111
|
-
expect(find('#opportunities')).to have_content("Opportunity 1")
|
112
|
-
fill_in 'query', with: "Opportunity 0"
|
113
|
-
expect(find('#opportunities')).to have_content("Opportunity 0")
|
114
|
-
expect(find('#opportunities')).not_to have_content("Opportunity 1")
|
115
|
-
fill_in 'query', with: "Opportunity"
|
116
|
-
expect(find('#opportunities')).to have_content("Opportunity 0")
|
117
|
-
expect(find('#opportunities')).to have_content("Opportunity 1")
|
118
|
-
fill_in 'query', with: "Non-existant opportunity"
|
119
|
-
expect(find('#opportunities')).not_to have_content("Opportunity 0")
|
120
|
-
expect(find('#opportunities')).not_to have_content("Opportunity 1")
|
121
|
-
end
|
122
|
-
|
123
|
-
scenario 'should add comment to opportunity', js: true do
|
124
|
-
opportunity = create(:opportunity, name: 'Awesome Opportunity')
|
125
|
-
visit opportunities_page
|
126
|
-
click_link 'Awesome Opportunity'
|
127
|
-
find("#opportunity_#{opportunity.id}_post_new_note").click
|
128
|
-
fill_in 'comment[comment]', with: 'Most awesome opportunity'
|
129
|
-
click_button 'Add Comment'
|
130
|
-
expect(page).to have_content('Most awesome opportunity')
|
131
|
-
end
|
132
|
-
end
|
@@ -1,17 +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
|
-
def fill_autocomplete(field, options = {})
|
9
|
-
fill_in field, with: options[:with]
|
10
|
-
page.execute_script %{ $('##{field}').trigger('focus') }
|
11
|
-
page.execute_script %{ $('##{field}').trigger('keydown') }
|
12
|
-
|
13
|
-
selector = %{ul.ui-autocomplete li.ui-menu-item a:contains("#{options[:select]}")}
|
14
|
-
sleep(1)
|
15
|
-
expect(page).to have_selector('ul.ui-autocomplete li.ui-menu-item a')
|
16
|
-
page.execute_script %{ $('#{selector}').trigger('mouseenter').click() }
|
17
|
-
end
|
@@ -1,28 +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
|
-
Capaybara.app_host = ENV['APP_URL'] if ENV['APP_URL']
|
9
|
-
Capybara.default_max_wait_time = 7
|
10
|
-
Capybara.server = :webrick
|
11
|
-
|
12
|
-
if ENV['BROWSER'] == 'chrome'
|
13
|
-
Capybara.register_driver :selenium do |app|
|
14
|
-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: %w[no-sandbox headless disable-gpu] })
|
15
|
-
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
|
16
|
-
end
|
17
|
-
else
|
18
|
-
# For local testing in an environment with a display or remote X server configured
|
19
|
-
# such as WSL2, use NO_HEADLESS=1 bundle exec rspec spec/features
|
20
|
-
#
|
21
|
-
# For modern firefox, use MARIONETTE=1 bundle exec rspec spec/features
|
22
|
-
Capybara.register_driver :selenium do |app|
|
23
|
-
options = Selenium::WebDriver::Firefox::Options.new
|
24
|
-
options.args << '--headless' unless ENV['NO_HEADLESS'].present?
|
25
|
-
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(marionette: ENV['MARIONETTE'].present?)
|
26
|
-
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options, desired_capabilities: capabilities)
|
27
|
-
end
|
28
|
-
end
|
@@ -1,19 +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
|
-
#
|
9
|
-
# Drives the browser in 'headless' mode if required.
|
10
|
-
# Useful for CI and travis tests
|
11
|
-
#
|
12
|
-
|
13
|
-
if ENV['HEADLESS'] == 'true' || ENV["CI"] == "true"
|
14
|
-
require 'headless'
|
15
|
-
headless = Headless.new
|
16
|
-
headless.start
|
17
|
-
HEADLESS_DISPLAY = ":#{headless.display}"
|
18
|
-
puts "Running in Headless mode. Display #{HEADLESS_DISPLAY}"
|
19
|
-
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
|
-
module NavigationHelpers
|
9
|
-
# Put helper methods related to the paths in your application here.
|
10
|
-
|
11
|
-
def homepage
|
12
|
-
"/"
|
13
|
-
end
|
14
|
-
|
15
|
-
def accounts_page
|
16
|
-
accounts_path
|
17
|
-
end
|
18
|
-
|
19
|
-
def leads_page
|
20
|
-
leads_path
|
21
|
-
end
|
22
|
-
|
23
|
-
def opportunities_page
|
24
|
-
opportunities_path
|
25
|
-
end
|
26
|
-
|
27
|
-
def contacts_page
|
28
|
-
contacts_path
|
29
|
-
end
|
30
|
-
|
31
|
-
def campaigns_page
|
32
|
-
campaigns_path
|
33
|
-
end
|
34
|
-
|
35
|
-
def tasks_page
|
36
|
-
tasks_path
|
37
|
-
end
|
38
|
-
|
39
|
-
def groups_page
|
40
|
-
admin_groups_path
|
41
|
-
end
|
42
|
-
|
43
|
-
def opportunity_overview_page
|
44
|
-
opportunities_overview_users_path
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
RSpec.configuration.include NavigationHelpers, type: :feature
|
@@ -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
|
-
module SelectorHelpers
|
9
|
-
def click_filter_tab(filter_name)
|
10
|
-
tab = find(:xpath, "//div[@class='filters']//a[contains(text(), '#{filter_name}')]")
|
11
|
-
tab.click
|
12
|
-
end
|
13
|
-
|
14
|
-
def click_edit_for_task_id(task_id)
|
15
|
-
within("#task_#{task_id}") do
|
16
|
-
page.execute_script "$('#task_#{task_id} a')[0].click()"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def click_delete_for_task_id(task_id)
|
21
|
-
within("#task_#{task_id}") do
|
22
|
-
page.execute_script "$('#task_#{task_id} a')[1].click()"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
# See github.com/goodwill/capybara-select2
|
27
|
-
def select2(value, options = {})
|
28
|
-
select2_container = find("div.label", text: options[:from]).find(:xpath, '..').find('.select2-container')
|
29
|
-
|
30
|
-
select2_container.find(".select2-selection").click
|
31
|
-
drop_container = ".select2-dropdown"
|
32
|
-
find(:xpath, "//body").find("#{drop_container} li.select2-results__option", text: value).click
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
RSpec.configuration.include SelectorHelpers, type: :feature
|