fat_free_crm 0.17.3 → 0.18.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/.dockerignore +11 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +30 -8
- data/.travis.yml +14 -9
- data/CHANGELOG.md +43 -7
- data/CONTRIBUTORS.md +95 -53
- data/Gemfile +11 -7
- data/Gemfile.lock +83 -83
- data/README.md +7 -4
- data/app/assets/javascripts/crm.js.coffee +3 -3
- data/app/assets/javascripts/crm_select2.js.coffee +15 -14
- data/app/controllers/admin/field_groups_controller.rb +8 -1
- 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 +1 -1
- data/app/controllers/application_controller.rb +11 -0
- data/app/controllers/authentications_controller.rb +1 -1
- data/app/controllers/comments_controller.rb +15 -7
- data/app/controllers/entities/campaigns_controller.rb +7 -2
- data/app/controllers/entities/leads_controller.rb +9 -2
- data/app/controllers/entities/opportunities_controller.rb +13 -2
- data/app/controllers/entities_controller.rb +10 -5
- data/app/controllers/lists_controller.rb +5 -1
- data/app/controllers/tasks_controller.rb +15 -1
- data/app/helpers/accounts_helper.rb +1 -1
- data/app/helpers/application_helper.rb +2 -2
- data/app/helpers/leads_helper.rb +1 -1
- data/app/helpers/opportunities_helper.rb +56 -3
- data/app/helpers/tags_helper.rb +1 -1
- data/app/models/entities/lead.rb +0 -7
- data/app/models/entities/opportunity.rb +3 -2
- data/app/models/observers/opportunity_observer.rb +4 -4
- data/app/models/users/ability.rb +3 -4
- data/app/views/campaigns/_metrics.html.haml +3 -3
- data/app/views/home/_opportunity.html.haml +4 -19
- 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/db/schema.rb +0 -3
- data/fat_free_crm.gemspec +1 -1
- 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/fields.rb +1 -1
- data/lib/fat_free_crm/permissions.rb +0 -14
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/tasks/ffcrm/setup.rake +4 -4
- data/spec/controllers/admin/users_controller_spec.rb +27 -27
- data/spec/controllers/authentications_controller_spec.rb +7 -7
- data/spec/controllers/comments_controller_spec.rb +13 -13
- 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 +67 -67
- data/spec/controllers/entities/leads_controller_spec.rb +125 -125
- data/spec/controllers/entities/opportunities_controller_spec.rb +100 -100
- data/spec/controllers/home_controller_spec.rb +26 -26
- data/spec/controllers/passwords_controller_spec.rb +1 -1
- data/spec/controllers/tasks_controller_spec.rb +37 -37
- data/spec/controllers/users_controller_spec.rb +18 -18
- data/spec/factories/account_factories.rb +8 -8
- data/spec/factories/campaign_factories.rb +5 -5
- data/spec/factories/contact_factories.rb +10 -10
- data/spec/factories/field_factories.rb +7 -7
- data/spec/factories/lead_factories.rb +8 -8
- data/spec/factories/list_factories.rb +1 -1
- data/spec/factories/opportunity_factories.rb +6 -6
- data/spec/factories/sequences.rb +1 -1
- data/spec/factories/setting_factories.rb +3 -3
- data/spec/factories/shared_factories.rb +14 -14
- data/spec/factories/subscription_factories.rb +1 -1
- data/spec/factories/tag_factories.rb +1 -1
- data/spec/factories/task_factories.rb +4 -4
- data/spec/factories/user_factories.rb +13 -13
- data/spec/features/accounts_spec.rb +17 -4
- data/spec/features/admin/groups_spec.rb +1 -1
- data/spec/features/admin/users_spec.rb +1 -1
- data/spec/features/campaigns_spec.rb +4 -4
- data/spec/features/contacts_spec.rb +10 -4
- data/spec/features/dashboard_spec.rb +7 -7
- data/spec/features/leads_spec.rb +4 -4
- data/spec/features/opportunities_overview_spec.rb +15 -15
- data/spec/features/opportunities_spec.rb +34 -8
- data/spec/features/support/autocomlete_helper.rb +17 -0
- data/spec/features/support/browser.rb +3 -8
- data/spec/features/support/helpers.rb +1 -1
- data/spec/features/tasks_spec.rb +4 -4
- 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 +3 -3
- data/spec/lib/comment_extensions_spec.rb +1 -1
- 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 +16 -16
- data/spec/lib/permissions_spec.rb +7 -25
- data/spec/mailers/user_mailer_spec.rb +7 -7
- data/spec/models/entities/account_spec.rb +31 -32
- data/spec/models/entities/campaign_spec.rb +18 -25
- data/spec/models/entities/contact_spec.rb +18 -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_spec.rb +17 -17
- data/spec/models/list_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +6 -6
- 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 +26 -26
- data/spec/models/setting_spec.rb +2 -2
- data/spec/models/users/preference_spec.rb +6 -6
- data/spec/models/users/user_spec.rb +26 -26
- data/spec/shared/models.rb +22 -22
- data/spec/spec_helper.rb +2 -2
- data/spec/support/auth_macros.rb +1 -1
- data/spec/support/macros.rb +3 -3
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +2 -2
- 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 +3 -3
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/index.haml_spec.rb +1 -1
- data/spec/views/campaigns/index.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/show.haml_spec.rb +4 -4
- data/spec/views/campaigns/update.js.haml_spec.rb +1 -1
- 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 +4 -4
- data/spec/views/contacts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/contacts/edit.js.haml_spec.rb +3 -3
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/index.js.html_spec.rb +1 -1
- 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 +2 -2
- 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 +4 -4
- 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 +5 -3
@@ -10,7 +10,7 @@ require 'spec_helper'
|
|
10
10
|
describe "/opportunities/destroy" do
|
11
11
|
before do
|
12
12
|
login
|
13
|
-
assign(:opportunity, @opportunity =
|
13
|
+
assign(:opportunity, @opportunity = build_stubbed(:opportunity))
|
14
14
|
assign(:stage, Setting.unroll(:opportunity_stage))
|
15
15
|
assign(:opportunity_stage_total, Hash.new(1))
|
16
16
|
end
|
@@ -39,7 +39,7 @@ describe "/opportunities/destroy" do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should update related account sidebar when called from related account" do
|
42
|
-
assign(:account, account =
|
42
|
+
assign(:account, account = build_stubbed(:account))
|
43
43
|
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/#{account.id}"
|
44
44
|
render
|
45
45
|
|
@@ -49,7 +49,7 @@ describe "/opportunities/destroy" do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should update related campaign sidebar when called from related campaign" do
|
52
|
-
assign(:campaign, campaign =
|
52
|
+
assign(:campaign, campaign = build_stubbed(:campaign))
|
53
53
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/#{campaign.id}"
|
54
54
|
render
|
55
55
|
|
@@ -13,9 +13,9 @@ describe "/opportunities/edit" do
|
|
13
13
|
before do
|
14
14
|
login
|
15
15
|
|
16
|
-
assign(:opportunity, @opportunity =
|
16
|
+
assign(:opportunity, @opportunity = build_stubbed(:opportunity, user: current_user))
|
17
17
|
assign(:users, [current_user])
|
18
|
-
assign(:account, @account =
|
18
|
+
assign(:account, @account = build_stubbed(:account))
|
19
19
|
assign(:accounts, [@account])
|
20
20
|
assign(:stage, Setting.unroll(:opportunity_stage))
|
21
21
|
end
|
@@ -37,7 +37,7 @@ describe "/opportunities/edit" do
|
|
37
37
|
|
38
38
|
it "edit: should hide previously open [Edit Opportunity] for and replace it with opportunity partial" do
|
39
39
|
params[:cancel] = nil
|
40
|
-
assign(:previous, previous =
|
40
|
+
assign(:previous, previous = build_stubbed(:opportunity, user: current_user))
|
41
41
|
|
42
42
|
render
|
43
43
|
expect(rendered).to include("$('#opportunity_#{previous.id}').replaceWith")
|
@@ -20,7 +20,7 @@ describe "/opportunities/index" do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should render list of accounts if list of opportunities is not empty" do
|
23
|
-
assign(:opportunities, [
|
23
|
+
assign(:opportunities, [build_stubbed(:opportunity)].paginate)
|
24
24
|
|
25
25
|
render
|
26
26
|
expect(view).to render_template(partial: "_opportunity")
|
@@ -16,7 +16,7 @@ describe "/opportunities/index" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should render [opportunity] template with @opportunities collection if there are opportunities" do
|
19
|
-
assign(:opportunities, [
|
19
|
+
assign(:opportunities, [build_stubbed(:opportunity, id: 42)].paginate)
|
20
20
|
|
21
21
|
render template: 'opportunities/index', formats: [:js]
|
22
22
|
|
@@ -12,7 +12,7 @@ describe "/opportunities/new" do
|
|
12
12
|
|
13
13
|
before do
|
14
14
|
login
|
15
|
-
@account =
|
15
|
+
@account = build_stubbed(:account)
|
16
16
|
assign(:opportunity, Opportunity.new(user: current_user))
|
17
17
|
assign(:users, [current_user])
|
18
18
|
assign(:account, @account)
|
@@ -12,12 +12,12 @@ describe "/opportunities/show" do
|
|
12
12
|
|
13
13
|
before do
|
14
14
|
login
|
15
|
-
@opportunity =
|
16
|
-
|
15
|
+
@opportunity = create(:opportunity, id: 42,
|
16
|
+
contacts: [create(:contact)])
|
17
17
|
assign(:opportunity, @opportunity)
|
18
18
|
assign(:users, [current_user])
|
19
19
|
assign(:comment, Comment.new)
|
20
|
-
assign(:timeline, [
|
20
|
+
assign(:timeline, [create(:comment, commentable: @opportunity)])
|
21
21
|
|
22
22
|
# controller#controller_name and controller#action_name are not set in view specs
|
23
23
|
allow(view).to receive(:template_for_current_view).and_return(nil)
|
@@ -11,9 +11,9 @@ describe "/opportunities/update" do
|
|
11
11
|
before do
|
12
12
|
login
|
13
13
|
|
14
|
-
assign(:opportunity, @opportunity =
|
14
|
+
assign(:opportunity, @opportunity = build_stubbed(:opportunity, user: current_user, assignee: build_stubbed(:user)))
|
15
15
|
assign(:users, [current_user])
|
16
|
-
assign(:account, @account =
|
16
|
+
assign(:account, @account = build_stubbed(:account))
|
17
17
|
assign(:accounts, [@account])
|
18
18
|
assign(:stage, Setting.unroll(:opportunity_stage))
|
19
19
|
assign(:opportunity_stage_total, Hash.new(1))
|
@@ -62,7 +62,7 @@ describe "/opportunities/update" do
|
|
62
62
|
|
63
63
|
describe "on related asset page -" do
|
64
64
|
it "should update account sidebar" do
|
65
|
-
assign(:account, account =
|
65
|
+
assign(:account, account = build_stubbed(:account))
|
66
66
|
controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/#{account.id}"
|
67
67
|
render
|
68
68
|
|
@@ -72,7 +72,7 @@ describe "/opportunities/update" do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should update campaign sidebar" do
|
75
|
-
assign(:campaign, campaign =
|
75
|
+
assign(:campaign, campaign = build_stubbed(:campaign))
|
76
76
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/#{campaign.id}"
|
77
77
|
render
|
78
78
|
|
@@ -12,7 +12,7 @@ describe "/tasks/_edit" do
|
|
12
12
|
|
13
13
|
before do
|
14
14
|
login
|
15
|
-
assign(:task,
|
15
|
+
assign(:task, build_stubbed(:task, asset: build_stubbed(:account), bucket: "due_asap"))
|
16
16
|
assign(:users, [current_user])
|
17
17
|
assign(:bucket, %w[due_asap due_today])
|
18
18
|
assign(:category, %w[meeting money])
|
@@ -17,7 +17,7 @@ describe "/tasks/complete" do
|
|
17
17
|
|
18
18
|
describe "complete from Tasks tab (pending view)" do
|
19
19
|
before do
|
20
|
-
@task =
|
20
|
+
@task = build_stubbed(:task)
|
21
21
|
assign(:task, @task)
|
22
22
|
assign(:view, "pending")
|
23
23
|
assign(:empty_bucket, :due_asap)
|
@@ -33,7 +33,7 @@ describe "/tasks/complete" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should update tasks sidebar" do
|
36
|
-
assign(:task,
|
36
|
+
assign(:task, build_stubbed(:task))
|
37
37
|
assign(:view, "pending")
|
38
38
|
assign(:empty_bucket, :due_asap)
|
39
39
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"
|
@@ -48,7 +48,7 @@ describe "/tasks/complete" do
|
|
48
48
|
|
49
49
|
describe "complete from related asset" do
|
50
50
|
it "should replace pending partial with the completed one" do
|
51
|
-
@task =
|
51
|
+
@task = build_stubbed(:task, completed_at: Time.now, completor: current_user)
|
52
52
|
assign(:task, @task)
|
53
53
|
|
54
54
|
render
|
@@ -57,7 +57,7 @@ describe "/tasks/complete" do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "should update recently viewed items" do
|
60
|
-
@task =
|
60
|
+
@task = build_stubbed(:task, completed_at: Time.now, completor: current_user)
|
61
61
|
assign(:task, @task)
|
62
62
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads/123"
|
63
63
|
|
@@ -48,7 +48,7 @@ describe "/tasks/create" do
|
|
48
48
|
|
49
49
|
it "should show flash message when assigning a task from pending tasks view" do
|
50
50
|
assign(:view, "pending")
|
51
|
-
assign(:task,
|
51
|
+
assign(:task, build_stubbed(:task, id: 42, assignee: build_stubbed(:user)))
|
52
52
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"
|
53
53
|
render
|
54
54
|
|
@@ -58,7 +58,7 @@ describe "/tasks/create" do
|
|
58
58
|
|
59
59
|
it "should update recent items when assigning a task from pending tasks view" do
|
60
60
|
assign(:view, "pending")
|
61
|
-
assign(:task,
|
61
|
+
assign(:task, build_stubbed(:task, id: 42, assignee: build_stubbed(:user)))
|
62
62
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"
|
63
63
|
render
|
64
64
|
|
@@ -68,7 +68,7 @@ describe "/tasks/create" do
|
|
68
68
|
|
69
69
|
it "should show flash message when creating a pending task from assigned tasks view" do
|
70
70
|
assign(:view, "assigned")
|
71
|
-
assign(:task,
|
71
|
+
assign(:task, build_stubbed(:task, id: 42, assignee: nil))
|
72
72
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks?view=assigned"
|
73
73
|
render
|
74
74
|
|
@@ -78,7 +78,7 @@ describe "/tasks/create" do
|
|
78
78
|
|
79
79
|
it "should update recent items when creating a pending task from assigned tasks view" do
|
80
80
|
assign(:view, "assigned")
|
81
|
-
assign(:task,
|
81
|
+
assign(:task, build_stubbed(:task, id: 42, assignee: nil))
|
82
82
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks?view=assigned"
|
83
83
|
render
|
84
84
|
|
@@ -89,7 +89,7 @@ describe "/tasks/create" do
|
|
89
89
|
(TASK_STATUSES - ['assigned']).each do |status|
|
90
90
|
describe "create from outside the Tasks tab" do
|
91
91
|
before do
|
92
|
-
@task =
|
92
|
+
@task = build_stubbed(:task, id: 42)
|
93
93
|
assign(:view, status)
|
94
94
|
assign(:task, @task)
|
95
95
|
render
|
@@ -112,7 +112,7 @@ describe "/tasks/create" do
|
|
112
112
|
end
|
113
113
|
|
114
114
|
it "create failure: should re-render [create] template in :create_task div" do
|
115
|
-
assign(:task,
|
115
|
+
assign(:task, build(:task, name: nil)) # make it invalid
|
116
116
|
render
|
117
117
|
|
118
118
|
expect(rendered).to include(%/$('#create_task').effect("shake"/)
|
@@ -17,7 +17,7 @@ describe "/tasks/destroy" do
|
|
17
17
|
TASK_STATUSES.each do |status|
|
18
18
|
describe "destroy from Tasks tab (#{status} view)" do
|
19
19
|
before do
|
20
|
-
@task =
|
20
|
+
@task = build_stubbed(:task)
|
21
21
|
assign(:task, @task)
|
22
22
|
assign(:view, status)
|
23
23
|
assign(:empty_bucket, :due_asap)
|
@@ -46,7 +46,7 @@ describe "/tasks/destroy" do
|
|
46
46
|
|
47
47
|
describe "destroy from related asset" do
|
48
48
|
it "should blind up out destroyed task partial" do
|
49
|
-
@task =
|
49
|
+
@task = build_stubbed(:task)
|
50
50
|
assign(:task, @task)
|
51
51
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads/123"
|
52
52
|
|
@@ -16,10 +16,10 @@ describe "/tasks/index" do
|
|
16
16
|
|
17
17
|
TASK_STATUSES.each do |status|
|
18
18
|
before do
|
19
|
-
user =
|
20
|
-
account =
|
21
|
-
@due =
|
22
|
-
@completed =
|
19
|
+
user = build_stubbed(:user)
|
20
|
+
account = build_stubbed(:account)
|
21
|
+
@due = build_stubbed(:task, asset: account, bucket: "due_asap", assignee: user)
|
22
|
+
@completed = build_stubbed(:task, asset: account, bucket: "completed_today", assignee: user, completed_at: 1.hour.ago, completor: user)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should render list of #{status} tasks if list of tasks is not empty" do
|
@@ -12,7 +12,7 @@ describe "/tasks/new" do
|
|
12
12
|
|
13
13
|
before do
|
14
14
|
login
|
15
|
-
assign(:task,
|
15
|
+
assign(:task, build(:task))
|
16
16
|
assign(:users, [current_user])
|
17
17
|
assign(:bucket, Setting.task_bucket[1..-1] << ["On Specific Date...", :specific_time])
|
18
18
|
assign(:category, Setting.unroll(:task_category))
|
@@ -17,7 +17,7 @@ describe "/tasks/uncomplete" do
|
|
17
17
|
|
18
18
|
describe "uncomplete from Tasks tab (completed view)" do
|
19
19
|
before do
|
20
|
-
@task =
|
20
|
+
@task = build_stubbed(:task)
|
21
21
|
assign(:task, @task)
|
22
22
|
assign(:view, "completed")
|
23
23
|
assign(:empty_bucket, :due_asap)
|
@@ -33,7 +33,7 @@ describe "/tasks/uncomplete" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should update tasks sidebar" do
|
36
|
-
assign(:task,
|
36
|
+
assign(:task, build_stubbed(:task))
|
37
37
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"
|
38
38
|
|
39
39
|
render
|
@@ -16,8 +16,8 @@ describe "/tasks/update" do
|
|
16
16
|
|
17
17
|
describe "Changing due date" do
|
18
18
|
before do
|
19
|
-
assign(:task_before_update,
|
20
|
-
assign(:task, @task =
|
19
|
+
assign(:task_before_update, build_stubbed(:task, bucket: "due_asap"))
|
20
|
+
assign(:task, @task = build_stubbed(:task, bucket: "due_tomorrow"))
|
21
21
|
assign(:view, "pending")
|
22
22
|
assign(:task_total, stub_task_total("pending"))
|
23
23
|
end
|
@@ -64,9 +64,9 @@ describe "/tasks/update" do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "pending task to somebody from Tasks tab: should remove the task and show flash message (assigned)" do
|
67
|
-
assignee =
|
68
|
-
assign(:task_before_update,
|
69
|
-
assign(:task, @task =
|
67
|
+
assignee = build_stubbed(:user)
|
68
|
+
assign(:task_before_update, build_stubbed(:task, assignee: nil))
|
69
|
+
assign(:task, @task = build_stubbed(:task, assignee: assignee))
|
70
70
|
assign(:view, "pending")
|
71
71
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"
|
72
72
|
|
@@ -78,9 +78,9 @@ describe "/tasks/update" do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it "assigned tasks to me from Tasks tab: should remove the task and show flash message (pending)" do
|
81
|
-
assignee =
|
82
|
-
assign(:task_before_update,
|
83
|
-
assign(:task, @task =
|
81
|
+
assignee = build_stubbed(:user)
|
82
|
+
assign(:task_before_update, build_stubbed(:task, assignee: assignee))
|
83
|
+
assign(:task, @task = build_stubbed(:task, assignee: nil))
|
84
84
|
assign(:view, "assigned")
|
85
85
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks?view=assigned"
|
86
86
|
|
@@ -92,8 +92,8 @@ describe "/tasks/update" do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
it "assigned tasks to somebody else from Tasks tab: should re-render task partial" do
|
95
|
-
assign(:task_before_update,
|
96
|
-
assign(:task, @task =
|
95
|
+
assign(:task_before_update, build_stubbed(:task, assignee: build_stubbed(:user)))
|
96
|
+
assign(:task, @task = build_stubbed(:task, assignee: build_stubbed(:user)))
|
97
97
|
assign(:view, "assigned")
|
98
98
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks?view=assigned"
|
99
99
|
|
@@ -102,8 +102,8 @@ describe "/tasks/update" do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
it "from Tasks tab: should update tasks sidebar" do
|
105
|
-
assign(:task_before_update,
|
106
|
-
assign(:task, @task =
|
105
|
+
assign(:task_before_update, build_stubbed(:task, assignee: nil))
|
106
|
+
assign(:task, @task = build_stubbed(:task, assignee: build_stubbed(:user)))
|
107
107
|
assign(:view, "assigned")
|
108
108
|
controller.request.env["HTTP_REFERER"] = "http://localhost/tasks?view=assigned"
|
109
109
|
render
|
@@ -115,16 +115,16 @@ describe "/tasks/update" do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it "from asset page: should should re-render task partial" do
|
118
|
-
assign(:task_before_update,
|
119
|
-
assign(:task, @task =
|
118
|
+
assign(:task_before_update, build_stubbed(:task, assignee: nil))
|
119
|
+
assign(:task, @task = build_stubbed(:task, assignee: build_stubbed(:user)))
|
120
120
|
render
|
121
121
|
|
122
122
|
expect(rendered).to include("$('#task_#{@task.id}').html('<li class=\\'highlight task\\' id=\\'task_#{@task.id}\\'")
|
123
123
|
end
|
124
124
|
|
125
125
|
it "from asset page: should update recently viewed items" do
|
126
|
-
assign(:task_before_update,
|
127
|
-
assign(:task, @task =
|
126
|
+
assign(:task_before_update, build_stubbed(:task, assignee: nil))
|
127
|
+
assign(:task, @task = build_stubbed(:task, assignee: build_stubbed(:user)))
|
128
128
|
render
|
129
129
|
|
130
130
|
expect(rendered).to have_text("Recent Items")
|
@@ -132,8 +132,8 @@ describe "/tasks/update" do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "error: should re-disiplay [Edit Task] form and shake it" do
|
135
|
-
assign(:task_before_update,
|
136
|
-
assign(:task, @task =
|
135
|
+
assign(:task_before_update, build_stubbed(:task))
|
136
|
+
assign(:task, @task = build_stubbed(:task))
|
137
137
|
@task.errors.add(:name)
|
138
138
|
|
139
139
|
render
|
@@ -16,7 +16,7 @@ describe "/users/upload_avatar" do
|
|
16
16
|
|
17
17
|
describe "no errors:" do
|
18
18
|
before do
|
19
|
-
@avatar =
|
19
|
+
@avatar = build_stubbed(:avatar, entity: current_user)
|
20
20
|
allow(current_user).to receive(:avatar).and_return(@avatar)
|
21
21
|
assign(:user, @user = current_user)
|
22
22
|
end
|
@@ -31,7 +31,7 @@ describe "/users/upload_avatar" do
|
|
31
31
|
|
32
32
|
describe "validation errors:" do
|
33
33
|
before do
|
34
|
-
@avatar =
|
34
|
+
@avatar = build_stubbed(:avatar, entity: current_user)
|
35
35
|
@avatar.errors.add(:image, "error")
|
36
36
|
allow_any_instance_of(User).to receive(:avatar).and_return(@avatar)
|
37
37
|
assign(:user, @user = current_user)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_free_crm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dvorkin
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-
|
15
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -548,6 +548,7 @@ extensions: []
|
|
548
548
|
extra_rdoc_files: []
|
549
549
|
files:
|
550
550
|
- ".docker/nginx/sites-enabled/ffcrm.conf"
|
551
|
+
- ".dockerignore"
|
551
552
|
- ".gitignore"
|
552
553
|
- ".rubocop.yml"
|
553
554
|
- ".rubocop_todo.yml"
|
@@ -1282,6 +1283,7 @@ files:
|
|
1282
1283
|
- spec/features/leads_spec.rb
|
1283
1284
|
- spec/features/opportunities_overview_spec.rb
|
1284
1285
|
- spec/features/opportunities_spec.rb
|
1286
|
+
- spec/features/support/autocomlete_helper.rb
|
1285
1287
|
- spec/features/support/browser.rb
|
1286
1288
|
- spec/features/support/headless.rb
|
1287
1289
|
- spec/features/support/helpers.rb
|
@@ -1573,7 +1575,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1573
1575
|
requirements:
|
1574
1576
|
- - ">="
|
1575
1577
|
- !ruby/object:Gem::Version
|
1576
|
-
version: 2.
|
1578
|
+
version: 2.4.0
|
1577
1579
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1578
1580
|
requirements:
|
1579
1581
|
- - ">="
|