dorsale 3.8.1 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +5 -1
- data/app/commands/dorsale/flyboy/task_commands.rb +1 -1
- data/app/controllers/concerns/dorsale/flyboy/tasks_summary_concern.rb +0 -1
- data/app/controllers/dorsale/alexandrie/attachments_controller.rb +1 -2
- data/app/controllers/dorsale/application_controller.rb +0 -1
- data/app/controllers/dorsale/billing_machine/application_controller.rb +0 -2
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +9 -22
- data/app/controllers/dorsale/billing_machine/payment_terms_controller.rb +0 -1
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +1 -4
- data/app/controllers/dorsale/comments_controller.rb +3 -2
- data/app/controllers/dorsale/customer_vault/activity_types_controller.rb +0 -1
- data/app/controllers/dorsale/customer_vault/application_controller.rb +0 -1
- data/app/controllers/dorsale/customer_vault/links_controller.rb +22 -12
- data/app/controllers/dorsale/customer_vault/origins_controller.rb +0 -1
- data/app/controllers/dorsale/customer_vault/people_controller.rb +2 -3
- data/app/controllers/dorsale/expense_gun/categories_controller.rb +0 -1
- data/app/controllers/dorsale/expense_gun/expenses_controller.rb +0 -1
- data/app/controllers/dorsale/flyboy/task_comments_controller.rb +0 -1
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +28 -21
- data/app/controllers/dorsale/users_controller.rb +0 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +9 -5
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb +2 -2
- data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +1 -1
- data/app/helpers/dorsale/billing_machine/application_helper.rb +6 -6
- data/app/helpers/dorsale/context_helper.rb +1 -1
- data/app/helpers/dorsale/flyboy/application_helper.rb +4 -5
- data/app/mailers/dorsale/billing_machine/invoice_mailer.rb +0 -1
- data/app/mailers/dorsale/flyboy/task_mailer.rb +0 -1
- data/app/mailers/dorsale/user_mailer.rb +0 -1
- data/app/models/dorsale/address.rb +2 -2
- data/app/models/dorsale/alexandrie/attachment_type.rb +0 -1
- data/app/models/dorsale/billing_machine.rb +1 -2
- data/app/models/dorsale/billing_machine/invoice.rb +19 -30
- data/app/models/dorsale/billing_machine/invoice_line.rb +2 -2
- data/app/models/dorsale/billing_machine/quotation.rb +11 -17
- data/app/models/dorsale/billing_machine/quotation_line.rb +2 -3
- data/app/models/dorsale/comment.rb +1 -1
- data/app/models/dorsale/customer_vault/corporation.rb +11 -10
- data/app/models/dorsale/customer_vault/event.rb +2 -2
- data/app/models/dorsale/customer_vault/individual.rb +4 -2
- data/app/models/dorsale/customer_vault/person.rb +14 -4
- data/app/models/dorsale/customer_vault/person_data.rb +1 -2
- data/app/models/dorsale/expense_gun/expense.rb +2 -5
- data/app/models/dorsale/expense_gun/expense_line.rb +2 -2
- data/app/models/dorsale/flyboy/task.rb +17 -18
- data/app/models/dorsale/flyboy/task_comment.rb +1 -1
- data/app/models/dorsale/users/active.rb +1 -1
- data/app/models/dorsale/users/avatar.rb +2 -1
- data/app/models/dorsale/users/password_generation.rb +0 -1
- data/app/pdfs/concerns/dorsale/alexandrie/prawn/render_with_attachments.rb +1 -1
- data/app/pdfs/dorsale/application_pdf.rb +7 -0
- data/app/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf.rb +52 -47
- data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +94 -205
- data/app/pdfs/dorsale/prawn_helpers.rb +107 -0
- data/app/policies/dorsale/application_policy.rb +2 -4
- data/app/policies/dorsale/expense_gun/expense_policy_helper.rb +0 -1
- data/app/policies/dorsale/flyboy/task_policy_helper.rb +3 -3
- data/app/policies/dorsale/policy_checker.rb +11 -18
- data/app/services/dorsale/billing_machine/invoice/copy.rb +2 -2
- data/app/services/dorsale/billing_machine/pdf_file_generator.rb +7 -2
- data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -1
- data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +10 -7
- data/app/services/dorsale/flyboy/task/snoozer.rb +1 -1
- data/app/views/dorsale/billing_machine/invoices/_details.html.slim +1 -2
- data/app/views/dorsale/billing_machine/invoices/_form.html.slim +4 -11
- data/app/views/dorsale/billing_machine/invoices/index.xlsx.ruby +1 -1
- data/app/views/dorsale/flyboy/tasks/index.xlsx.ruby +1 -1
- data/config/locales/alexandrie.en.yml +0 -4
- data/config/locales/alexandrie.fr.yml +0 -4
- data/config/locales/billing_machine.en.yml +0 -41
- data/config/locales/billing_machine.fr.yml +0 -41
- data/config/routes.rb +0 -1
- data/db/migrate/20161119064536_delete_id_cards.rb +9 -0
- data/features/billing_machine_invoices.feature +0 -1
- data/features/billing_machine_multiple_vat.feature +0 -1
- data/features/billing_machine_quotations.feature +0 -1
- data/features/step_definitions/billing_machine_invoices_steps.rb +73 -79
- data/features/step_definitions/billing_machine_multiple_vat.rb +5 -6
- data/features/step_definitions/billing_machine_payment_terms_steps.rb +2 -2
- data/features/step_definitions/billing_machine_quotations_steps.rb +45 -80
- data/features/step_definitions/common_steps.rb +0 -4
- data/features/step_definitions/customer_vault_activity_types_steps.rb +1 -1
- data/features/step_definitions/customer_vault_corporations_steps.rb +27 -23
- data/features/step_definitions/customer_vault_individuals_steps.rb +8 -9
- data/features/step_definitions/customer_vault_invoices_steps.rb +1 -1
- data/features/step_definitions/customer_vault_links_steps.rb +6 -6
- data/features/step_definitions/customer_vault_origins_steps.rb +1 -1
- data/features/step_definitions/customer_vault_people_steps.rb +2 -1
- data/features/step_definitions/expense_gun_categories_steps.rb +2 -2
- data/features/step_definitions/expense_gun_expenses_steps.rb +6 -6
- data/features/step_definitions/flyboy_tasks_steps.rb +4 -7
- data/features/step_definitions/tasks_summary_steps.rb +3 -3
- data/features/support/env.rb +3 -2
- data/lib/dorsale/engine.rb +8 -8
- data/lib/dorsale/file_loader.rb +1 -1
- data/lib/dorsale/simple_form.rb +3 -3
- data/lib/dorsale/simple_form_bootstrap.rb +46 -46
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +3 -3
- data/spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb +0 -1
- data/spec/controllers/dorsale/comments_controller_spec.rb +1 -1
- data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +9 -9
- data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +15 -19
- data/spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb +1 -2
- data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +43 -19
- data/spec/factories/alexandrie_attachment_types.rb +1 -1
- data/spec/factories/alexandrie_attachments.rb +1 -1
- data/spec/factories/billing_machine_invoice_lines.rb +1 -1
- data/spec/factories/billing_machine_invoices.rb +1 -2
- data/spec/factories/billing_machine_payment_terms.rb +1 -1
- data/spec/factories/billing_machine_quotation_lines.rb +1 -2
- data/spec/factories/billing_machine_quotations.rb +1 -2
- data/spec/factories/customer_vault_activity_types.rb +1 -1
- data/spec/factories/customer_vault_corporations.rb +1 -1
- data/spec/factories/customer_vault_event.rb +1 -1
- data/spec/factories/customer_vault_individuals.rb +2 -2
- data/spec/factories/customer_vault_links.rb +1 -1
- data/spec/factories/customer_vault_origins.rb +1 -1
- data/spec/factories/dorsale_addresses.rb +1 -1
- data/spec/factories/dorsale_comments.rb +1 -1
- data/spec/factories/expense_gun_categories.rb +2 -2
- data/spec/factories/expense_gun_expense_lines.rb +8 -8
- data/spec/factories/expense_gun_expenses.rb +2 -3
- data/spec/factories/flyboy_task_comments.rb +1 -1
- data/spec/factories/flyboy_tasks.rb +1 -1
- data/spec/mailers/user_mailer.rb +5 -6
- data/spec/models/dorsale/address_spec.rb +26 -26
- data/spec/models/dorsale/billing_machine/invoice_line_spec.rb +6 -6
- data/spec/models/dorsale/billing_machine/invoice_spec.rb +37 -23
- data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +9 -10
- data/spec/models/dorsale/billing_machine/quotation_spec.rb +26 -28
- data/spec/models/dorsale/billing_machine_spec.rb +0 -1
- data/spec/models/dorsale/comment_spec.rb +0 -1
- data/spec/models/dorsale/customer_vault/corporation_spec.rb +20 -20
- data/spec/models/dorsale/customer_vault/event_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/individual_spec.rb +0 -2
- data/spec/models/dorsale/customer_vault/link_spec.rb +0 -1
- data/spec/models/dorsale/customer_vault/person_spec.rb +7 -6
- data/spec/models/dorsale/expense_gun/category_spec.rb +2 -2
- data/spec/models/dorsale/expense_gun/expense_line_spec.rb +14 -14
- data/spec/models/dorsale/expense_gun/expense_spec.rb +23 -13
- data/spec/models/dorsale/flyboy/task_comment_spec.rb +5 -6
- data/spec/models/dorsale/flyboy/task_spec.rb +66 -42
- data/spec/models/dorsale/users_spec.rb +3 -5
- data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +6 -11
- data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +7 -11
- data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +6 -11
- data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +7 -14
- data/spec/rails_helper.rb +1 -1
- data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +0 -1
- data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +0 -1
- data/spec/routing/dorsale/comments_routing_spec.rb +0 -2
- data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +0 -1
- data/spec/routing/dorsale/expense_gun/expenses_routing_spec.rb +0 -1
- data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +0 -1
- data/spec/routing/dorsale/users_routing_spec.rb +1 -1
- data/spec/services/dorsale/billing_machine/quotation/copy_spec.rb +2 -2
- data/spec/services/dorsale/expense_gun/expense/copy_spec.rb +13 -17
- data/spec/services/dorsale/flyboy/task/copy_spec.rb +1 -2
- data/spec/services/dorsale/flyboy/task/snoozer_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -0
- metadata +5 -43
- data/app/controllers/dorsale/billing_machine/id_cards_controller.rb +0 -106
- data/app/models/dorsale/billing_machine/id_card.rb +0 -14
- data/app/policies/dorsale/billing_machine/id_card_policy_helper.rb +0 -7
- data/app/views/dorsale/billing_machine/id_cards/_form.html.slim +0 -42
- data/app/views/dorsale/billing_machine/id_cards/_index_actions.html.slim +0 -2
- data/app/views/dorsale/billing_machine/id_cards/_list.html.slim +0 -27
- data/app/views/dorsale/billing_machine/id_cards/edit.html.slim +0 -1
- data/app/views/dorsale/billing_machine/id_cards/index.html.slim +0 -11
- data/app/views/dorsale/billing_machine/id_cards/new.html.slim +0 -1
- data/features/billing_machine_id_cards.feature +0 -19
- data/features/step_definitions/billing_machine_id_cards_steps.rb +0 -53
- data/features/support/ajax.rb +0 -20
- data/features/support/database_cleaner.rb +0 -12
- data/features/support/factory_girl.rb +0 -1
- data/features/support/fix_referrer.rb +0 -9
- data/features/support/message_delivery.rb +0 -1
- data/features/support/poltergeist.rb +0 -22
- data/features/support/rails.rb +0 -1
- data/features/support/rspec.rb +0 -6
- data/features/support/screenshots.rb +0 -5
- data/features/support/sign_in.rb +0 -17
- data/features/support/simplecov.rb +0 -1
- data/features/support/turbolinks.rb +0 -30
- data/spec/factories/billing_machine_id_cards.rb +0 -26
- data/spec/models/dorsale/billing_machine/id_card_spec.rb +0 -12
@@ -11,10 +11,6 @@ When(/^he goes to the next page$/) do
|
|
11
11
|
find(".next").click
|
12
12
|
end
|
13
13
|
|
14
|
-
Given(/^an existing id card$/) do
|
15
|
-
@id_card = create(:billing_machine_id_card)
|
16
|
-
end
|
17
|
-
|
18
14
|
Given(/^an existing payment term$/) do
|
19
15
|
@payment_term = create(:billing_machine_payment_term)
|
20
16
|
end
|
@@ -4,7 +4,7 @@ Given(/^the user goes on the new activity type page$/) do
|
|
4
4
|
end
|
5
5
|
|
6
6
|
When(/^he fills the activity type's information$/) do
|
7
|
-
fill_in
|
7
|
+
fill_in "activity_type_name", with: "Activity Name"
|
8
8
|
end
|
9
9
|
|
10
10
|
When(/^creates a new activity type$/) do
|
@@ -9,29 +9,29 @@ When(/^I create an new corporation$/) do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
When(/^I add the corporation's informations$/) do
|
12
|
-
fill_in
|
13
|
-
fill_in
|
14
|
-
fill_in
|
15
|
-
fill_in
|
16
|
-
fill_in
|
12
|
+
fill_in "person_corporation_name", with: "AGILiDEE"
|
13
|
+
fill_in "person_email", with: "contact@agilidee.com"
|
14
|
+
fill_in "person_www", with: "www.agilidee.com"
|
15
|
+
fill_in "person_phone", with: "04 91 00 00 00"
|
16
|
+
fill_in "person_fax", with: "09 00 00 00 00"
|
17
17
|
end
|
18
18
|
|
19
19
|
When(/^I fill the corporation capital, immatriculation, legal form$/) do
|
20
|
-
fill_in
|
21
|
-
fill_in
|
22
|
-
fill_in
|
23
|
-
fill_in
|
24
|
-
fill_in
|
25
|
-
fill_in
|
26
|
-
fill_in
|
20
|
+
fill_in "person_capital", with: "1000"
|
21
|
+
fill_in "person_immatriculation_number", with: "RCS 201523658"
|
22
|
+
fill_in "person_legal_form", with: "SARL"
|
23
|
+
fill_in "person_number_of_employees", with: "45"
|
24
|
+
fill_in "person_revenue", with: "450000"
|
25
|
+
fill_in "person_context", with: "Le joli contexte"
|
26
|
+
fill_in "person_societe_com", with: "societe_com"
|
27
27
|
end
|
28
28
|
|
29
29
|
When(/^I fill the corporation's address$/) do
|
30
|
-
fill_in
|
31
|
-
fill_in
|
32
|
-
fill_in
|
33
|
-
fill_in
|
34
|
-
fill_in
|
30
|
+
fill_in "person_address_attributes_street", with: "3 Rue Marx Dormoy"
|
31
|
+
fill_in "person_address_attributes_street_bis", with: ""
|
32
|
+
fill_in "person_address_attributes_city", with: "Marseille"
|
33
|
+
fill_in "person_address_attributes_zip", with: "13004"
|
34
|
+
fill_in "person_address_attributes_country", with: "France"
|
35
35
|
end
|
36
36
|
|
37
37
|
When(/^I validate the new corporation$/) do
|
@@ -43,7 +43,7 @@ When(/^I go on the corporate index$/) do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
When(/^he go on the next page$/) do
|
46
|
-
click_link
|
46
|
+
click_link "2"
|
47
47
|
end
|
48
48
|
|
49
49
|
Then(/^i see an error message for the missing name$/) do
|
@@ -51,7 +51,7 @@ Then(/^i see an error message for the missing name$/) do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
Then(/^he can see (\d+) corporate$/) do |count|
|
54
|
-
page.should have_selector
|
54
|
+
page.should have_selector ".person", count: count
|
55
55
|
end
|
56
56
|
|
57
57
|
Then(/^the corporation is created$/) do
|
@@ -178,15 +178,19 @@ Then(/^tags are removed$/) do
|
|
178
178
|
end
|
179
179
|
|
180
180
|
Given(/^an open task to this corporation$/) do
|
181
|
-
@open_task =
|
181
|
+
@open_task = @corporation.tasks.create!(progress: 20, name: "I-am-open")
|
182
182
|
end
|
183
183
|
|
184
184
|
Given(/^a closed task to this corporation$/) do
|
185
|
-
@closed_task =
|
185
|
+
@closed_task = @corporation.tasks.create!(progress: 100, done: true, name: "I-am-closed")
|
186
186
|
end
|
187
187
|
|
188
188
|
Given(/^a link between this individual and this corporation$/) do
|
189
|
-
@link = ::Dorsale::CustomerVault::Link.create!(
|
189
|
+
@link = ::Dorsale::CustomerVault::Link.create!(
|
190
|
+
:alice => @corporation,
|
191
|
+
:bob => @individual,
|
192
|
+
:title => "I-am-a-link",
|
193
|
+
)
|
190
194
|
end
|
191
195
|
|
192
196
|
Then(/^I see only the open task in the context$/) do
|
@@ -210,7 +214,7 @@ When(/^I delete this corporation$/) do
|
|
210
214
|
end
|
211
215
|
|
212
216
|
Then(/^the corporation is deleted$/) do
|
213
|
-
expect(::Dorsale::CustomerVault::Corporation.count).to eq
|
217
|
+
expect(::Dorsale::CustomerVault::Corporation.count).to eq(@corporations_count - 1)
|
214
218
|
end
|
215
219
|
|
216
220
|
Then(/^I am on the people page$/) do
|
@@ -5,17 +5,17 @@ When(/^I create an new individual$/) do
|
|
5
5
|
end
|
6
6
|
|
7
7
|
When(/^I add his first_name, last_name and email$/) do
|
8
|
-
fill_in
|
9
|
-
fill_in
|
10
|
-
fill_in
|
8
|
+
fill_in "person_first_name", with: "Benoit"
|
9
|
+
fill_in "person_last_name", with: "Gantaume"
|
10
|
+
fill_in "person_email", with: "benoit@agilidee.com"
|
11
11
|
end
|
12
12
|
|
13
13
|
When(/^I fill the address$/) do
|
14
|
-
fill_in
|
15
|
-
fill_in
|
16
|
-
fill_in
|
17
|
-
fill_in
|
18
|
-
fill_in
|
14
|
+
fill_in "person_address_attributes_street", with: "3 Rue Marx Dormoy"
|
15
|
+
fill_in "person_address_attributes_street_bis", with: ""
|
16
|
+
fill_in "person_address_attributes_city", with: "Marseille"
|
17
|
+
fill_in "person_address_attributes_zip", with: "13004"
|
18
|
+
fill_in "person_address_attributes_country", with: "France"
|
19
19
|
end
|
20
20
|
|
21
21
|
When(/^I validate the new individual$/) do
|
@@ -65,4 +65,3 @@ end
|
|
65
65
|
When(/^I go on this individual$/) do
|
66
66
|
visit dorsale.customer_vault_individual_path(@individual)
|
67
67
|
end
|
68
|
-
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Given(/^this (?:corporation|individual|person) has an invoice$/) do
|
2
|
-
|
2
|
+
@invoice = create(:billing_machine_invoice, customer: @person)
|
3
3
|
end
|
4
4
|
|
5
5
|
When(/^he go on he (?:corporation|individual|person) invoices page$/) do
|
@@ -32,7 +32,7 @@ end
|
|
32
32
|
|
33
33
|
When(/^I provide the link and the target corporation$/) do
|
34
34
|
select @corporation.name
|
35
|
-
fill_in
|
35
|
+
fill_in "link_title", with: "Manager"
|
36
36
|
end
|
37
37
|
|
38
38
|
When(/^I validate the link$/) do
|
@@ -44,7 +44,7 @@ When(/^I edit the link$/) do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
When(/^I change the title$/) do
|
47
|
-
fill_in
|
47
|
+
fill_in "link_title", with: "Manager 2"
|
48
48
|
end
|
49
49
|
|
50
50
|
When(/^I navigate to the link section of the corporation details$/) do
|
@@ -54,7 +54,7 @@ end
|
|
54
54
|
|
55
55
|
When(/^I provide the link and the target individual$/) do
|
56
56
|
select @individual.name
|
57
|
-
fill_in
|
57
|
+
fill_in "link_title", with: "Manager"
|
58
58
|
end
|
59
59
|
|
60
60
|
When(/^I delete the link$/) do
|
@@ -62,13 +62,13 @@ When(/^I delete the link$/) do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
Then(/^the new link is displayed$/) do
|
65
|
-
expect(page).to have_selector
|
65
|
+
expect(page).to have_selector ".title", text: "Manager"
|
66
66
|
end
|
67
67
|
|
68
68
|
Then(/^the edited link is displayed$/) do
|
69
|
-
expect(page).to have_selector
|
69
|
+
expect(page).to have_selector ".title", text: "Manager 2"
|
70
70
|
end
|
71
71
|
|
72
72
|
Then(/^the targeted link is removed$/) do
|
73
|
-
expect(page).to_not have_selector
|
73
|
+
expect(page).to_not have_selector ".title", text: "Manager"
|
74
74
|
end
|
@@ -7,7 +7,8 @@ Then(/^the file is downloaded$/) do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
Given(/^a very long comment on this person$/) do
|
10
|
-
|
10
|
+
text = Faker::Lorem.paragraph(10)
|
11
|
+
@comment = create(:customer_vault_event_comment, person: @person, text: text)
|
11
12
|
end
|
12
13
|
|
13
14
|
Then(/^I see the truncated comment$/) do
|
@@ -4,8 +4,8 @@ Given(/^the user goes on the new expense category page$/) do
|
|
4
4
|
end
|
5
5
|
|
6
6
|
When(/^he fills the category's information$/) do
|
7
|
-
fill_in
|
8
|
-
fill_in
|
7
|
+
fill_in "category_name", with: "Category Name"
|
8
|
+
fill_in "category_code", with: "Category Code"
|
9
9
|
select "Oui"
|
10
10
|
end
|
11
11
|
|
@@ -14,22 +14,22 @@ When(/^I create a new expense$/) do
|
|
14
14
|
fill_in :expense_name, with: "ExpenseName"
|
15
15
|
|
16
16
|
within all(".nested-fields").first do
|
17
|
-
find("input[id$='_name']").set
|
18
|
-
find("input[id$='_date']").set
|
17
|
+
find("input[id$='_name']").set "ExpenseLine1Name"
|
18
|
+
find("input[id$='_date']").set "21/06/2015"
|
19
19
|
select @category.name
|
20
20
|
find("input[id$='_total_all_taxes']").set "100"
|
21
|
-
find("input[id$='_vat']").set
|
21
|
+
find("input[id$='_vat']").set "20"
|
22
22
|
end
|
23
23
|
|
24
24
|
find(".add_fields").click
|
25
25
|
expect(page).to have_selector(".nested-fields", count: 2)
|
26
26
|
|
27
27
|
within all(".nested-fields").last do
|
28
|
-
find("input[id$='_name']").set
|
29
|
-
find("input[id$='_date']").set
|
28
|
+
find("input[id$='_name']").set "ExpenseLine2Name"
|
29
|
+
find("input[id$='_date']").set "12/06/2015"
|
30
30
|
select @category.name
|
31
31
|
find("input[id$='_total_all_taxes']").set "200"
|
32
|
-
find("input[id$='_vat']").set
|
32
|
+
find("input[id$='_vat']").set "40"
|
33
33
|
end
|
34
34
|
|
35
35
|
find("[type=submit]").click
|
@@ -15,9 +15,7 @@ Given(/^an existing task$/) do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
Given(/^an existing snoozable task$/) do
|
18
|
-
@task = create(:flyboy_task,
|
19
|
-
:term => Time.zone.now.to_date,
|
20
|
-
)
|
18
|
+
@task = create(:flyboy_task, term: Date.current)
|
21
19
|
end
|
22
20
|
|
23
21
|
Given(/^(\d+) existing tasks$/) do |n|
|
@@ -28,7 +26,7 @@ end
|
|
28
26
|
|
29
27
|
Given(/^a task with an owner that's the term is today$/) do
|
30
28
|
@task = create(:flyboy_task,
|
31
|
-
:term =>
|
29
|
+
:term => Date.current,
|
32
30
|
:reminder_type => "custom",
|
33
31
|
:reminder_date => Date.yesterday,
|
34
32
|
:owner => create(:user),
|
@@ -37,7 +35,7 @@ end
|
|
37
35
|
|
38
36
|
Given(/^a task without owner$/) do
|
39
37
|
@task = create(:flyboy_task,
|
40
|
-
:term =>
|
38
|
+
:term => Date.current,
|
41
39
|
:reminder_type => "custom",
|
42
40
|
:reminder_date => Date.yesterday,
|
43
41
|
:owner => nil,
|
@@ -46,7 +44,7 @@ end
|
|
46
44
|
|
47
45
|
Given(/^a closed task with an owner$/) do
|
48
46
|
@task = create(:flyboy_task,
|
49
|
-
:term =>
|
47
|
+
:term => Date.current,
|
50
48
|
:reminder_type => "custom",
|
51
49
|
:reminder_date => Date.yesterday,
|
52
50
|
:owner => create(:user),
|
@@ -163,7 +161,6 @@ Then(/^only undone tasks appear$/) do
|
|
163
161
|
expect(page).to have_content @undone_task.name
|
164
162
|
end
|
165
163
|
|
166
|
-
|
167
164
|
Then(/^all tasks appear$/) do
|
168
165
|
expect(page).to have_content @done_task.name
|
169
166
|
expect(page).to have_content @undone_task.name
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Given(/^an expired tasks$/) do
|
2
|
-
@task = create(:flyboy_task, owner: @user, term:
|
2
|
+
@task = create(:flyboy_task, owner: @user, term: Date.current-1)
|
3
3
|
end
|
4
4
|
|
5
5
|
Given(/^a task that expire tommorow$/) do
|
6
|
-
|
6
|
+
@task = create(:flyboy_task, owner: @user, term: Date.current+1)
|
7
7
|
end
|
8
8
|
|
9
9
|
Given(/^a task that expire today$/) do
|
10
|
-
@task = create(:flyboy_task, owner: @user, term:
|
10
|
+
@task = create(:flyboy_task, owner: @user, term: Date.current)
|
11
11
|
end
|
12
12
|
|
13
13
|
When(/^he go to the tasks summary page$/) do
|
data/features/support/env.rb
CHANGED
data/lib/dorsale/engine.rb
CHANGED
@@ -31,8 +31,8 @@ require "agilibox"
|
|
31
31
|
|
32
32
|
if Rails.env.test? || Rails.env.development?
|
33
33
|
require "pry"
|
34
|
-
require "
|
35
|
-
require "
|
34
|
+
require "factory_bot_rails"
|
35
|
+
require "factory_bot"
|
36
36
|
end
|
37
37
|
|
38
38
|
require "acts-as-taggable-on"
|
@@ -41,9 +41,9 @@ module Dorsale
|
|
41
41
|
class Engine < ::Rails::Engine
|
42
42
|
isolate_namespace Dorsale
|
43
43
|
|
44
|
-
initializer "
|
44
|
+
initializer "factory_bot" do
|
45
45
|
if Rails.env.test? || Rails.env.development?
|
46
|
-
|
46
|
+
FactoryBot.definition_file_paths.unshift Dorsale::Engine.root.join("spec/factories/").to_s
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -54,13 +54,13 @@ module Dorsale
|
|
54
54
|
end
|
55
55
|
|
56
56
|
initializer "check_pundit_policies" do
|
57
|
-
if Rails.env.test? || Rails.env.development?
|
58
|
-
Dorsale::PolicyChecker.check!
|
59
|
-
end
|
57
|
+
Dorsale::PolicyChecker.check! if Rails.env.test? || Rails.env.development?
|
60
58
|
end
|
61
59
|
|
62
60
|
initializer "assets" do
|
63
|
-
Rails.application.config.assets.precompile += %w(
|
61
|
+
Rails.application.config.assets.precompile += %w(
|
62
|
+
dorsale/avatar.png
|
63
|
+
)
|
64
64
|
end
|
65
65
|
|
66
66
|
initializer "simple_form" do
|
data/lib/dorsale/file_loader.rb
CHANGED
data/lib/dorsale/simple_form.rb
CHANGED
@@ -61,7 +61,7 @@ SimpleForm.setup do |config|
|
|
61
61
|
config.boolean_style = :nested
|
62
62
|
|
63
63
|
# Default class for buttons
|
64
|
-
config.button_class =
|
64
|
+
config.button_class = "btn"
|
65
65
|
|
66
66
|
# Method used to tidy up errors. Specify any Rails Array method.
|
67
67
|
# :first lists the first message for each field.
|
@@ -72,7 +72,7 @@ SimpleForm.setup do |config|
|
|
72
72
|
config.error_notification_tag = :div
|
73
73
|
|
74
74
|
# CSS class to add for error notification helper.
|
75
|
-
config.error_notification_class =
|
75
|
+
config.error_notification_class = "error_notification"
|
76
76
|
|
77
77
|
# ID to add for error notification helper.
|
78
78
|
# config.error_notification_id = nil
|
@@ -155,7 +155,7 @@ SimpleForm.setup do |config|
|
|
155
155
|
# config.input_class = nil
|
156
156
|
|
157
157
|
# Define the default class of the input wrapper of the boolean input.
|
158
|
-
config.boolean_label_class =
|
158
|
+
config.boolean_label_class = "checkbox"
|
159
159
|
|
160
160
|
# Defines if the default input wrapper class should be included in radio
|
161
161
|
# collection wrappers.
|
@@ -1,125 +1,125 @@
|
|
1
1
|
# Use this setup block to configure all options available in SimpleForm.
|
2
2
|
SimpleForm.setup do |config|
|
3
|
-
config.error_notification_class =
|
4
|
-
config.button_class =
|
3
|
+
config.error_notification_class = "alert alert-danger"
|
4
|
+
config.button_class = "btn btn-default"
|
5
5
|
config.boolean_label_class = nil
|
6
6
|
|
7
|
-
config.wrappers :vertical_form, tag:
|
7
|
+
config.wrappers :vertical_form, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
8
8
|
b.use :html5
|
9
9
|
b.use :placeholder
|
10
10
|
b.optional :maxlength
|
11
11
|
b.optional :pattern
|
12
12
|
b.optional :min_max
|
13
13
|
b.optional :readonly
|
14
|
-
b.use :label, class:
|
14
|
+
b.use :label, class: "control-label"
|
15
15
|
|
16
|
-
b.use :input, class:
|
17
|
-
b.use :error, wrap_with: { tag:
|
18
|
-
b.use :hint, wrap_with: { tag:
|
16
|
+
b.use :input, class: "form-control"
|
17
|
+
b.use :error, wrap_with: { tag: "span", class: "help-block" }
|
18
|
+
b.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
19
19
|
end
|
20
20
|
|
21
|
-
config.wrappers :vertical_file_input, tag:
|
21
|
+
config.wrappers :vertical_file_input, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
22
22
|
b.use :html5
|
23
23
|
b.use :placeholder
|
24
24
|
b.optional :maxlength
|
25
25
|
b.optional :readonly
|
26
|
-
b.use :label, class:
|
26
|
+
b.use :label, class: "control-label"
|
27
27
|
|
28
28
|
b.use :input
|
29
|
-
b.use :error, wrap_with: { tag:
|
30
|
-
b.use :hint, wrap_with: { tag:
|
29
|
+
b.use :error, wrap_with: { tag: "span", class: "help-block" }
|
30
|
+
b.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
31
31
|
end
|
32
32
|
|
33
|
-
config.wrappers :vertical_boolean, tag:
|
33
|
+
config.wrappers :vertical_boolean, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
34
34
|
b.use :html5
|
35
35
|
b.optional :readonly
|
36
36
|
|
37
|
-
b.wrapper tag:
|
37
|
+
b.wrapper tag: "div", class: "checkbox" do |ba|
|
38
38
|
ba.use :label_input
|
39
39
|
end
|
40
40
|
|
41
|
-
b.use :error, wrap_with: { tag:
|
42
|
-
b.use :hint, wrap_with: { tag:
|
41
|
+
b.use :error, wrap_with: { tag: "span", class: "help-block" }
|
42
|
+
b.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
43
43
|
end
|
44
44
|
|
45
|
-
config.wrappers :vertical_radio_and_checkboxes, tag:
|
45
|
+
config.wrappers :vertical_radio_and_checkboxes, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
46
46
|
b.use :html5
|
47
47
|
b.optional :readonly
|
48
|
-
b.use :label, class:
|
48
|
+
b.use :label, class: "control-label"
|
49
49
|
b.use :input
|
50
|
-
b.use :error, wrap_with: { tag:
|
51
|
-
b.use :hint, wrap_with: { tag:
|
50
|
+
b.use :error, wrap_with: { tag: "span", class: "help-block" }
|
51
|
+
b.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
52
52
|
end
|
53
53
|
|
54
|
-
config.wrappers :horizontal_form, tag:
|
54
|
+
config.wrappers :horizontal_form, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
55
55
|
b.use :html5
|
56
56
|
b.use :placeholder
|
57
57
|
b.optional :maxlength
|
58
58
|
b.optional :pattern
|
59
59
|
b.optional :min_max
|
60
60
|
b.optional :readonly
|
61
|
-
b.use :label, class:
|
61
|
+
b.use :label, class: "col-sm-3 control-label"
|
62
62
|
|
63
|
-
b.wrapper tag:
|
64
|
-
ba.use :input, class:
|
65
|
-
ba.use :error, wrap_with: { tag:
|
66
|
-
ba.use :hint, wrap_with: { tag:
|
63
|
+
b.wrapper tag: "div", class: "col-sm-9" do |ba|
|
64
|
+
ba.use :input, class: "form-control"
|
65
|
+
ba.use :error, wrap_with: { tag: "span", class: "help-block" }
|
66
|
+
ba.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
config.wrappers :horizontal_file_input, tag:
|
70
|
+
config.wrappers :horizontal_file_input, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
71
71
|
b.use :html5
|
72
72
|
b.use :placeholder
|
73
73
|
b.optional :maxlength
|
74
74
|
b.optional :readonly
|
75
|
-
b.use :label, class:
|
75
|
+
b.use :label, class: "col-sm-3 control-label"
|
76
76
|
|
77
|
-
b.wrapper tag:
|
77
|
+
b.wrapper tag: "div", class: "col-sm-9" do |ba|
|
78
78
|
ba.use :input
|
79
|
-
ba.use :error, wrap_with: { tag:
|
80
|
-
ba.use :hint, wrap_with: { tag:
|
79
|
+
ba.use :error, wrap_with: { tag: "span", class: "help-block" }
|
80
|
+
ba.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
config.wrappers :horizontal_boolean, tag:
|
84
|
+
config.wrappers :horizontal_boolean, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
85
85
|
b.use :html5
|
86
86
|
b.optional :readonly
|
87
87
|
|
88
|
-
b.wrapper tag:
|
89
|
-
wr.wrapper tag:
|
90
|
-
ba.use :label_input, class:
|
88
|
+
b.wrapper tag: "div", class: "col-sm-offset-3 col-sm-9" do |wr|
|
89
|
+
wr.wrapper tag: "div", class: "checkbox" do |ba|
|
90
|
+
ba.use :label_input, class: "col-sm-9"
|
91
91
|
end
|
92
92
|
|
93
|
-
wr.use :error, wrap_with: { tag:
|
94
|
-
wr.use :hint, wrap_with: { tag:
|
93
|
+
wr.use :error, wrap_with: { tag: "span", class: "help-block" }
|
94
|
+
wr.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
config.wrappers :horizontal_radio_and_checkboxes, tag:
|
98
|
+
config.wrappers :horizontal_radio_and_checkboxes, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
99
99
|
b.use :html5
|
100
100
|
b.optional :readonly
|
101
101
|
|
102
|
-
b.use :label, class:
|
102
|
+
b.use :label, class: "col-sm-3 control-label"
|
103
103
|
|
104
|
-
b.wrapper tag:
|
104
|
+
b.wrapper tag: "div", class: "col-sm-9" do |ba|
|
105
105
|
ba.use :input
|
106
|
-
ba.use :error, wrap_with: { tag:
|
107
|
-
ba.use :hint, wrap_with: { tag:
|
106
|
+
ba.use :error, wrap_with: { tag: "span", class: "help-block" }
|
107
|
+
ba.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
config.wrappers :inline_form, tag:
|
111
|
+
config.wrappers :inline_form, tag: "div", class: "form-group", error_class: "has-error" do |b|
|
112
112
|
b.use :html5
|
113
113
|
b.use :placeholder
|
114
114
|
b.optional :maxlength
|
115
115
|
b.optional :pattern
|
116
116
|
b.optional :min_max
|
117
117
|
b.optional :readonly
|
118
|
-
b.use :label, class:
|
118
|
+
b.use :label, class: "sr-only"
|
119
119
|
|
120
|
-
b.use :input, class:
|
121
|
-
b.use :error, wrap_with: { tag:
|
122
|
-
b.use :hint, wrap_with: { tag:
|
120
|
+
b.use :input, class: "form-control"
|
121
|
+
b.use :error, wrap_with: { tag: "span", class: "help-block" }
|
122
|
+
b.use :hint, wrap_with: { tag: "p", class: "help-block" }
|
123
123
|
end
|
124
124
|
|
125
125
|
# Wrappers for forms and inputs using the Bootstrap toolkit.
|