fat_free_crm 0.17.3 → 0.19.2
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/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +71 -148
- data/.travis.yml +35 -14
- data/CHANGELOG.md +92 -6
- data/CONTRIBUTORS.md +96 -53
- data/Dockerfile +45 -14
- data/Gemfile +23 -13
- data/Gemfile.lock +256 -248
- data/Procfile +1 -1
- data/README.md +9 -6
- data/Rakefile +1 -1
- data/app/assets/javascripts/crm.js.coffee +3 -3
- data/app/assets/javascripts/crm_select2.js.coffee +15 -14
- data/app/assets/stylesheets/common.scss +1 -1
- data/app/controllers/admin/application_controller.rb +1 -1
- data/app/controllers/admin/field_groups_controller.rb +9 -4
- data/app/controllers/admin/fields_controller.rb +4 -4
- data/app/controllers/admin/groups_controller.rb +1 -1
- data/app/controllers/admin/tags_controller.rb +2 -4
- data/app/controllers/admin/users_controller.rb +5 -8
- data/app/controllers/application_controller.rb +22 -45
- data/app/controllers/comments_controller.rb +16 -11
- data/{config/initializers/authlogic.rb → app/controllers/confirmations_controller.rb} +4 -2
- data/app/controllers/emails_controller.rb +0 -2
- data/app/controllers/entities/accounts_controller.rb +1 -3
- data/app/controllers/entities/campaigns_controller.rb +8 -5
- data/app/controllers/entities/contacts_controller.rb +4 -24
- data/app/controllers/entities/leads_controller.rb +16 -12
- data/app/controllers/entities/opportunities_controller.rb +17 -16
- data/app/controllers/entities_controller.rb +31 -12
- data/app/controllers/home_controller.rb +2 -4
- data/app/controllers/lists_controller.rb +5 -1
- data/app/controllers/passwords_controller.rb +3 -59
- data/{spec/features/support/maintain_sessions.rb → app/controllers/registrations_controller.rb} +12 -5
- data/{lib/development_tasks/gem.rake → app/controllers/sessions_controller.rb} +6 -6
- data/app/controllers/tasks_controller.rb +22 -17
- data/app/controllers/users_controller.rb +8 -29
- data/app/helpers/accounts_helper.rb +1 -1
- data/app/helpers/admin/users_helper.rb +1 -1
- data/app/helpers/application_helper.rb +28 -33
- data/app/helpers/campaigns_helper.rb +1 -1
- data/app/helpers/contacts_helper.rb +1 -3
- data/app/helpers/leads_helper.rb +1 -1
- data/app/helpers/opportunities_helper.rb +48 -3
- data/app/helpers/tasks_helper.rb +1 -1
- data/app/helpers/users_helper.rb +1 -3
- data/{config/initializers/paper_trail.rb → app/mailers/devise_mailer.rb} +5 -1
- data/app/mailers/user_mailer.rb +0 -9
- data/app/models/entities/account.rb +10 -10
- data/app/models/entities/campaign.rb +4 -6
- data/app/models/entities/contact.rb +24 -12
- data/app/models/entities/lead.rb +7 -14
- data/app/models/entities/opportunity.rb +10 -11
- data/app/models/fields/custom_field.rb +1 -0
- data/app/models/fields/custom_field_date_pair.rb +2 -0
- data/app/models/fields/field.rb +1 -3
- data/app/models/list.rb +1 -1
- data/app/models/observers/entity_observer.rb +3 -7
- data/app/models/observers/lead_observer.rb +2 -4
- data/app/models/observers/opportunity_observer.rb +5 -7
- data/app/models/observers/task_observer.rb +1 -1
- data/app/models/polymorphic/email.rb +2 -2
- data/app/models/polymorphic/task.rb +13 -9
- data/app/models/polymorphic/version.rb +3 -2
- data/app/models/setting.rb +2 -0
- data/app/models/users/ability.rb +3 -4
- data/app/models/users/permission.rb +3 -3
- data/app/models/users/preference.rb +2 -1
- data/app/models/users/user.rb +67 -42
- data/app/views/accounts/_top_section.html.haml +1 -1
- data/app/views/accounts/edit.js.haml +1 -1
- data/app/views/accounts/update.js.haml +2 -2
- data/app/views/admin/users/_user.html.haml +4 -4
- data/app/views/campaigns/_metrics.html.haml +3 -3
- data/app/views/contacts/_index_brief.html.haml +1 -1
- data/app/views/contacts/_index_full.html.haml +1 -1
- data/app/views/contacts/_index_long.html.haml +1 -1
- data/app/views/devise/confirmations/new.html.haml +9 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/devise/mailer/password_change.html.haml +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/devise/passwords/edit.html.haml +18 -0
- data/app/views/devise/passwords/new.html.haml +10 -0
- data/app/views/devise/registrations/new.html.haml +21 -0
- data/app/views/devise/sessions/new.html.haml +32 -0
- data/app/views/home/_opportunity.html.haml +4 -19
- data/app/views/layouts/_about.html.haml +5 -5
- data/app/views/layouts/_header.html.haml +3 -3
- data/app/views/layouts/admin/_header.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -24
- data/app/views/opportunities/_sidebar_show.html.haml +3 -3
- data/app/views/opportunities/_top_section.html.haml +1 -1
- data/app/views/shared/_address.html.haml +5 -5
- data/app/views/shared/_empty.html.haml +1 -1
- data/app/views/shared/_paginate_with_per_page.html.haml +1 -0
- data/app/views/users/_avatar.html.haml +1 -1
- data/bin/bundle +1 -1
- data/bin/rails +1 -1
- data/bin/setup +38 -0
- data/bin/update +33 -0
- data/bin/yarn +13 -0
- data/config/application.rb +8 -6
- data/config/boot.rb +1 -1
- data/config/brakeman.ignore +2 -2
- data/config/database.postgres.docker.yml +5 -5
- data/config/environment.rb +1 -1
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +7 -0
- data/config/initializers/action_mailer.rb +1 -3
- data/config/initializers/application_controller_renderer.rb +9 -0
- data/config/initializers/assets.rb +6 -11
- data/config/initializers/backtrace_silencers.rb +0 -6
- data/config/initializers/content_security_policy.rb +26 -0
- data/config/initializers/cookies_serializer.rb +3 -6
- data/config/initializers/devise.rb +289 -0
- data/config/initializers/filter_parameter_logging.rb +0 -5
- data/config/initializers/gravatar.rb +0 -1
- data/config/initializers/inflections.rb +0 -6
- data/config/initializers/mime_types.rb +1 -9
- data/config/initializers/new_framework_defaults_5_2.rb +40 -0
- data/config/initializers/relative_url_root.rb +1 -3
- data/config/initializers/session_store.rb +1 -3
- data/config/initializers/wrap_parameters.rb +4 -9
- data/config/locales/fat_free_crm.en-GB.yml +5 -5
- data/config/locales/fat_free_crm.en-US.yml +5 -5
- data/config/locales/fat_free_crm.fr.yml +1 -1
- data/config/locales/fat_free_crm.ru.yml +1 -0
- data/config/routes.rb +20 -9
- data/db/demo/users.yml +62 -81
- data/db/migrate/20100928030620_remove_uuid.rb +1 -2
- data/db/migrate/20120316045804_activities_to_versions.rb +1 -0
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +1 -0
- data/db/migrate/20180107082701_authlogic_to_devise.rb +58 -0
- data/db/schema.rb +48 -46
- data/docker-compose.yml +10 -0
- data/fat_free_crm.gemspec +12 -14
- data/lib/development_tasks/license.rake +2 -2
- data/lib/fat_free_crm/callback.rb +2 -2
- data/lib/fat_free_crm/comment_extensions.rb +2 -4
- data/lib/fat_free_crm/core_ext/string.rb +1 -1
- data/lib/fat_free_crm/engine.rb +2 -2
- data/lib/fat_free_crm/errors.rb +1 -1
- data/lib/fat_free_crm/export_csv.rb +1 -0
- data/lib/fat_free_crm/exportable.rb +1 -1
- data/lib/fat_free_crm/fields.rb +2 -2
- data/lib/fat_free_crm/gem_dependencies.rb +1 -1
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +1 -3
- data/lib/fat_free_crm/i18n.rb +2 -2
- data/lib/fat_free_crm/mail_processor/base.rb +4 -10
- data/lib/fat_free_crm/mail_processor/dropbox.rb +5 -15
- data/lib/fat_free_crm/permissions.rb +7 -18
- data/lib/fat_free_crm/sortable.rb +1 -1
- data/lib/fat_free_crm/tabs.rb +2 -2
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/gravatar_image_tag.rb +7 -8
- data/lib/missing_translation_detector.rb +1 -0
- data/lib/tasks/ffcrm/missing_translations.rake +1 -0
- data/lib/tasks/ffcrm/setup.rake +13 -4
- data/lib/tasks/ffcrm/update_data.rake +2 -2
- data/script/rails +2 -2
- data/spec/controllers/admin/users_controller_spec.rb +25 -81
- data/spec/controllers/comments_controller_spec.rb +19 -19
- data/spec/controllers/emails_controller_spec.rb +2 -2
- data/spec/controllers/entities/accounts_controller_spec.rb +56 -56
- data/spec/controllers/entities/campaigns_controller_spec.rb +66 -66
- data/spec/controllers/entities/contacts_controller_spec.rb +69 -68
- data/spec/controllers/entities/leads_controller_spec.rb +126 -126
- data/spec/controllers/entities/opportunities_controller_spec.rb +101 -101
- data/spec/controllers/entities_controller_spec.rb +5 -0
- data/spec/controllers/home_controller_spec.rb +30 -30
- data/spec/controllers/tasks_controller_spec.rb +42 -40
- data/spec/controllers/users_controller_spec.rb +43 -113
- data/spec/factories/account_factories.rb +13 -13
- data/spec/factories/campaign_factories.rb +8 -8
- data/spec/factories/contact_factories.rb +18 -18
- data/spec/factories/field_factories.rb +11 -10
- data/spec/factories/lead_factories.rb +13 -13
- data/spec/factories/list_factories.rb +3 -3
- data/spec/factories/opportunity_factories.rb +9 -9
- data/spec/factories/sequences.rb +1 -1
- data/spec/factories/setting_factories.rb +5 -5
- data/spec/factories/shared_factories.rb +25 -23
- data/spec/factories/subscription_factories.rb +1 -1
- data/spec/factories/tag_factories.rb +1 -1
- data/spec/factories/task_factories.rb +11 -11
- data/spec/factories/user_factories.rb +27 -30
- data/spec/features/accounts_spec.rb +17 -4
- data/spec/features/admin/groups_spec.rb +2 -2
- data/spec/features/admin/users_spec.rb +4 -2
- data/spec/features/campaigns_spec.rb +5 -5
- data/spec/features/contacts_spec.rb +11 -5
- data/spec/features/dashboard_spec.rb +8 -8
- data/spec/features/devise/sign_in_spec.rb +58 -0
- data/spec/features/devise/sign_up_spec.rb +36 -0
- data/spec/features/leads_spec.rb +5 -5
- data/spec/features/opportunities_overview_spec.rb +16 -16
- data/spec/features/opportunities_spec.rb +35 -9
- data/spec/features/support/autocomlete_helper.rb +17 -0
- data/spec/features/support/browser.rb +5 -9
- data/spec/features/tasks_spec.rb +5 -5
- data/spec/helpers/admin/field_groups_helper_spec.rb +1 -1
- data/spec/helpers/application_helper_spec.rb +1 -1
- data/spec/helpers/tasks_helper_spec.rb +1 -1
- data/spec/helpers/users_helper_spec.rb +7 -7
- data/spec/lib/comment_extensions_spec.rb +11 -5
- data/spec/lib/errors_spec.rb +2 -2
- data/spec/lib/mail_processor/base_spec.rb +3 -3
- data/spec/lib/mail_processor/comment_replies_spec.rb +3 -3
- data/spec/lib/mail_processor/dropbox_spec.rb +17 -17
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +8 -8
- data/spec/lib/permissions_spec.rb +15 -28
- data/spec/mailers/devise_mailer_spec.rb +35 -0
- data/spec/mailers/user_mailer_spec.rb +6 -32
- data/spec/models/entities/account_spec.rb +58 -32
- data/spec/models/entities/campaign_spec.rb +18 -25
- data/spec/models/entities/contact_spec.rb +113 -21
- data/spec/models/entities/lead_spec.rb +9 -11
- data/spec/models/entities/opportunity_spec.rb +45 -45
- data/spec/models/fields/custom_field_date_pair_spec.rb +4 -2
- data/spec/models/fields/custom_field_spec.rb +21 -19
- data/spec/models/list_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +7 -7
- data/spec/models/polymorphic/address_spec.rb +1 -1
- data/spec/models/polymorphic/avatar_spec.rb +5 -5
- data/spec/models/polymorphic/comment_spec.rb +5 -5
- data/spec/models/polymorphic/task_spec.rb +65 -58
- data/spec/models/polymorphic/version_spec.rb +31 -31
- data/spec/models/setting_spec.rb +2 -2
- data/spec/models/users/preference_spec.rb +6 -6
- data/spec/models/users/user_spec.rb +46 -50
- data/spec/routing/users_routing_spec.rb +30 -8
- data/spec/shared/controllers.rb +3 -9
- data/spec/shared/models.rb +22 -22
- data/spec/spec_helper.rb +12 -4
- data/spec/support/assert_select.rb +1 -0
- data/spec/support/devise_helpers.rb +28 -0
- data/spec/{features/support/helpers.rb → support/feature_helpers.rb} +11 -11
- data/spec/support/macros.rb +7 -4
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +3 -3
- data/spec/views/accounts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/accounts/edit.js.haml_spec.rb +2 -2
- data/spec/views/accounts/index.haml_spec.rb +2 -2
- data/spec/views/accounts/index.js.haml_spec.rb +1 -1
- data/spec/views/accounts/show.haml_spec.rb +4 -4
- data/spec/views/accounts/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/destroy.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/edit.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/index.haml_spec.rb +1 -1
- data/spec/views/admin/users/index.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -1
- data/spec/views/application/auto_complete.haml_spec.rb +3 -3
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +4 -4
- data/spec/views/campaigns/index.haml_spec.rb +1 -1
- data/spec/views/campaigns/index.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/show.haml_spec.rb +4 -4
- data/spec/views/campaigns/update.js.haml_spec.rb +2 -2
- data/spec/views/contacts/_edit.haml_spec.rb +7 -7
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +5 -5
- data/spec/views/contacts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/contacts/edit.js.haml_spec.rb +4 -4
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/index.js.html_spec.rb +2 -2
- data/spec/views/contacts/new.js.haml_spec.rb +1 -1
- data/spec/views/contacts/show.haml_spec.rb +3 -3
- data/spec/views/contacts/update.js.haml_spec.rb +5 -5
- data/spec/views/home/index.haml_spec.rb +1 -1
- data/spec/views/home/index.js.haml_spec.rb +1 -1
- data/spec/views/home/options.js.haml_spec.rb +2 -2
- data/spec/views/leads/_convert.haml_spec.rb +3 -3
- data/spec/views/leads/_edit.haml_spec.rb +2 -2
- data/spec/views/leads/_new.haml_spec.rb +2 -2
- data/spec/views/leads/_sidebar_show.haml_spec.rb +5 -5
- data/spec/views/leads/convert.js.haml_spec.rb +4 -4
- data/spec/views/leads/create.js.haml_spec.rb +5 -5
- data/spec/views/leads/destroy.js.haml_spec.rb +2 -2
- data/spec/views/leads/edit.js.haml_spec.rb +4 -4
- data/spec/views/leads/index.haml_spec.rb +1 -1
- data/spec/views/leads/index.js.haml_spec.rb +1 -1
- data/spec/views/leads/new.js.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +7 -7
- data/spec/views/leads/reject.js.haml_spec.rb +2 -2
- data/spec/views/leads/show.haml_spec.rb +2 -2
- data/spec/views/leads/update.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/_edit.haml_spec.rb +7 -7
- data/spec/views/opportunities/_new.haml_spec.rb +2 -2
- data/spec/views/opportunities/create.js.haml_spec.rb +6 -6
- data/spec/views/opportunities/destroy.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/edit.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/index.haml_spec.rb +1 -1
- data/spec/views/opportunities/index.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/new.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/show.haml_spec.rb +3 -3
- data/spec/views/opportunities/update.js.haml_spec.rb +5 -5
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +4 -4
- data/spec/views/tasks/create.js.haml_spec.rb +6 -6
- data/spec/views/tasks/destroy.js.haml_spec.rb +2 -2
- data/spec/views/tasks/index.haml_spec.rb +4 -4
- data/spec/views/tasks/new.js.haml_spec.rb +1 -1
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +2 -2
- data/spec/views/tasks/update.js.haml_spec.rb +18 -18
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- metadata +49 -71
- data/app/controllers/authentications_controller.rb +0 -53
- data/app/models/users/authentication.rb +0 -56
- data/app/views/authentications/new.html.haml +0 -19
- data/app/views/passwords/edit.html.haml +0 -15
- data/app/views/passwords/new.html.haml +0 -10
- data/app/views/user_mailer/password_reset_instructions.html.haml +0 -6
- data/app/views/users/new.html.haml +0 -19
- data/spec/controllers/authentications_controller_spec.rb +0 -150
- data/spec/controllers/passwords_controller_spec.rb +0 -32
- data/spec/models/users/authentication_spec.rb +0 -19
- data/spec/support/auth_macros.rb +0 -49
- data/spec/views/authentications/new.haml_spec.rb +0 -31
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Contacts', '
|
11
11
|
In order to increase customer satisfaction
|
@@ -17,7 +17,7 @@ feature 'Contacts', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should view a list of contacts' do
|
20
|
-
4.times { |i|
|
20
|
+
4.times { |i| create(:contact, first_name: "Test", last_name: "Subject \##{i}") }
|
21
21
|
visit contacts_page
|
22
22
|
expect(contacts_element).to have_content('Test Subject #0')
|
23
23
|
expect(contacts_element).to have_content('Test Subject #1')
|
@@ -30,6 +30,9 @@ feature 'Contacts', '
|
|
30
30
|
with_versioning do
|
31
31
|
visit contacts_page
|
32
32
|
click_link 'Create Contact'
|
33
|
+
select = find('#account_name', visible: true)
|
34
|
+
expect(select).to have_text("")
|
35
|
+
expect(page).to have_selector('#select2-account_id-container', visible: false)
|
33
36
|
expect(page).to have_selector('#contact_first_name', visible: true)
|
34
37
|
fill_in 'contact_first_name', with: 'Testy'
|
35
38
|
fill_in 'contact_last_name', with: 'McTest'
|
@@ -62,11 +65,14 @@ feature 'Contacts', '
|
|
62
65
|
end
|
63
66
|
|
64
67
|
scenario 'should view and edit a contact', js: true do
|
65
|
-
|
68
|
+
create(:contact, first_name: "Testy", last_name: "McTest", account: create(:account, name: "Toast"))
|
66
69
|
with_versioning do
|
67
70
|
visit contacts_page
|
68
71
|
click_link 'Testy McTest'
|
69
72
|
click_link 'Edit'
|
73
|
+
select = find('#select2-account_id-container', visible: true)
|
74
|
+
expect(select).to have_text("Toast")
|
75
|
+
expect(page).to have_selector('#account_name', visible: false)
|
70
76
|
fill_in 'contact_first_name', with: 'Test'
|
71
77
|
fill_in 'contact_last_name', with: 'Subject'
|
72
78
|
fill_in 'contact_email', with: "test.subject@example.com"
|
@@ -79,7 +85,7 @@ feature 'Contacts', '
|
|
79
85
|
end
|
80
86
|
|
81
87
|
scenario 'should delete a contact', js: true do
|
82
|
-
|
88
|
+
create(:contact, first_name: "Test", last_name: "Subject")
|
83
89
|
visit contacts_page
|
84
90
|
click_link 'Test Subject'
|
85
91
|
click_link 'Delete?'
|
@@ -90,7 +96,7 @@ feature 'Contacts', '
|
|
90
96
|
end
|
91
97
|
|
92
98
|
scenario 'should search for a contact', js: true do
|
93
|
-
2.times { |i|
|
99
|
+
2.times { |i| create(:contact, first_name: "Test", last_name: "Subject \##{i}") }
|
94
100
|
visit contacts_page
|
95
101
|
expect(contacts_element).to have_content('Test Subject #0')
|
96
102
|
expect(contacts_element).to have_content('Test Subject #1')
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Dashboard', '
|
11
11
|
In order to monitor activity
|
@@ -13,12 +13,12 @@ feature 'Dashboard', '
|
|
13
13
|
I want to see a dashboard
|
14
14
|
' do
|
15
15
|
background do
|
16
|
-
@me =
|
16
|
+
@me = create(:user)
|
17
17
|
login_as_user(@me)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
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
22
|
end
|
23
23
|
|
24
24
|
scenario "Viewing my dashboard" do
|
@@ -42,9 +42,9 @@ feature 'Dashboard', '
|
|
42
42
|
|
43
43
|
scenario "Only show a maximum of 10 entities" do
|
44
44
|
10.times do
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
create(:task, assignee: @me)
|
46
|
+
create(:opportunity, assignee: @me, stage: 'proposal')
|
47
|
+
create(:account, assignee: @me)
|
48
48
|
end
|
49
49
|
|
50
50
|
visit homepage
|
@@ -0,0 +1,58 @@
|
|
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
|
@@ -0,0 +1,36 @@
|
|
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
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Leads', '
|
11
11
|
In order to increase sales
|
@@ -17,7 +17,7 @@ feature 'Leads', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should view a list of leads' do
|
20
|
-
4.times { |i|
|
20
|
+
4.times { |i| create(:lead, first_name: "L", last_name: "Ead #{i}") }
|
21
21
|
visit leads_page
|
22
22
|
expect(leads_element).to have_content('L Ead 0')
|
23
23
|
expect(leads_element).to have_content('L Ead 1')
|
@@ -70,7 +70,7 @@ feature 'Leads', '
|
|
70
70
|
end
|
71
71
|
|
72
72
|
scenario 'should view and edit a lead', js: true do
|
73
|
-
|
73
|
+
create(:lead, first_name: "Mr", last_name: "Lead", email: "mr_lead@example.com")
|
74
74
|
with_versioning do
|
75
75
|
visit leads_page
|
76
76
|
click_link 'Mr Lead'
|
@@ -89,7 +89,7 @@ feature 'Leads', '
|
|
89
89
|
end
|
90
90
|
|
91
91
|
scenario 'should delete a lead', js: true do
|
92
|
-
|
92
|
+
create(:lead, first_name: "Mr", last_name: "Lead", email: "mr_lead@example.com")
|
93
93
|
visit leads_page
|
94
94
|
click_link 'Mr Lead'
|
95
95
|
click_link 'Delete?'
|
@@ -101,7 +101,7 @@ feature 'Leads', '
|
|
101
101
|
end
|
102
102
|
|
103
103
|
scenario 'should search for a lead', js: true do
|
104
|
-
2.times { |i|
|
104
|
+
2.times { |i| create(:lead, first_name: "Lead", last_name: "\##{i}", email: "lead#{i}@example.com") }
|
105
105
|
visit leads_page
|
106
106
|
expect(leads_element).to have_content('Lead #0')
|
107
107
|
expect(leads_element).to have_content('Lead #1')
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Opportunities Overview', "
|
11
11
|
In order to keep track of my team's responsibilities
|
@@ -13,7 +13,7 @@ feature 'Opportunities Overview', "
|
|
13
13
|
I want to see an overview of opportunities broken down by user
|
14
14
|
" do
|
15
15
|
background do
|
16
|
-
@me =
|
16
|
+
@me = create(:user)
|
17
17
|
|
18
18
|
login_as_user(@me)
|
19
19
|
end
|
@@ -28,18 +28,18 @@ feature 'Opportunities Overview', "
|
|
28
28
|
end
|
29
29
|
|
30
30
|
scenario "Viewing Opportunity Overview when all opportunities have been assigned" do
|
31
|
-
user1 =
|
32
|
-
|
33
|
-
|
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
34
|
|
35
|
-
user2 =
|
36
|
-
account1 =
|
37
|
-
|
38
|
-
|
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
39
|
|
40
|
-
user3 =
|
41
|
-
|
42
|
-
|
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
43
|
|
44
44
|
visit opportunity_overview_page
|
45
45
|
|
@@ -61,8 +61,8 @@ feature 'Opportunities Overview', "
|
|
61
61
|
end
|
62
62
|
|
63
63
|
scenario "Viewing Opportunity Overview when all opportunities are unassigned" do
|
64
|
-
|
65
|
-
|
64
|
+
create(:opportunity, name: "Acting", stage: 'prospecting', assignee: nil)
|
65
|
+
create(:opportunity, name: "Presenting", stage: 'won', assignee: nil)
|
66
66
|
|
67
67
|
visit opportunity_overview_page
|
68
68
|
|
@@ -74,8 +74,8 @@ feature 'Opportunities Overview', "
|
|
74
74
|
end
|
75
75
|
|
76
76
|
scenario "Viewing Opportunity Overview when there are no opportunities in the pipeline" do
|
77
|
-
|
78
|
-
|
77
|
+
create(:opportunity, name: "Presenting", stage: 'lost', assignee: create(:user))
|
78
|
+
create(:opportunity, name: "Eating", stage: 'won', assignee: nil)
|
79
79
|
|
80
80
|
visit opportunity_overview_page
|
81
81
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(
|
8
|
+
require File.expand_path('acceptance_helper.rb', __dir__)
|
9
9
|
|
10
10
|
feature 'Opportunities', '
|
11
11
|
In order to increase sales
|
@@ -17,7 +17,7 @@ feature 'Opportunities', '
|
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'should view a list of opportunities' do
|
20
|
-
3.times { |i|
|
20
|
+
3.times { |i| create(:opportunity, name: "Opportunity #{i}") }
|
21
21
|
visit opportunities_page
|
22
22
|
expect(page).to have_content('Opportunity 0')
|
23
23
|
expect(page).to have_content('Opportunity 1')
|
@@ -26,13 +26,18 @@ feature 'Opportunities', '
|
|
26
26
|
end
|
27
27
|
|
28
28
|
scenario 'should create a new opportunity', js: true do
|
29
|
-
|
29
|
+
create(:account, name: 'Example Account')
|
30
30
|
with_versioning do
|
31
31
|
visit opportunities_page
|
32
32
|
click_link 'Create Opportunity'
|
33
33
|
expect(page).to have_selector('#opportunity_name', visible: true)
|
34
34
|
fill_in 'opportunity_name', with: 'My Awesome Opportunity'
|
35
|
-
|
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')
|
36
41
|
select 'Prospecting', from: 'opportunity_stage'
|
37
42
|
click_link 'Comment'
|
38
43
|
fill_in 'comment_body', with: 'This is a very important opportunity.'
|
@@ -48,6 +53,17 @@ feature 'Opportunities', '
|
|
48
53
|
end
|
49
54
|
end
|
50
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
|
+
|
51
67
|
scenario "remembers the comment field when the creation was unsuccessful", js: true do
|
52
68
|
visit opportunities_page
|
53
69
|
click_link 'Create Opportunity'
|
@@ -61,9 +77,9 @@ feature 'Opportunities', '
|
|
61
77
|
end
|
62
78
|
|
63
79
|
scenario 'should view and edit an opportunity', js: true do
|
64
|
-
|
65
|
-
|
66
|
-
|
80
|
+
create(:account, name: 'Example Account')
|
81
|
+
create(:account, name: 'Other Example Account')
|
82
|
+
create(:opportunity, name: 'A Cool Opportunity')
|
67
83
|
with_versioning do
|
68
84
|
visit opportunities_page
|
69
85
|
click_link 'A Cool Opportunity'
|
@@ -79,7 +95,7 @@ feature 'Opportunities', '
|
|
79
95
|
end
|
80
96
|
|
81
97
|
scenario 'should delete an opportunity', js: true do
|
82
|
-
|
98
|
+
create(:opportunity, name: 'Outdated Opportunity')
|
83
99
|
visit opportunities_page
|
84
100
|
click_link 'Outdated Opportunity'
|
85
101
|
click_link 'Delete?'
|
@@ -89,7 +105,7 @@ feature 'Opportunities', '
|
|
89
105
|
end
|
90
106
|
|
91
107
|
scenario 'should search for an opportunity', js: true do
|
92
|
-
2.times { |i|
|
108
|
+
2.times { |i| create(:opportunity, name: "Opportunity #{i}") }
|
93
109
|
visit opportunities_page
|
94
110
|
expect(find('#opportunities')).to have_content("Opportunity 0")
|
95
111
|
expect(find('#opportunities')).to have_content("Opportunity 1")
|
@@ -103,4 +119,14 @@ feature 'Opportunities', '
|
|
103
119
|
expect(find('#opportunities')).not_to have_content("Opportunity 0")
|
104
120
|
expect(find('#opportunities')).not_to have_content("Opportunity 1")
|
105
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
|
106
132
|
end
|
@@ -0,0 +1,17 @@
|
|
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
|
@@ -5,12 +5,13 @@
|
|
5
5
|
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
Capaybara.app_host = ENV['APP_URL'] if ENV['APP_URL']
|
9
|
+
Capybara.default_max_wait_time = 7
|
10
|
+
Capybara.server = :webrick
|
11
|
+
|
11
12
|
if ENV['BROWSER'] == 'chrome'
|
12
13
|
Capybara.register_driver :selenium do |app|
|
13
|
-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: [
|
14
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: %w[no-sandbox headless disable-gpu] })
|
14
15
|
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
|
15
16
|
end
|
16
17
|
else
|
@@ -21,8 +22,3 @@ else
|
|
21
22
|
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options, desired_capabilities: capabilities)
|
22
23
|
end
|
23
24
|
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# Default timeout for extended for AJAX based application
|
27
|
-
#
|
28
|
-
Capybara.default_max_wait_time = 7
|