fat_free_crm 0.19.2 → 0.20.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/.github/workflows/brakeman-analysis.yml +46 -0
- data/.github/workflows/rubocop-analysis.yml +40 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.rubocop_todo.yml +49 -43
- data/.travis.yml +1 -20
- data/CHANGELOG.md +13 -0
- data/Gemfile +9 -5
- data/Gemfile.lock +163 -119
- data/README.md +4 -3
- data/SECURITY.md +11 -0
- data/app/assets/javascripts/application.js.erb +3 -0
- data/app/assets/stylesheets/application.css.erb +1 -0
- data/app/assets/stylesheets/base.scss +9 -2
- data/app/assets/stylesheets/bootstrap-custom.scss +206 -0
- data/app/assets/stylesheets/common.scss +87 -67
- data/app/assets/stylesheets/header.scss +0 -8
- data/app/controllers/admin/field_groups_controller.rb +1 -1
- data/app/controllers/admin/fields_controller.rb +1 -1
- data/app/controllers/admin/groups_controller.rb +1 -1
- data/app/controllers/admin/tags_controller.rb +2 -2
- data/app/controllers/admin/users_controller.rb +2 -1
- data/app/controllers/application_controller.rb +10 -0
- data/app/controllers/comments_controller.rb +1 -1
- data/app/controllers/entities/accounts_controller.rb +1 -1
- data/app/controllers/entities/campaigns_controller.rb +1 -1
- data/app/controllers/home_controller.rb +3 -1
- data/app/controllers/lists_controller.rb +1 -1
- data/app/controllers/tasks_controller.rb +3 -3
- data/app/controllers/users_controller.rb +3 -1
- data/app/helpers/accounts_helper.rb +12 -0
- data/app/helpers/application_helper.rb +3 -5
- data/app/helpers/tasks_helper.rb +2 -2
- data/app/models/entities/account.rb +1 -1
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/entities/account_opportunity.rb +1 -1
- data/app/models/entities/campaign.rb +1 -1
- data/app/models/entities/contact.rb +1 -1
- data/app/models/entities/lead.rb +1 -1
- data/app/models/entities/opportunity.rb +1 -1
- data/app/models/fields/custom_field_pair.rb +2 -2
- data/app/models/observers/opportunity_observer.rb +1 -1
- data/app/models/polymorphic/address.rb +1 -1
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/polymorphic/email.rb +1 -1
- data/app/models/polymorphic/task.rb +1 -1
- data/app/models/setting.rb +4 -2
- data/app/models/users/preference.rb +2 -2
- data/app/models/users/user.rb +2 -2
- data/app/views/accounts/_edit.html.haml +2 -2
- data/app/views/accounts/_new.html.haml +2 -2
- data/app/views/accounts/_sidebar_index.html.haml +2 -2
- data/app/views/accounts/_sidebar_show.html.haml +19 -19
- data/app/views/accounts/create.js.haml +1 -2
- data/app/views/accounts/destroy.js.haml +1 -1
- data/app/views/accounts/show.html.haml +1 -0
- data/app/views/accounts/update.js.haml +2 -3
- data/app/views/admin/field_groups/create.js.haml +0 -1
- data/app/views/admin/field_groups/destroy.js.haml +0 -1
- data/app/views/admin/field_groups/update.js.haml +0 -1
- data/app/views/admin/fields/create.js.haml +0 -1
- data/app/views/admin/fields/destroy.js.haml +0 -1
- data/app/views/admin/fields/update.js.haml +0 -1
- data/app/views/admin/groups/create.js.haml +0 -1
- data/app/views/admin/groups/destroy.js.haml +0 -1
- data/app/views/admin/groups/update.js.haml +0 -1
- data/app/views/admin/tags/create.js.haml +0 -1
- data/app/views/admin/tags/destroy.js.haml +0 -1
- data/app/views/admin/tags/update.js.haml +0 -1
- data/app/views/admin/users/create.js.haml +0 -1
- data/app/views/admin/users/destroy.js.haml +0 -1
- data/app/views/admin/users/update.js.haml +0 -1
- data/app/views/campaigns/_edit.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -1
- data/app/views/campaigns/_sidebar_index.html.haml +2 -2
- data/app/views/campaigns/_sidebar_show.html.haml +68 -67
- data/app/views/campaigns/create.js.haml +1 -2
- data/app/views/campaigns/destroy.js.haml +1 -1
- data/app/views/campaigns/show.html.haml +1 -0
- data/app/views/campaigns/update.js.haml +3 -4
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +1 -1
- data/app/views/comments/update.js.haml +0 -1
- data/app/views/contacts/_edit.html.haml +1 -1
- data/app/views/contacts/_new.html.haml +1 -1
- data/app/views/contacts/_sidebar_show.html.haml +18 -18
- data/app/views/contacts/create.js.haml +0 -1
- data/app/views/contacts/destroy.js.haml +1 -1
- data/app/views/contacts/show.html.haml +1 -0
- data/app/views/contacts/update.js.haml +2 -3
- data/app/views/entities/_title_bar.html.haml +1 -1
- data/app/views/entities/attach.js.haml +2 -2
- data/app/views/entities/discard.js.haml +2 -2
- data/app/views/home/_opportunity.html.haml +1 -1
- data/app/views/home/_task.html.haml +1 -1
- data/app/views/home/index.xls.builder +51 -0
- data/app/views/layouts/_sidebar.html.haml +2 -2
- data/app/views/layouts/_tabbed.html.haml +14 -11
- data/app/views/layouts/application.html.haml +2 -2
- data/app/views/leads/_edit.html.haml +2 -2
- data/app/views/leads/_new.html.haml +2 -2
- data/app/views/leads/_sidebar_index.html.haml +2 -2
- data/app/views/leads/_sidebar_show.html.haml +30 -30
- data/app/views/leads/create.js.haml +2 -3
- data/app/views/leads/destroy.js.haml +2 -2
- data/app/views/leads/promote.js.haml +3 -4
- data/app/views/leads/reject.js.haml +3 -3
- data/app/views/leads/show.html.haml +1 -1
- data/app/views/leads/update.js.haml +4 -5
- data/app/views/lists/create.js.haml +0 -1
- data/app/views/opportunities/_edit.html.haml +1 -1
- data/app/views/opportunities/_index_brief.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -1
- data/app/views/opportunities/_new.html.haml +1 -1
- data/app/views/opportunities/_sidebar_index.html.haml +2 -2
- data/app/views/opportunities/_sidebar_show.html.haml +47 -46
- data/app/views/opportunities/create.js.haml +3 -4
- data/app/views/opportunities/destroy.js.haml +3 -3
- data/app/views/opportunities/show.html.haml +1 -0
- data/app/views/opportunities/update.js.haml +5 -6
- data/app/views/shared/_inline_styles.html.haml +0 -26
- data/app/views/tasks/_assigned.html.haml +1 -1
- data/app/views/tasks/_completed.html.haml +1 -1
- data/app/views/tasks/_edit.html.haml +1 -1
- data/app/views/tasks/_new.html.haml +1 -1
- data/app/views/tasks/_pending.html.haml +1 -1
- data/app/views/tasks/_related.html.haml +1 -1
- data/app/views/tasks/_selector.html.haml +7 -8
- data/app/views/tasks/_sidebar_index.html.haml +2 -2
- data/app/views/tasks/_title.html.haml +1 -1
- data/app/views/tasks/complete.js.haml +1 -1
- data/app/views/tasks/create.js.haml +1 -2
- data/app/views/tasks/destroy.js.haml +1 -1
- data/app/views/tasks/uncomplete.js.haml +1 -2
- data/app/views/tasks/update.js.haml +0 -1
- data/app/views/users/change_password.js.haml +0 -1
- data/app/views/users/update.js.haml +0 -1
- data/app/views/users/upload_avatar.js.haml +0 -1
- data/app/views/versions/_version_item.html.haml +1 -1
- data/bin/setup +6 -6
- data/config/application.rb +1 -1
- data/config/environment.rb +1 -1
- data/config/initializers/content_security_policy.rb +5 -0
- data/config/initializers/new_framework_defaults_6_0.rb +46 -0
- data/config/initializers/simple_form.rb +135 -55
- data/config/initializers/simple_form_bootstrap.rb +433 -0
- data/config/locales/fat_free_crm.cs.yml +86 -47
- data/config/locales/fat_free_crm.ru.yml +1 -0
- data/config/settings.default.yml +0 -41
- data/db/migrate/20200806004152_add_pattern_to_fields.rb +7 -0
- data/db/migrate/20200806004459_add_html5_to_fields.rb +10 -0
- data/db/schema.rb +11 -6
- data/fat_free_crm.gemspec +4 -4
- data/lib/fat_free_crm/core_ext.rb +1 -1
- data/lib/fat_free_crm/gem_ext.rb +0 -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 +1 -1
- data/lib/tasks/ffcrm/preference_update.rake +19 -0
- data/lib/tasks/ffcrm/setup.rake +1 -1
- data/lib/templates/erb/scaffold/_form.html.erb +4 -2
- data/spec/controllers/comments_controller_spec.rb +6 -6
- data/spec/controllers/home_controller_spec.rb +3 -3
- data/spec/controllers/users_controller_spec.rb +13 -1
- data/spec/factories/user_factories.rb +5 -2
- data/spec/features/acceptance_helper.rb +1 -1
- data/spec/features/accounts_spec.rb +2 -2
- data/spec/features/admin/groups_spec.rb +1 -1
- data/spec/features/admin/users_spec.rb +1 -1
- data/spec/features/campaigns_spec.rb +2 -2
- data/spec/features/contacts_spec.rb +2 -5
- data/spec/features/leads_spec.rb +11 -7
- data/spec/features/opportunities_spec.rb +4 -4
- data/spec/features/support/browser.rb +6 -2
- data/spec/features/support/selector_helpers.rb +10 -1
- data/spec/features/tasks_spec.rb +6 -6
- data/spec/helpers/accounts_helper_spec.rb +57 -0
- data/spec/models/entities/opportunity_spec.rb +2 -2
- data/spec/models/fields/custom_field_pair_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +3 -3
- data/spec/models/polymorphic/task_spec.rb +11 -11
- data/spec/models/polymorphic/version_spec.rb +2 -2
- data/spec/models/users/preference_spec.rb +1 -1
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/_new.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +0 -1
- data/spec/views/accounts/update.js.haml_spec.rb +2 -5
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -6
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -2
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/_new.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +0 -1
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +2 -6
- data/spec/views/contacts/_edit.haml_spec.rb +1 -1
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +0 -1
- data/spec/views/contacts/update.js.haml_spec.rb +3 -7
- data/spec/views/home/index.haml_spec.rb +2 -2
- data/spec/views/leads/_edit.haml_spec.rb +1 -1
- data/spec/views/leads/_new.haml_spec.rb +1 -1
- data/spec/views/leads/create.js.haml_spec.rb +0 -3
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -2
- data/spec/views/leads/promote.js.haml_spec.rb +3 -11
- data/spec/views/leads/reject.js.haml_spec.rb +0 -3
- data/spec/views/leads/update.js.haml_spec.rb +3 -11
- data/spec/views/opportunities/_edit.haml_spec.rb +1 -1
- data/spec/views/opportunities/_new.haml_spec.rb +1 -1
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -2
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -3
- data/spec/views/opportunities/update.js.haml_spec.rb +3 -11
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/create.js.haml_spec.rb +0 -2
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -1
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/update.js.haml_spec.rb +1 -4
- data/spec/views/users/change_password.js.haml_spec.rb +1 -2
- data/spec/views/users/update.js.haml_spec.rb +1 -2
- data/spec/views/users/upload_avatar.js.haml_spec.rb +1 -2
- metadata +23 -14
- data/config/initializers/new_framework_defaults_5_2.rb +0 -40
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +0 -24
@@ -31,9 +31,7 @@ describe "/campaigns/update" do
|
|
31
31
|
it "should update sidebar" do
|
32
32
|
render
|
33
33
|
expect(rendered).to include("#sidebar")
|
34
|
-
expect(rendered).to have_text("Campaign Summary")
|
35
34
|
expect(rendered).to have_text("Recent Items")
|
36
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
37
35
|
end
|
38
36
|
end
|
39
37
|
|
@@ -57,10 +55,9 @@ describe "/campaigns/update" do
|
|
57
55
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/123"
|
58
56
|
end
|
59
57
|
|
60
|
-
it "should redraw the [edit_campaign] form
|
58
|
+
it "should redraw the [edit_campaign] form" do
|
61
59
|
render
|
62
60
|
expect(rendered).to include("$('#edit_campaign').html")
|
63
|
-
expect(rendered).to include(%/$('#edit_campaign').effect("shake"/)
|
64
61
|
expect(rendered).to include('focus()')
|
65
62
|
end
|
66
63
|
end
|
@@ -71,10 +68,9 @@ describe "/campaigns/update" do
|
|
71
68
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns"
|
72
69
|
end
|
73
70
|
|
74
|
-
it "should redraw the [edit_campaign] form
|
71
|
+
it "should redraw the [edit_campaign] form" do
|
75
72
|
render
|
76
73
|
expect(rendered).to include("$('#campaign_#{@campaign.id}').html")
|
77
|
-
expect(rendered).to include(%/$('#campaign_#{@campaign.id}').effect("shake"/)
|
78
74
|
expect(rendered).to include('focus()')
|
79
75
|
end
|
80
76
|
end
|
@@ -26,7 +26,7 @@ describe "/contacts/_edit" do
|
|
26
26
|
expect(view).to render_template(partial: "contacts/_web")
|
27
27
|
expect(view).to render_template(partial: "_permissions")
|
28
28
|
|
29
|
-
expect(rendered).to have_tag(
|
29
|
+
expect(rendered).to have_tag('form[class="simple_form edit_contact"]') do
|
30
30
|
with_tag "input[type=hidden][id=contact_user_id][value='#{@contact.user_id}']"
|
31
31
|
end
|
32
32
|
end
|
@@ -26,7 +26,7 @@ describe "/contacts/_new" do
|
|
26
26
|
expect(view).to render_template(partial: "contacts/_web")
|
27
27
|
expect(view).to render_template(partial: "entities/_permissions")
|
28
28
|
|
29
|
-
expect(rendered).to have_tag(
|
29
|
+
expect(rendered).to have_tag('form[class="simple_form new_contact"]')
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should pick default assignee (Myself)" do
|
@@ -34,7 +34,6 @@ describe "/contacts/update" do
|
|
34
34
|
render
|
35
35
|
expect(rendered).to include("#sidebar")
|
36
36
|
expect(rendered).to have_text("Recent Items")
|
37
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
@@ -88,11 +87,10 @@ describe "/contacts/update" do
|
|
88
87
|
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts/123"
|
89
88
|
end
|
90
89
|
|
91
|
-
it "should redraw the [edit_contact] form
|
90
|
+
it "should redraw the [edit_contact] form" do
|
92
91
|
render
|
93
92
|
expect(rendered).to include("$('#edit_contact').html")
|
94
93
|
expect(rendered).to include('crm.create_or_select_account(false)')
|
95
|
-
expect(rendered).to include(%/$('#edit_contact').effect("shake"/)
|
96
94
|
expect(rendered).to include('focus()')
|
97
95
|
end
|
98
96
|
end
|
@@ -102,11 +100,10 @@ describe "/contacts/update" do
|
|
102
100
|
controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
|
103
101
|
end
|
104
102
|
|
105
|
-
it "should redraw the [edit_contact] form
|
103
|
+
it "should redraw the [edit_contact] form" do
|
106
104
|
render
|
107
105
|
expect(rendered).to include("$('#contact_#{@contact.id}').html")
|
108
106
|
expect(rendered).to include('crm.create_or_select_account(false)')
|
109
|
-
expect(rendered).to include(%/$('#contact_#{@contact.id}').effect("shake"/)
|
110
107
|
expect(rendered).to include('focus()')
|
111
108
|
end
|
112
109
|
end
|
@@ -121,10 +118,9 @@ describe "/contacts/update" do
|
|
121
118
|
expect(rendered).to include("crm.create_or_select_account(#{@referer =~ %r{/accounts/}})")
|
122
119
|
end
|
123
120
|
|
124
|
-
it "should redraw the [edit_contact] form
|
121
|
+
it "should redraw the [edit_contact] form" do
|
125
122
|
render
|
126
123
|
expect(rendered).to include("$('#contact_#{@contact.id}').html")
|
127
|
-
expect(rendered).to include(%/$('#contact_#{@contact.id}').effect("shake"/)
|
128
124
|
expect(rendered).to include('focus()')
|
129
125
|
end
|
130
126
|
end
|
@@ -19,7 +19,7 @@ describe "/home/index" do
|
|
19
19
|
assign(:my_tasks, [])
|
20
20
|
assign(:my_opportunities, [])
|
21
21
|
assign(:my_accounts, [])
|
22
|
-
render
|
22
|
+
render template: 'home/index', formats: [:html]
|
23
23
|
expect(view).to render_template(partial: "_activity")
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe "/home/index" do
|
|
28
28
|
assign(:my_tasks, [])
|
29
29
|
assign(:my_opportunities, [])
|
30
30
|
assign(:my_accounts, [])
|
31
|
-
render
|
31
|
+
render template: 'home/index', formats: [:html]
|
32
32
|
expect(view).not_to render_template(partial: "_activity")
|
33
33
|
|
34
34
|
expect(rendered).to include("No activity records found.")
|
@@ -26,7 +26,7 @@ describe "/leads/_edit" do
|
|
26
26
|
expect(view).to render_template(partial: "leads/_web")
|
27
27
|
expect(view).to render_template(partial: "entities/_permissions")
|
28
28
|
|
29
|
-
expect(rendered).to have_tag(
|
29
|
+
expect(rendered).to have_tag('form[class="simple_form edit_lead"]') do
|
30
30
|
with_tag "input[type=hidden][id=lead_user_id][value='#{@lead.user_id}']"
|
31
31
|
end
|
32
32
|
end
|
@@ -26,7 +26,7 @@ describe "/leads/_new" do
|
|
26
26
|
expect(view).to render_template(partial: "leads/_web")
|
27
27
|
expect(view).to render_template(partial: "entities/_permissions")
|
28
28
|
|
29
|
-
expect(rendered).to have_tag(
|
29
|
+
expect(rendered).to have_tag('form[class="simple_form new_lead"]')
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should render background info field if settings require so" do
|
@@ -35,7 +35,6 @@ describe "/leads/create" do
|
|
35
35
|
expect(rendered).to include("#sidebar")
|
36
36
|
expect(rendered).to have_text("Lead Statuses")
|
37
37
|
expect(rendered).to include("Recent Items")
|
38
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
39
38
|
end
|
40
39
|
|
41
40
|
it "should update pagination when called from leads index" do
|
@@ -51,7 +50,6 @@ describe "/leads/create" do
|
|
51
50
|
render
|
52
51
|
|
53
52
|
expect(rendered).to include("#sidebar")
|
54
|
-
expect(rendered).to have_text("Campaign Summary")
|
55
53
|
expect(rendered).to have_text("Recent Items")
|
56
54
|
end
|
57
55
|
end
|
@@ -64,7 +62,6 @@ describe "/leads/create" do
|
|
64
62
|
render
|
65
63
|
|
66
64
|
expect(rendered).to include("$('#create_lead').html")
|
67
|
-
expect(rendered).to include(%/$('#create_lead').effect("shake"/)
|
68
65
|
end
|
69
66
|
end
|
70
67
|
end
|
@@ -26,7 +26,6 @@ describe "/leads/destroy" do
|
|
26
26
|
|
27
27
|
expect(rendered).to include("#sidebar")
|
28
28
|
expect(rendered).to have_text("Recent Items")
|
29
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
30
29
|
end
|
31
30
|
|
32
31
|
it "should update pagination when called from leads index" do
|
@@ -43,7 +42,6 @@ describe "/leads/destroy" do
|
|
43
42
|
render
|
44
43
|
|
45
44
|
expect(rendered).to include("#sidebar")
|
46
|
-
expect(rendered).to have_text("Campaign Summary")
|
47
45
|
expect(rendered).to have_text("Recent Items")
|
48
46
|
end
|
49
47
|
end
|
@@ -37,9 +37,7 @@ describe "/leads/promote" do
|
|
37
37
|
it "should update sidebar" do
|
38
38
|
render
|
39
39
|
expect(rendered).to include("#sidebar")
|
40
|
-
expect(rendered).to have_text("Lead Summary")
|
41
40
|
expect(rendered).to have_text("Recent Items")
|
42
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
43
41
|
end
|
44
42
|
end
|
45
43
|
|
@@ -51,7 +49,6 @@ describe "/leads/promote" do
|
|
51
49
|
it "should replace [Convert Lead] with lead partial and highlight it" do
|
52
50
|
render
|
53
51
|
expect(rendered).to include("$('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
|
54
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
55
52
|
end
|
56
53
|
|
57
54
|
it "should update sidebar" do
|
@@ -59,7 +56,6 @@ describe "/leads/promote" do
|
|
59
56
|
expect(rendered).to include("#sidebar")
|
60
57
|
expect(rendered).to have_text("Lead Status")
|
61
58
|
expect(rendered).to have_text("Recent Items")
|
62
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
63
59
|
end
|
64
60
|
end
|
65
61
|
|
@@ -81,7 +77,6 @@ describe "/leads/promote" do
|
|
81
77
|
render
|
82
78
|
|
83
79
|
expect(rendered).to include("#sidebar")
|
84
|
-
expect(rendered).to have_text("Summary")
|
85
80
|
expect(rendered).to have_text("Recent Items")
|
86
81
|
end
|
87
82
|
|
@@ -103,10 +98,9 @@ describe "/leads/promote" do
|
|
103
98
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads/123"
|
104
99
|
end
|
105
100
|
|
106
|
-
it "should redraw the [Convert Lead] form
|
101
|
+
it "should redraw the [Convert Lead] form" do
|
107
102
|
render
|
108
103
|
expect(rendered).to include("$('#convert_lead').html")
|
109
|
-
expect(rendered).to include(%/$('#convert_lead').effect("shake"/)
|
110
104
|
end
|
111
105
|
end
|
112
106
|
|
@@ -115,10 +109,9 @@ describe "/leads/promote" do
|
|
115
109
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
|
116
110
|
end
|
117
111
|
|
118
|
-
it "should redraw the [Convert Lead] form
|
112
|
+
it "should redraw the [Convert Lead] form" do
|
119
113
|
render
|
120
114
|
expect(rendered).to include("$('#lead_#{@lead.id}').html")
|
121
|
-
expect(rendered).to include(%/$('#lead_#{@lead.id}').effect("shake"/)
|
122
115
|
end
|
123
116
|
end
|
124
117
|
|
@@ -127,10 +120,9 @@ describe "/leads/promote" do
|
|
127
120
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/123"
|
128
121
|
end
|
129
122
|
|
130
|
-
it "should redraw the [Convert Lead] form
|
123
|
+
it "should redraw the [Convert Lead] form" do
|
131
124
|
render
|
132
125
|
expect(rendered).to include("$('#lead_#{@lead.id}').html")
|
133
|
-
expect(rendered).to include(%/$('#lead_#{@lead.id}').effect("shake"/)
|
134
126
|
end
|
135
127
|
end
|
136
128
|
|
@@ -26,14 +26,12 @@ describe "/leads/reject" do
|
|
26
26
|
render
|
27
27
|
|
28
28
|
expect(rendered).to include("$('#sidebar').html")
|
29
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
30
29
|
end
|
31
30
|
|
32
31
|
it "should update sidebar summary when called from landing page" do
|
33
32
|
render
|
34
33
|
|
35
34
|
expect(rendered).to include("$('#sidebar').html")
|
36
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
37
35
|
end
|
38
36
|
|
39
37
|
it "should update campaign sidebar if called from campaign landing page" do
|
@@ -42,7 +40,6 @@ describe "/leads/reject" do
|
|
42
40
|
render
|
43
41
|
|
44
42
|
expect(rendered).to include("#sidebar")
|
45
|
-
expect(rendered).to have_text("Summary")
|
46
43
|
expect(rendered).to have_text("Recent Items")
|
47
44
|
end
|
48
45
|
end
|
@@ -31,8 +31,6 @@ describe "/leads/update" do
|
|
31
31
|
it "should update sidebar" do
|
32
32
|
render
|
33
33
|
expect(rendered).to include("#sidebar")
|
34
|
-
expect(rendered).to have_text("Lead Summary")
|
35
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
36
34
|
end
|
37
35
|
end
|
38
36
|
|
@@ -44,7 +42,6 @@ describe "/leads/update" do
|
|
44
42
|
it "should replace [Edit Lead] with lead partial and highlight it" do
|
45
43
|
render
|
46
44
|
expect(rendered).to include("$('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
|
47
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
48
45
|
end
|
49
46
|
|
50
47
|
it "should update sidebar" do
|
@@ -52,7 +49,6 @@ describe "/leads/update" do
|
|
52
49
|
expect(rendered).to include("#sidebar")
|
53
50
|
expect(rendered).to have_text("Lead Statuses")
|
54
51
|
expect(rendered).to have_text("Recent Items")
|
55
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
56
52
|
end
|
57
53
|
end
|
58
54
|
|
@@ -73,7 +69,6 @@ describe "/leads/update" do
|
|
73
69
|
render
|
74
70
|
|
75
71
|
expect(rendered).to include("sidebar")
|
76
|
-
expect(rendered).to have_text("Campaign Summary")
|
77
72
|
expect(rendered).to have_text("Recent Items")
|
78
73
|
end
|
79
74
|
end
|
@@ -89,10 +84,9 @@ describe "/leads/update" do
|
|
89
84
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads/123"
|
90
85
|
end
|
91
86
|
|
92
|
-
it "should redraw the [edit_lead] form
|
87
|
+
it "should redraw the [edit_lead] form" do
|
93
88
|
render
|
94
89
|
expect(rendered).to include("#edit_lead")
|
95
|
-
expect(rendered).to include(%/$('#edit_lead').effect("shake"/)
|
96
90
|
expect(rendered).to include('focus()')
|
97
91
|
end
|
98
92
|
end
|
@@ -102,10 +96,9 @@ describe "/leads/update" do
|
|
102
96
|
controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
|
103
97
|
end
|
104
98
|
|
105
|
-
it "should redraw the [edit_lead] form
|
99
|
+
it "should redraw the [edit_lead] form" do
|
106
100
|
render
|
107
101
|
expect(rendered).to include("$('#lead_#{@lead.id}').html")
|
108
|
-
expect(rendered).to include(%/$('#lead_#{@lead.id}').effect("shake"/)
|
109
102
|
expect(rendered).to include('focus()')
|
110
103
|
end
|
111
104
|
end
|
@@ -115,10 +108,9 @@ describe "/leads/update" do
|
|
115
108
|
controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/123"
|
116
109
|
end
|
117
110
|
|
118
|
-
it "should redraw the [edit_lead] form
|
111
|
+
it "should redraw the [edit_lead] form" do
|
119
112
|
render
|
120
113
|
expect(rendered).to include("$('#lead_#{@lead.id}').html")
|
121
|
-
expect(rendered).to include(%/$('#lead_#{@lead.id}').effect("shake"/)
|
122
114
|
expect(rendered).to include('focus()')
|
123
115
|
end
|
124
116
|
end
|
@@ -22,7 +22,7 @@ describe "/opportunities/_edit" do
|
|
22
22
|
assign(:opportunity, @opportunity = build_stubbed(:opportunity, campaign: @campaign = build_stubbed(:campaign)))
|
23
23
|
render
|
24
24
|
|
25
|
-
expect(rendered).to have_tag(
|
25
|
+
expect(rendered).to have_tag('form[class="simple_form edit_opportunity"]') do
|
26
26
|
with_tag "input[type=hidden][id=opportunity_user_id][value='#{@opportunity.user_id}']"
|
27
27
|
with_tag "input[type=hidden][id=opportunity_campaign_id][value='#{@opportunity.campaign_id}']"
|
28
28
|
end
|
@@ -25,7 +25,7 @@ describe "/opportunities/_new" do
|
|
25
25
|
expect(view).to render_template(partial: "opportunities/_top_section")
|
26
26
|
expect(view).to render_template(partial: "entities/_permissions")
|
27
27
|
|
28
|
-
expect(rendered).to have_tag(
|
28
|
+
expect(rendered).to have_tag('form[class="simple_form new_opportunity"]')
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should pick default assignee (Myself)" do
|
@@ -58,7 +58,6 @@ describe "/opportunities/create" do
|
|
58
58
|
render
|
59
59
|
|
60
60
|
expect(rendered).to include("#sidebar")
|
61
|
-
expect(rendered).to have_text("Campaign Summary")
|
62
61
|
expect(rendered).to have_text("Recent Items")
|
63
62
|
end
|
64
63
|
|
@@ -81,7 +80,6 @@ describe "/opportunities/create" do
|
|
81
80
|
render
|
82
81
|
|
83
82
|
expect(rendered).to include("$('#create_opportunity').html")
|
84
|
-
expect(rendered).to include(%/$('#create_opportunity').effect("shake"/)
|
85
83
|
expect(rendered).to include("crm.create_or_select_account(false)")
|
86
84
|
end
|
87
85
|
end
|
@@ -27,7 +27,6 @@ describe "/opportunities/destroy" do
|
|
27
27
|
|
28
28
|
expect(rendered).to include("#sidebar")
|
29
29
|
expect(rendered).to have_text("Recent Items")
|
30
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
31
30
|
end
|
32
31
|
|
33
32
|
it "should update pagination when called from opportunities index" do
|
@@ -44,7 +43,6 @@ describe "/opportunities/destroy" do
|
|
44
43
|
render
|
45
44
|
|
46
45
|
expect(rendered).to include("#sidebar")
|
47
|
-
expect(rendered).to have_text("Account Summary")
|
48
46
|
expect(rendered).to have_text("Recent Items")
|
49
47
|
end
|
50
48
|
|
@@ -54,7 +52,6 @@ describe "/opportunities/destroy" do
|
|
54
52
|
render
|
55
53
|
|
56
54
|
expect(rendered).to include("#sidebar")
|
57
|
-
expect(rendered).to have_text("Campaign Summary")
|
58
55
|
expect(rendered).to have_text("Recent Items")
|
59
56
|
end
|
60
57
|
|
@@ -34,9 +34,7 @@ describe "/opportunities/update" do
|
|
34
34
|
it "should update sidebar" do
|
35
35
|
render
|
36
36
|
expect(rendered).to include("#sidebar")
|
37
|
-
expect(rendered).to have_text("Opportunity At a Glance")
|
38
37
|
expect(rendered).to have_text("Recent Items")
|
39
|
-
expect(rendered).to include("$('#summary').effect('shake'")
|
40
38
|
end
|
41
39
|
end
|
42
40
|
|
@@ -56,7 +54,6 @@ describe "/opportunities/update" do
|
|
56
54
|
expect(rendered).to include("sidebar")
|
57
55
|
expect(rendered).to have_text("Opportunity Stages")
|
58
56
|
expect(rendered).to have_text("Recent Items")
|
59
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
60
57
|
end
|
61
58
|
end
|
62
59
|
|
@@ -67,7 +64,6 @@ describe "/opportunities/update" do
|
|
67
64
|
render
|
68
65
|
|
69
66
|
expect(rendered).to include("#sidebar")
|
70
|
-
expect(rendered).to have_text("Account Summary")
|
71
67
|
expect(rendered).to have_text("Recent Items")
|
72
68
|
end
|
73
69
|
|
@@ -77,7 +73,6 @@ describe "/opportunities/update" do
|
|
77
73
|
render
|
78
74
|
|
79
75
|
expect(rendered).to include("#sidebar")
|
80
|
-
expect(rendered).to have_text("Campaign Summary")
|
81
76
|
expect(rendered).to have_text("Recent Items")
|
82
77
|
end
|
83
78
|
|
@@ -107,11 +102,10 @@ describe "/opportunities/update" do
|
|
107
102
|
controller.request.env["HTTP_REFERER"] = "http://localhost/opportunities/123"
|
108
103
|
end
|
109
104
|
|
110
|
-
it "should redraw the [edit_opportunity] form
|
105
|
+
it "should redraw the [edit_opportunity] form" do
|
111
106
|
render
|
112
107
|
expect(rendered).to include("$('#edit_opportunity').html")
|
113
108
|
expect(rendered).to include('crm.create_or_select_account(false)')
|
114
|
-
expect(rendered).to include(%/$('#edit_opportunity').effect("shake"/)
|
115
109
|
expect(rendered).to include('focus()')
|
116
110
|
end
|
117
111
|
end
|
@@ -121,11 +115,10 @@ describe "/opportunities/update" do
|
|
121
115
|
controller.request.env["HTTP_REFERER"] = "http://localhost/opportunities"
|
122
116
|
end
|
123
117
|
|
124
|
-
it "should redraw the [edit_opportunity] form
|
118
|
+
it "should redraw the [edit_opportunity] form" do
|
125
119
|
render
|
126
120
|
expect(rendered).to include("$('#opportunity_#{@opportunity.id}').html")
|
127
121
|
expect(rendered).to include('crm.create_or_select_account(false)')
|
128
|
-
expect(rendered).to include(%/$('#opportunity_#{@opportunity.id}').effect("shake"/)
|
129
122
|
expect(rendered).to include('focus()')
|
130
123
|
end
|
131
124
|
end
|
@@ -140,10 +133,9 @@ describe "/opportunities/update" do
|
|
140
133
|
expect(rendered).to include("crm.create_or_select_account(#{@referer =~ %r{/accounts/}})")
|
141
134
|
end
|
142
135
|
|
143
|
-
it "should redraw the [edit_opportunity] form
|
136
|
+
it "should redraw the [edit_opportunity] form" do
|
144
137
|
render
|
145
138
|
expect(rendered).to include("$('#opportunity_#{@opportunity.id}').html")
|
146
|
-
expect(rendered).to include(%/$('#opportunity_#{@opportunity.id}').effect("shake"/)
|
147
139
|
expect(rendered).to include('focus()')
|
148
140
|
end
|
149
141
|
end
|
@@ -23,7 +23,7 @@ describe "/tasks/_edit" do
|
|
23
23
|
|
24
24
|
expect(view).to render_template(partial: "tasks/_top_section")
|
25
25
|
|
26
|
-
expect(rendered).to have_tag(
|
26
|
+
expect(rendered).to have_tag('form[class="simple_form edit_task"]')
|
27
27
|
end
|
28
28
|
|
29
29
|
["As Soon As Possible", "Today", "Tomorrow", "This Week", "Next Week", "Sometime Later"].each do |day|
|
@@ -41,7 +41,6 @@ describe "/tasks/create" do
|
|
41
41
|
expect(rendered).to include("$('#sidebar').html")
|
42
42
|
expect(rendered).to have_text("Recent Items")
|
43
43
|
expect(rendered).to have_text("Sometime Later")
|
44
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
45
44
|
end
|
46
45
|
end
|
47
46
|
end
|
@@ -115,7 +114,6 @@ describe "/tasks/create" do
|
|
115
114
|
assign(:task, build(:task, name: nil)) # make it invalid
|
116
115
|
render
|
117
116
|
|
118
|
-
expect(rendered).to include(%/$('#create_task').effect("shake"/)
|
119
117
|
expect(rendered).to include(%/$('#new_task input[type=submit]').enable()/)
|
120
118
|
end
|
121
119
|
end
|
@@ -40,7 +40,6 @@ describe "/tasks/uncomplete" do
|
|
40
40
|
expect(rendered).to include("$('#sidebar').html")
|
41
41
|
expect(rendered).to have_text("Assigned")
|
42
42
|
expect(rendered).to have_text("Recent Items")
|
43
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
44
43
|
end
|
45
44
|
end
|
46
45
|
end
|
@@ -44,7 +44,6 @@ describe "/tasks/update" do
|
|
44
44
|
expect(rendered).to include("$('#due_tomorrow').prepend('<li class=\\'highlight task\\' id=\\'task_#{@task.id}\\'")
|
45
45
|
expect(rendered).to have_text("Assigned")
|
46
46
|
expect(rendered).to have_text("Recent Items")
|
47
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
48
47
|
end
|
49
48
|
|
50
49
|
it "from asset page: should update task partial in place" do
|
@@ -111,7 +110,6 @@ describe "/tasks/update" do
|
|
111
110
|
expect(rendered).to include("$('#sidebar').html")
|
112
111
|
expect(rendered).to have_text("Recent Items")
|
113
112
|
expect(rendered).to have_text("Assigned")
|
114
|
-
expect(rendered).to include("$('#filters').effect('shake'")
|
115
113
|
end
|
116
114
|
|
117
115
|
it "from asset page: should should re-render task partial" do
|
@@ -131,13 +129,12 @@ describe "/tasks/update" do
|
|
131
129
|
end
|
132
130
|
end
|
133
131
|
|
134
|
-
it "error: should re-disiplay [Edit Task] form
|
132
|
+
it "error: should re-disiplay [Edit Task] form" do
|
135
133
|
assign(:task_before_update, build_stubbed(:task))
|
136
134
|
assign(:task, @task = build_stubbed(:task))
|
137
135
|
@task.errors.add(:name)
|
138
136
|
|
139
137
|
render
|
140
|
-
expect(rendered).to include(%/$('#task_#{@task.id}').effect("shake"/)
|
141
138
|
expect(rendered).to include("$('#task_submit').enable()")
|
142
139
|
end
|
143
140
|
end
|
@@ -33,12 +33,11 @@ describe "/users/change_password" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
describe "validation errors:" do
|
36
|
-
it "should redraw the [Change Password] form
|
36
|
+
it "should redraw the [Change Password] form" do
|
37
37
|
@user.errors.add(:current_password, "error")
|
38
38
|
render
|
39
39
|
|
40
40
|
expect(rendered).to include("$('#change_password').html")
|
41
|
-
expect(rendered).to include(%/$('#change_password').effect("shake"/)
|
42
41
|
expect(rendered).to include("$('#current_password').focus();")
|
43
42
|
end
|
44
43
|
|
@@ -37,10 +37,9 @@ describe "/users/update" do
|
|
37
37
|
@user.errors.add(:first_name)
|
38
38
|
end
|
39
39
|
|
40
|
-
it "should redraw the [Edit Profile] form
|
40
|
+
it "should redraw the [Edit Profile] form" do
|
41
41
|
render
|
42
42
|
expect(rendered).to include("$('#edit_profile').html")
|
43
|
-
expect(rendered).to include(%/$('#edit_profile').effect("shake"/)
|
44
43
|
expect(rendered).to include("$('#user_email').focus();")
|
45
44
|
end
|
46
45
|
end
|
@@ -37,10 +37,9 @@ describe "/users/upload_avatar" do
|
|
37
37
|
assign(:user, @user = current_user)
|
38
38
|
end
|
39
39
|
|
40
|
-
it "should redraw the [Upload Avatar] form
|
40
|
+
it "should redraw the [Upload Avatar] form" do
|
41
41
|
render
|
42
42
|
expect(rendered).to include("$('#upload_avatar').html")
|
43
|
-
expect(rendered).to include(%/$('#upload_avatar').effect("shake"/)
|
44
43
|
end
|
45
44
|
end
|
46
45
|
end
|