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,44 +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 "/accounts/new" do
|
11
|
-
include AccountsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
assign(:account, Account.new(user: current_user))
|
16
|
-
assign(:users, [current_user])
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should toggle empty message div if it exists" do
|
20
|
-
render
|
21
|
-
|
22
|
-
expect(rendered).to include("crm.flick('empty', 'toggle')")
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "new account" do
|
26
|
-
it "should render [new] template into :create_account div" do
|
27
|
-
params[:cancel] = nil
|
28
|
-
render
|
29
|
-
|
30
|
-
expect(rendered).to include("#create_account")
|
31
|
-
expect(rendered).to include("crm.flip_form('create_account');")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "cancel new account" do
|
36
|
-
it "should hide [create account] form()" do
|
37
|
-
params[:cancel] = "true"
|
38
|
-
render
|
39
|
-
|
40
|
-
expect(rendered).not_to include("#create_account")
|
41
|
-
expect(rendered).to include("crm.flip_form('create_account');")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,38 +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 "/accounts/show" do
|
11
|
-
include AccountsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
@account = create(:account, id: 42,
|
16
|
-
contacts: [create(:contact)],
|
17
|
-
opportunities: [create(:opportunity)])
|
18
|
-
assign(:account, @account)
|
19
|
-
assign(:users, [current_user])
|
20
|
-
assign(:comment, Comment.new)
|
21
|
-
assign(:timeline, [create(:comment, commentable: @account)])
|
22
|
-
|
23
|
-
# controller#controller_name and controller#action_name are not set in view specs
|
24
|
-
allow(view).to receive(:template_for_current_view).and_return(nil)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should render account landing page" do
|
28
|
-
render
|
29
|
-
|
30
|
-
expect(view).to render_template(partial: "comments/_new")
|
31
|
-
expect(view).to render_template(partial: "shared/_timeline")
|
32
|
-
expect(view).to render_template(partial: "shared/_tasks")
|
33
|
-
expect(view).to render_template(partial: "contacts/_contact")
|
34
|
-
expect(view).to render_template(partial: "opportunities/_opportunity")
|
35
|
-
|
36
|
-
expect(rendered).to have_tag("div[id=edit_account]")
|
37
|
-
end
|
38
|
-
end
|
@@ -1,93 +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 "/accounts/update" do
|
11
|
-
include AccountsHelper
|
12
|
-
|
13
|
-
before do
|
14
|
-
login
|
15
|
-
|
16
|
-
assign(:account, @account = build_stubbed(:account, user: current_user))
|
17
|
-
assign(:users, [current_user])
|
18
|
-
assign(:account_category_total, Hash.new(1))
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "no errors:" do
|
22
|
-
describe "on account landing page -" do
|
23
|
-
before do
|
24
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/123"
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should flip [edit_account] form" do
|
28
|
-
render
|
29
|
-
expect(rendered).not_to include("account_#{@account.id}")
|
30
|
-
expect(rendered).to include("crm.flip_form('edit_account'")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should update sidebar" do
|
34
|
-
render
|
35
|
-
expect(rendered).to include("$('#sidebar').html")
|
36
|
-
expect(rendered).to have_text("Recent Items")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "on accounts index page -" do
|
41
|
-
before do
|
42
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts"
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should update sidebar" do
|
46
|
-
render
|
47
|
-
expect(rendered).to include("#sidebar")
|
48
|
-
expect(rendered).to have_text("Account Categories")
|
49
|
-
expect(rendered).to have_text("Recent Items")
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should replace [edit_account] form with account partial and highlight it" do
|
53
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts"
|
54
|
-
render
|
55
|
-
|
56
|
-
expect(rendered).to include("#account_#{@account.id}")
|
57
|
-
expect(rendered).to include(%/$('#account_#{@account.id}').effect("highlight"/)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "validation errors:" do
|
63
|
-
before do
|
64
|
-
@account.errors.add(:name)
|
65
|
-
end
|
66
|
-
|
67
|
-
describe "on account landing page -" do
|
68
|
-
before do
|
69
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/123"
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should redraw the [edit_account] form" do
|
73
|
-
render
|
74
|
-
|
75
|
-
expect(rendered).to include("#edit_account")
|
76
|
-
expect(rendered).to include('focus()')
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "on accounts index page -" do
|
81
|
-
before do
|
82
|
-
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts"
|
83
|
-
end
|
84
|
-
|
85
|
-
it "should redraw the [edit_account] form" do
|
86
|
-
render
|
87
|
-
|
88
|
-
expect(rendered).to include("account_#{@account.id}")
|
89
|
-
expect(rendered).to include('focus()')
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
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 'spec_helper'
|
9
|
-
|
10
|
-
describe "admin/field_groups/create" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:field_group, field_group)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:field_group) { build_stubbed(:field_group, label: 'test') }
|
17
|
-
|
18
|
-
it "renders javascript" do
|
19
|
-
render
|
20
|
-
expect(view).to render_template("admin/field_groups/create")
|
21
|
-
expect(rendered).to have_text("$('##{field_group.klass_name.downcase}_create_field_group_arrow')")
|
22
|
-
expect(rendered).to have_text("$('##{dom_id(field_group)}').effect('highlight', { duration:1500 });")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "renders javascript for invalid field group" do
|
26
|
-
allow(field_group).to receive(:valid?).and_return(false)
|
27
|
-
render
|
28
|
-
expect(view).to render_template("admin/field_groups/create")
|
29
|
-
end
|
30
|
-
end
|
@@ -1,31 +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 "admin/field_groups/destroy" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:field_group, field_group)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:field_group) { build(:field_group) }
|
17
|
-
|
18
|
-
it "renders destroy javascript" do
|
19
|
-
allow(field_group).to receive(:destroyed?).and_return(true)
|
20
|
-
render
|
21
|
-
expect(view).to render_template("admin/field_groups/destroy")
|
22
|
-
expect(rendered).to have_text("slideUp(250)")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "renders 'not destroyed' javascript" do
|
26
|
-
render
|
27
|
-
expect(view).to render_template("admin/field_groups/destroy")
|
28
|
-
expect(rendered).to have_text("Field Group could not be deleted")
|
29
|
-
expect(rendered).to have_text("crm.flash('warning');")
|
30
|
-
end
|
31
|
-
end
|
@@ -1,24 +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 "admin/field_groups/edit" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:field_group, field_group)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:field_group) { build_stubbed(:field_group, label: 'test') }
|
17
|
-
|
18
|
-
it "renders javascript" do
|
19
|
-
render
|
20
|
-
expect(view).to render_template("admin/field_groups/edit")
|
21
|
-
expect(rendered).to have_text("crm.show_form('#{dom_id(field_group, :edit)}')")
|
22
|
-
expect(rendered).to have_text("$('##{dom_id(field_group, :edit)}').html")
|
23
|
-
end
|
24
|
-
end
|
@@ -1,25 +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 "admin/field_groups/new" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:field_group, field_group)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:field_group) { build_stubbed(:field_group, label: 'test') }
|
17
|
-
|
18
|
-
it "renders javascript" do
|
19
|
-
render
|
20
|
-
expect(view).to render_template("admin/field_groups/new")
|
21
|
-
expect(rendered).to have_text("crm.flick('empty', 'toggle')")
|
22
|
-
expect(rendered).to have_text("crm.flip_form('#{field_group.klass_name.downcase}_create_field_group')")
|
23
|
-
expect(rendered).to have_text("$('##{field_group.klass_name.downcase}_create_field_group').html")
|
24
|
-
end
|
25
|
-
end
|
@@ -1,29 +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 "admin/field_groups/update" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:field_group, field_group)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:field_group) { build_stubbed(:field_group, label: 'test') }
|
17
|
-
|
18
|
-
it "renders javascript" do
|
19
|
-
render
|
20
|
-
expect(view).to render_template("admin/field_groups/update")
|
21
|
-
expect(rendered).to have_text("crm.flip_form('#{dom_id(field_group, :edit)}');")
|
22
|
-
expect(rendered).to have_text("crm.set_title('#{dom_id(field_group)}'")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "renders javascript for invalid field group" do
|
26
|
-
allow(field_group.errors).to receive(:empty?).and_return(false)
|
27
|
-
render
|
28
|
-
end
|
29
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require 'spec_helper'
|
9
|
-
|
10
|
-
describe "admin/users/_new" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, User.new)
|
14
|
-
assign(:users, [current_user])
|
15
|
-
end
|
16
|
-
|
17
|
-
it "renders [Create User] form" do
|
18
|
-
render
|
19
|
-
expect(view).to render_template(partial: "admin/users/_profile")
|
20
|
-
|
21
|
-
expect(rendered).to have_tag("form[class=new_user]")
|
22
|
-
end
|
23
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "admin/users/create" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "create success" do
|
16
|
-
before do
|
17
|
-
assign(:user, @user = build_stubbed(:user))
|
18
|
-
assign(:users, [@user]) # .paginate
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should hide [Create User] form and insert user partial" do
|
22
|
-
render
|
23
|
-
expect(rendered).to include(@user.username)
|
24
|
-
expect(rendered).to include(%/$('#user_#{@user.id}').effect("highlight"/)
|
25
|
-
end
|
26
|
-
|
27
|
-
# it "should update pagination" do
|
28
|
-
# rendered.should include("#paginate")
|
29
|
-
# end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "create failure" do
|
33
|
-
it "should re-render [create] template in :create_user div" do
|
34
|
-
assign(:user, build(:user, username: nil)) # make it invalid
|
35
|
-
assign(:users, [current_user])
|
36
|
-
render
|
37
|
-
|
38
|
-
expect(rendered).to include('Please specify username')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
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 "admin/users/destroy" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
end
|
14
|
-
|
15
|
-
describe "user got deleted" do
|
16
|
-
before do
|
17
|
-
@user = create(:user)
|
18
|
-
@user.destroy
|
19
|
-
assign(:user, @user)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "blinds up destroyed user partial" do
|
23
|
-
render
|
24
|
-
|
25
|
-
expect(rendered).to include('slideUp')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "user was not deleted" do
|
30
|
-
before do
|
31
|
-
assign(:user, @user = build_stubbed(:user))
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should remove confirmation panel" do
|
35
|
-
render
|
36
|
-
|
37
|
-
expect(rendered).to include(%/crm.flick('#{dom_id(@user, :confirm)}', 'remove');/)
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should show flash message" do
|
41
|
-
render
|
42
|
-
|
43
|
-
expect(rendered).to include('flash')
|
44
|
-
expect(rendered).to include(%/crm.flash('warning')/)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "admin/users/edit" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, @user = build_stubbed(:user))
|
14
|
-
end
|
15
|
-
|
16
|
-
it "cancel replaces [Edit User] form with user partial" do
|
17
|
-
params[:cancel] = "true"
|
18
|
-
render
|
19
|
-
|
20
|
-
expect(rendered).to include("$('#user_#{@user.id}').replaceWith")
|
21
|
-
end
|
22
|
-
|
23
|
-
it "edit hides previously open [Edit User] and replaces it with user partial" do
|
24
|
-
assign(:previous, previous = build_stubbed(:user))
|
25
|
-
render
|
26
|
-
|
27
|
-
expect(rendered).to include("user_#{previous.id}")
|
28
|
-
end
|
29
|
-
|
30
|
-
it "edit removes previously open [Edit User] if it's no longer available" do
|
31
|
-
assign(:previous, previous = 41)
|
32
|
-
render
|
33
|
-
|
34
|
-
expect(rendered).to include(%/crm.flick('user_#{previous}', 'remove');/)
|
35
|
-
end
|
36
|
-
|
37
|
-
it "edit turns off highlight, hides [Create User] form, and replaces current user with [Edit User] form" do
|
38
|
-
render
|
39
|
-
|
40
|
-
expect(rendered).to include(%/crm.highlight_off('user_#{@user.id}');/)
|
41
|
-
expect(rendered).to include(%/crm.hide_form('create_user')/)
|
42
|
-
expect(rendered).to include("user_#{@user.id}")
|
43
|
-
end
|
44
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "/admin/users/index" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
end
|
14
|
-
|
15
|
-
it "renders a list of users" do
|
16
|
-
assign(:users, [build_stubbed(:user)].paginate)
|
17
|
-
|
18
|
-
render
|
19
|
-
expect(view).to render_template(partial: "_user")
|
20
|
-
expect(view).to render_template(partial: "shared/_paginate")
|
21
|
-
end
|
22
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "admin/users/index" do
|
11
|
-
before do
|
12
|
-
login
|
13
|
-
end
|
14
|
-
|
15
|
-
it "renders [admin/user] template with @users collection" do
|
16
|
-
amy = build_stubbed(:user)
|
17
|
-
bob = build_stubbed(:user)
|
18
|
-
assign(:users, [amy, bob].paginate)
|
19
|
-
|
20
|
-
render template: 'admin/users/index', formats: [:js]
|
21
|
-
|
22
|
-
expect(rendered).to include("id=\\'user_#{amy.id}\\'")
|
23
|
-
expect(rendered).to include("id=\\'user_#{bob.id}\\'")
|
24
|
-
expect(rendered).to include("$('#paginate')")
|
25
|
-
end
|
26
|
-
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 "admin/users/new" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, User.new)
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "new user" do
|
17
|
-
it "shows [create user] form" do
|
18
|
-
params[:cancel] = nil
|
19
|
-
render
|
20
|
-
|
21
|
-
expect(rendered).to include("$('#create_user').html")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "cancel new user" do
|
26
|
-
it "hides [create user] form" do
|
27
|
-
params[:cancel] = "true"
|
28
|
-
render
|
29
|
-
|
30
|
-
expect(rendered).to include("crm.set_title('create_user', 'Users');")
|
31
|
-
expect(rendered).to include("crm.flip_form('create_user');")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "admin/users/reactivate" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, @user = build_stubbed(:user, suspended_at: Time.now.yesterday))
|
14
|
-
end
|
15
|
-
|
16
|
-
it "reloads the requested user partial" do
|
17
|
-
render
|
18
|
-
|
19
|
-
expect(rendered).to include("user_#{@user.id}")
|
20
|
-
expect(rendered).to include(%/$('#user_#{@user.id}').effect("highlight"/)
|
21
|
-
end
|
22
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "/admin/users/show" do
|
11
|
-
before do
|
12
|
-
assign(:user, @user = stub_model(User))
|
13
|
-
end
|
14
|
-
|
15
|
-
it "renders attributes" do
|
16
|
-
render
|
17
|
-
end
|
18
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
|
4
|
-
#
|
5
|
-
# Fat Free CRM is freely distributable under the terms of MIT license.
|
6
|
-
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
|
-
#------------------------------------------------------------------------------
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
9
|
-
|
10
|
-
describe "admin/users/suspend" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, @user = build_stubbed(:user, suspended_at: nil))
|
14
|
-
end
|
15
|
-
|
16
|
-
it "reloads the requested user partial" do
|
17
|
-
render
|
18
|
-
|
19
|
-
expect(rendered).to include("user_#{@user.id}")
|
20
|
-
expect(rendered).to include(%/$('#user_#{@user.id}').effect("highlight"/)
|
21
|
-
end
|
22
|
-
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 "admin/users/update" do
|
11
|
-
before do
|
12
|
-
login_admin
|
13
|
-
assign(:user, @user = build_stubbed(:user))
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "no errors:" do
|
17
|
-
it "replaces [Edit User] form with user partial and highlights it" do
|
18
|
-
render
|
19
|
-
|
20
|
-
expect(rendered).to include("user_#{@user.id}")
|
21
|
-
expect(rendered).to include(%/$('#user_#{@user.id}').effect("highlight"/)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "validation errors:" do
|
26
|
-
before do
|
27
|
-
@user.errors.add(:name)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "redraws [Edit User] form" do
|
31
|
-
render
|
32
|
-
|
33
|
-
expect(rendered).to include("user_#{@user.id}")
|
34
|
-
expect(rendered).to include(%/$('#user_username').focus()/)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|