dorsale 3.8.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +5 -1
  4. data/app/commands/dorsale/flyboy/task_commands.rb +1 -1
  5. data/app/controllers/concerns/dorsale/flyboy/tasks_summary_concern.rb +0 -1
  6. data/app/controllers/dorsale/alexandrie/attachments_controller.rb +1 -2
  7. data/app/controllers/dorsale/application_controller.rb +0 -1
  8. data/app/controllers/dorsale/billing_machine/application_controller.rb +0 -2
  9. data/app/controllers/dorsale/billing_machine/invoices_controller.rb +9 -22
  10. data/app/controllers/dorsale/billing_machine/payment_terms_controller.rb +0 -1
  11. data/app/controllers/dorsale/billing_machine/quotations_controller.rb +1 -4
  12. data/app/controllers/dorsale/comments_controller.rb +3 -2
  13. data/app/controllers/dorsale/customer_vault/activity_types_controller.rb +0 -1
  14. data/app/controllers/dorsale/customer_vault/application_controller.rb +0 -1
  15. data/app/controllers/dorsale/customer_vault/links_controller.rb +22 -12
  16. data/app/controllers/dorsale/customer_vault/origins_controller.rb +0 -1
  17. data/app/controllers/dorsale/customer_vault/people_controller.rb +2 -3
  18. data/app/controllers/dorsale/expense_gun/categories_controller.rb +0 -1
  19. data/app/controllers/dorsale/expense_gun/expenses_controller.rb +0 -1
  20. data/app/controllers/dorsale/flyboy/task_comments_controller.rb +0 -1
  21. data/app/controllers/dorsale/flyboy/tasks_controller.rb +28 -21
  22. data/app/controllers/dorsale/users_controller.rb +0 -1
  23. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +9 -5
  24. data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb +2 -2
  25. data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +1 -1
  26. data/app/helpers/dorsale/billing_machine/application_helper.rb +6 -6
  27. data/app/helpers/dorsale/context_helper.rb +1 -1
  28. data/app/helpers/dorsale/flyboy/application_helper.rb +4 -5
  29. data/app/mailers/dorsale/billing_machine/invoice_mailer.rb +0 -1
  30. data/app/mailers/dorsale/flyboy/task_mailer.rb +0 -1
  31. data/app/mailers/dorsale/user_mailer.rb +0 -1
  32. data/app/models/dorsale/address.rb +2 -2
  33. data/app/models/dorsale/alexandrie/attachment_type.rb +0 -1
  34. data/app/models/dorsale/billing_machine.rb +1 -2
  35. data/app/models/dorsale/billing_machine/invoice.rb +19 -30
  36. data/app/models/dorsale/billing_machine/invoice_line.rb +2 -2
  37. data/app/models/dorsale/billing_machine/quotation.rb +11 -17
  38. data/app/models/dorsale/billing_machine/quotation_line.rb +2 -3
  39. data/app/models/dorsale/comment.rb +1 -1
  40. data/app/models/dorsale/customer_vault/corporation.rb +11 -10
  41. data/app/models/dorsale/customer_vault/event.rb +2 -2
  42. data/app/models/dorsale/customer_vault/individual.rb +4 -2
  43. data/app/models/dorsale/customer_vault/person.rb +14 -4
  44. data/app/models/dorsale/customer_vault/person_data.rb +1 -2
  45. data/app/models/dorsale/expense_gun/expense.rb +2 -5
  46. data/app/models/dorsale/expense_gun/expense_line.rb +2 -2
  47. data/app/models/dorsale/flyboy/task.rb +17 -18
  48. data/app/models/dorsale/flyboy/task_comment.rb +1 -1
  49. data/app/models/dorsale/users/active.rb +1 -1
  50. data/app/models/dorsale/users/avatar.rb +2 -1
  51. data/app/models/dorsale/users/password_generation.rb +0 -1
  52. data/app/pdfs/concerns/dorsale/alexandrie/prawn/render_with_attachments.rb +1 -1
  53. data/app/pdfs/dorsale/application_pdf.rb +7 -0
  54. data/app/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf.rb +52 -47
  55. data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +94 -205
  56. data/app/pdfs/dorsale/prawn_helpers.rb +107 -0
  57. data/app/policies/dorsale/application_policy.rb +2 -4
  58. data/app/policies/dorsale/expense_gun/expense_policy_helper.rb +0 -1
  59. data/app/policies/dorsale/flyboy/task_policy_helper.rb +3 -3
  60. data/app/policies/dorsale/policy_checker.rb +11 -18
  61. data/app/services/dorsale/billing_machine/invoice/copy.rb +2 -2
  62. data/app/services/dorsale/billing_machine/pdf_file_generator.rb +7 -2
  63. data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -1
  64. data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +10 -7
  65. data/app/services/dorsale/flyboy/task/snoozer.rb +1 -1
  66. data/app/views/dorsale/billing_machine/invoices/_details.html.slim +1 -2
  67. data/app/views/dorsale/billing_machine/invoices/_form.html.slim +4 -11
  68. data/app/views/dorsale/billing_machine/invoices/index.xlsx.ruby +1 -1
  69. data/app/views/dorsale/flyboy/tasks/index.xlsx.ruby +1 -1
  70. data/config/locales/alexandrie.en.yml +0 -4
  71. data/config/locales/alexandrie.fr.yml +0 -4
  72. data/config/locales/billing_machine.en.yml +0 -41
  73. data/config/locales/billing_machine.fr.yml +0 -41
  74. data/config/routes.rb +0 -1
  75. data/db/migrate/20161119064536_delete_id_cards.rb +9 -0
  76. data/features/billing_machine_invoices.feature +0 -1
  77. data/features/billing_machine_multiple_vat.feature +0 -1
  78. data/features/billing_machine_quotations.feature +0 -1
  79. data/features/step_definitions/billing_machine_invoices_steps.rb +73 -79
  80. data/features/step_definitions/billing_machine_multiple_vat.rb +5 -6
  81. data/features/step_definitions/billing_machine_payment_terms_steps.rb +2 -2
  82. data/features/step_definitions/billing_machine_quotations_steps.rb +45 -80
  83. data/features/step_definitions/common_steps.rb +0 -4
  84. data/features/step_definitions/customer_vault_activity_types_steps.rb +1 -1
  85. data/features/step_definitions/customer_vault_corporations_steps.rb +27 -23
  86. data/features/step_definitions/customer_vault_individuals_steps.rb +8 -9
  87. data/features/step_definitions/customer_vault_invoices_steps.rb +1 -1
  88. data/features/step_definitions/customer_vault_links_steps.rb +6 -6
  89. data/features/step_definitions/customer_vault_origins_steps.rb +1 -1
  90. data/features/step_definitions/customer_vault_people_steps.rb +2 -1
  91. data/features/step_definitions/expense_gun_categories_steps.rb +2 -2
  92. data/features/step_definitions/expense_gun_expenses_steps.rb +6 -6
  93. data/features/step_definitions/flyboy_tasks_steps.rb +4 -7
  94. data/features/step_definitions/tasks_summary_steps.rb +3 -3
  95. data/features/support/env.rb +3 -2
  96. data/lib/dorsale/engine.rb +8 -8
  97. data/lib/dorsale/file_loader.rb +1 -1
  98. data/lib/dorsale/simple_form.rb +3 -3
  99. data/lib/dorsale/simple_form_bootstrap.rb +46 -46
  100. data/lib/dorsale/version.rb +1 -1
  101. data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +3 -3
  102. data/spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb +0 -1
  103. data/spec/controllers/dorsale/comments_controller_spec.rb +1 -1
  104. data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +9 -9
  105. data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +15 -19
  106. data/spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb +1 -2
  107. data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +43 -19
  108. data/spec/factories/alexandrie_attachment_types.rb +1 -1
  109. data/spec/factories/alexandrie_attachments.rb +1 -1
  110. data/spec/factories/billing_machine_invoice_lines.rb +1 -1
  111. data/spec/factories/billing_machine_invoices.rb +1 -2
  112. data/spec/factories/billing_machine_payment_terms.rb +1 -1
  113. data/spec/factories/billing_machine_quotation_lines.rb +1 -2
  114. data/spec/factories/billing_machine_quotations.rb +1 -2
  115. data/spec/factories/customer_vault_activity_types.rb +1 -1
  116. data/spec/factories/customer_vault_corporations.rb +1 -1
  117. data/spec/factories/customer_vault_event.rb +1 -1
  118. data/spec/factories/customer_vault_individuals.rb +2 -2
  119. data/spec/factories/customer_vault_links.rb +1 -1
  120. data/spec/factories/customer_vault_origins.rb +1 -1
  121. data/spec/factories/dorsale_addresses.rb +1 -1
  122. data/spec/factories/dorsale_comments.rb +1 -1
  123. data/spec/factories/expense_gun_categories.rb +2 -2
  124. data/spec/factories/expense_gun_expense_lines.rb +8 -8
  125. data/spec/factories/expense_gun_expenses.rb +2 -3
  126. data/spec/factories/flyboy_task_comments.rb +1 -1
  127. data/spec/factories/flyboy_tasks.rb +1 -1
  128. data/spec/mailers/user_mailer.rb +5 -6
  129. data/spec/models/dorsale/address_spec.rb +26 -26
  130. data/spec/models/dorsale/billing_machine/invoice_line_spec.rb +6 -6
  131. data/spec/models/dorsale/billing_machine/invoice_spec.rb +37 -23
  132. data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +9 -10
  133. data/spec/models/dorsale/billing_machine/quotation_spec.rb +26 -28
  134. data/spec/models/dorsale/billing_machine_spec.rb +0 -1
  135. data/spec/models/dorsale/comment_spec.rb +0 -1
  136. data/spec/models/dorsale/customer_vault/corporation_spec.rb +20 -20
  137. data/spec/models/dorsale/customer_vault/event_spec.rb +1 -1
  138. data/spec/models/dorsale/customer_vault/individual_spec.rb +0 -2
  139. data/spec/models/dorsale/customer_vault/link_spec.rb +0 -1
  140. data/spec/models/dorsale/customer_vault/person_spec.rb +7 -6
  141. data/spec/models/dorsale/expense_gun/category_spec.rb +2 -2
  142. data/spec/models/dorsale/expense_gun/expense_line_spec.rb +14 -14
  143. data/spec/models/dorsale/expense_gun/expense_spec.rb +23 -13
  144. data/spec/models/dorsale/flyboy/task_comment_spec.rb +5 -6
  145. data/spec/models/dorsale/flyboy/task_spec.rb +66 -42
  146. data/spec/models/dorsale/users_spec.rb +3 -5
  147. data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +6 -11
  148. data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +7 -11
  149. data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +6 -11
  150. data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +7 -14
  151. data/spec/rails_helper.rb +1 -1
  152. data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +0 -1
  153. data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +0 -1
  154. data/spec/routing/dorsale/comments_routing_spec.rb +0 -2
  155. data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +0 -1
  156. data/spec/routing/dorsale/expense_gun/expenses_routing_spec.rb +0 -1
  157. data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +0 -1
  158. data/spec/routing/dorsale/users_routing_spec.rb +1 -1
  159. data/spec/services/dorsale/billing_machine/quotation/copy_spec.rb +2 -2
  160. data/spec/services/dorsale/expense_gun/expense/copy_spec.rb +13 -17
  161. data/spec/services/dorsale/flyboy/task/copy_spec.rb +1 -2
  162. data/spec/services/dorsale/flyboy/task/snoozer_spec.rb +3 -3
  163. data/spec/spec_helper.rb +1 -0
  164. metadata +5 -43
  165. data/app/controllers/dorsale/billing_machine/id_cards_controller.rb +0 -106
  166. data/app/models/dorsale/billing_machine/id_card.rb +0 -14
  167. data/app/policies/dorsale/billing_machine/id_card_policy_helper.rb +0 -7
  168. data/app/views/dorsale/billing_machine/id_cards/_form.html.slim +0 -42
  169. data/app/views/dorsale/billing_machine/id_cards/_index_actions.html.slim +0 -2
  170. data/app/views/dorsale/billing_machine/id_cards/_list.html.slim +0 -27
  171. data/app/views/dorsale/billing_machine/id_cards/edit.html.slim +0 -1
  172. data/app/views/dorsale/billing_machine/id_cards/index.html.slim +0 -11
  173. data/app/views/dorsale/billing_machine/id_cards/new.html.slim +0 -1
  174. data/features/billing_machine_id_cards.feature +0 -19
  175. data/features/step_definitions/billing_machine_id_cards_steps.rb +0 -53
  176. data/features/support/ajax.rb +0 -20
  177. data/features/support/database_cleaner.rb +0 -12
  178. data/features/support/factory_girl.rb +0 -1
  179. data/features/support/fix_referrer.rb +0 -9
  180. data/features/support/message_delivery.rb +0 -1
  181. data/features/support/poltergeist.rb +0 -22
  182. data/features/support/rails.rb +0 -1
  183. data/features/support/rspec.rb +0 -6
  184. data/features/support/screenshots.rb +0 -5
  185. data/features/support/sign_in.rb +0 -17
  186. data/features/support/simplecov.rb +0 -1
  187. data/features/support/turbolinks.rb +0 -30
  188. data/spec/factories/billing_machine_id_cards.rb +0 -26
  189. 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 'activity_type_name', with: "Activity Name"
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 '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'
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 '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"
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 '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'
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 '2'
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 '.person', count: count
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 = ::Dorsale::Flyboy::Task.create!(taskable: @corporation, progress: 20, name: "I-am-open")
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 = ::Dorsale::Flyboy::Task.create!(taskable: @corporation, progress: 100, done: true, name: "I-am-closed")
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!(alice: @corporation, bob: @individual, title: "I-am-a-link")
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 (@corporations_count - 1)
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 'person_first_name', with: 'Benoit'
9
- fill_in 'person_last_name', with: 'Gantaume'
10
- fill_in 'person_email', with: 'benoit@agilidee.com'
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 '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'
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
- @invoice = create(:billing_machine_invoice, customer: @person)
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 'link_title', with: 'Manager'
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 'link_title', with: 'Manager 2'
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 'link_title', with: 'Manager'
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 '.title', text: 'Manager'
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 '.title', text: 'Manager 2'
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 '.title', text: 'Manager'
73
+ expect(page).to_not have_selector ".title", text: "Manager"
74
74
  end
@@ -4,7 +4,7 @@ Given(/^the user goes on the new origin page$/) do
4
4
  end
5
5
 
6
6
  When(/^he fills the origin's information$/) do
7
- fill_in 'origin_name', with: "Origin Name"
7
+ fill_in "origin_name", with: "Origin Name"
8
8
  end
9
9
 
10
10
  When(/^creates a new origin$/) do
@@ -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
- @comment = create(:customer_vault_event_comment, person: @person, text: Faker::Lorem.paragraph(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 'category_name', with: "Category Name"
8
- fill_in 'category_code', with: "Category Code"
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 "ExpenseLine1Name"
18
- find("input[id$='_date']").set "21/06/2015"
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 "20"
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 "ExpenseLine2Name"
29
- find("input[id$='_date']").set "12/06/2015"
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 "40"
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 => Time.zone.now.to_date,
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 => Time.zone.now.to_date,
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 => Time.zone.now.to_date,
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: Time.zone.now.to_date-1)
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
- @task = create(:flyboy_task, owner: @user, term: Time.zone.now.to_date+1)
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: Time.zone.now.to_date)
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
@@ -1,3 +1,4 @@
1
- ENV["RAILS_ROOT"] ||= File.expand_path("../../../spec/dummy", __FILE__)
2
-
1
+ ENV["RAILS_ROOT"] ||= File.expand_path("../../../spec/dummy", __FILE__)
3
2
  require "cucumber/rails"
3
+ require "agilibox/cucumber_config"
4
+ Agilibox::CucumberConfig.require_all_helpers!
@@ -31,8 +31,8 @@ require "agilibox"
31
31
 
32
32
  if Rails.env.test? || Rails.env.development?
33
33
  require "pry"
34
- require "factory_girl_rails"
35
- require "factory_girl"
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 "factory_girl" do
44
+ initializer "factory_bot" do
45
45
  if Rails.env.test? || Rails.env.development?
46
- FactoryGirl.definition_file_paths.unshift Dorsale::Engine.root.join("spec/factories/").to_s
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( dorsale/avatar.png )
61
+ Rails.application.config.assets.precompile += %w(
62
+ dorsale/avatar.png
63
+ )
64
64
  end
65
65
 
66
66
  initializer "simple_form" do
@@ -1,6 +1,6 @@
1
1
  module Kernel
2
2
  def dorsale_file
3
- app_file = caller.first.split(":").first
3
+ app_file = caller(1..1).first.split(":").first
4
4
  app_root = ::Rails.application.root.to_s
5
5
  relative_file = app_file.sub(app_root, "")
6
6
  dorsale_root = ::Dorsale::Engine.root.to_s
@@ -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 = 'btn'
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 = 'error_notification'
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 = 'checkbox'
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 = 'alert alert-danger'
4
- config.button_class = 'btn btn-default'
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'control-label'
14
+ b.use :label, class: "control-label"
15
15
 
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' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'control-label'
26
+ b.use :label, class: "control-label"
27
27
 
28
28
  b.use :input
29
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
30
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'div', class: 'checkbox' do |ba|
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: 'span', class: 'help-block' }
42
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'control-label'
48
+ b.use :label, class: "control-label"
49
49
  b.use :input
50
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
51
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'col-sm-3 control-label'
61
+ b.use :label, class: "col-sm-3 control-label"
62
62
 
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' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'col-sm-3 control-label'
75
+ b.use :label, class: "col-sm-3 control-label"
76
76
 
77
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
77
+ b.wrapper tag: "div", class: "col-sm-9" do |ba|
78
78
  ba.use :input
79
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
80
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: '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'
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: 'span', class: 'help-block' }
94
- wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'col-sm-3 control-label'
102
+ b.use :label, class: "col-sm-3 control-label"
103
103
 
104
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
104
+ b.wrapper tag: "div", class: "col-sm-9" do |ba|
105
105
  ba.use :input
106
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
107
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
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: 'div', class: 'form-group', error_class: 'has-error' do |b|
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: 'sr-only'
118
+ b.use :label, class: "sr-only"
119
119
 
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' }
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.