dorsale 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/app/controllers/dorsale/alexandrie/attachments_controller.rb +1 -1
- data/app/controllers/dorsale/application_controller.rb +1 -1
- data/app/controllers/dorsale/billing_machine/application_controller.rb +1 -1
- data/app/controllers/dorsale/billing_machine/invoices_controller.rb +1 -1
- data/app/controllers/dorsale/billing_machine/payment_terms_controller.rb +1 -1
- data/app/controllers/dorsale/billing_machine/quotations_controller.rb +1 -1
- data/app/controllers/dorsale/comments_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/activity_types_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/application_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/events_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/links_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/origins_controller.rb +1 -1
- data/app/controllers/dorsale/customer_vault/people_controller.rb +1 -1
- data/app/controllers/dorsale/expense_gun/application_controller.rb +1 -1
- data/app/controllers/dorsale/expense_gun/categories_controller.rb +1 -1
- data/app/controllers/dorsale/flyboy/application_controller.rb +1 -1
- data/app/controllers/dorsale/flyboy/task_comments_controller.rb +1 -1
- data/app/controllers/dorsale/flyboy/tasks_controller.rb +1 -1
- data/app/controllers/dorsale/users_controller.rb +1 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_for_invoices.rb +1 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_for_quotations.rb +1 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_customer.rb +1 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_payment_status.rb +1 -1
- data/app/filters/dorsale/billing_machine/small_data/filter_strategy_by_state.rb +1 -1
- data/app/filters/dorsale/customer_vault/small_data/filter_for_events.rb +1 -1
- data/app/filters/dorsale/customer_vault/small_data/filter_for_people.rb +1 -1
- data/app/filters/dorsale/customer_vault/small_data/filter_strategy_by_activity_type.rb +1 -1
- data/app/filters/dorsale/expense_gun/small_data/filter_for_expenses.rb +1 -1
- data/app/filters/dorsale/flyboy/small_data/filter_for_tasks.rb +1 -1
- data/app/filters/dorsale/flyboy/small_data/filter_strategy_by_task_state.rb +2 -2
- data/app/mailers/dorsale/application_mailer.rb +1 -1
- data/app/mailers/dorsale/flyboy/task_mailer.rb +1 -1
- data/app/mailers/dorsale/user_mailer.rb +1 -1
- data/app/models/dorsale/address.rb +3 -3
- data/app/models/dorsale/alexandrie/attachment.rb +1 -1
- data/app/models/dorsale/alexandrie/attachment_type.rb +1 -1
- data/app/models/dorsale/billing_machine/invoice.rb +1 -1
- data/app/models/dorsale/billing_machine/invoice_line.rb +1 -1
- data/app/models/dorsale/billing_machine/payment_term.rb +1 -1
- data/app/models/dorsale/billing_machine/quotation.rb +2 -2
- data/app/models/dorsale/billing_machine/quotation_line.rb +1 -1
- data/app/models/dorsale/comment.rb +1 -1
- data/app/models/dorsale/customer_vault/activity_type.rb +1 -1
- data/app/models/dorsale/customer_vault/corporation.rb +2 -2
- data/app/models/dorsale/customer_vault/event.rb +3 -3
- data/app/models/dorsale/customer_vault/individual.rb +2 -2
- data/app/models/dorsale/customer_vault/link.rb +1 -1
- data/app/models/dorsale/customer_vault/origin.rb +1 -1
- data/app/models/dorsale/customer_vault/person.rb +5 -5
- data/app/models/dorsale/expense_gun/category.rb +1 -1
- data/app/models/dorsale/expense_gun/expense.rb +2 -2
- data/app/models/dorsale/expense_gun/expense_line.rb +1 -1
- data/app/models/dorsale/flyboy/task.rb +4 -4
- data/app/models/dorsale/flyboy/task_comment.rb +1 -1
- data/app/pdfs/dorsale/application_pdf.rb +1 -1
- data/app/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf.rb +13 -13
- data/app/pdfs/dorsale/billing_machine/invoice_single_vat_pdf.rb +13 -13
- data/app/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf.rb +1 -1
- data/app/pdfs/dorsale/billing_machine/quotation_single_vat_pdf.rb +1 -1
- data/app/pdfs/dorsale/expense_gun/expense_pdf.rb +2 -2
- data/app/pdfs/dorsale/prawn_helpers.rb +2 -2
- data/app/policies/dorsale/application_policy.rb +1 -1
- data/app/services/dorsale/billing_machine/invoice/copy.rb +1 -1
- data/app/services/dorsale/billing_machine/invoice/statistics.rb +2 -2
- data/app/services/dorsale/billing_machine/quotation/copy.rb +1 -1
- data/app/services/dorsale/billing_machine/quotation/statistics.rb +2 -2
- data/app/services/dorsale/billing_machine/quotation/to_invoice.rb +5 -5
- data/app/services/dorsale/expense_gun/expense/copy.rb +1 -1
- data/app/services/dorsale/flyboy/task/copy.rb +1 -1
- data/app/services/dorsale/flyboy/task/snoozer.rb +1 -1
- data/app/services/dorsale/service.rb +2 -2
- data/app/services/dorsale/tag_list_for_model.rb +1 -1
- data/app/uploaders/dorsale/alexandrie/file_uploader.rb +1 -1
- data/app/uploaders/dorsale/application_uploader.rb +1 -1
- data/app/uploaders/dorsale/avatar_uploader.rb +1 -1
- data/app/uploaders/dorsale/image_uploader.rb +2 -2
- data/app/uploaders/dorsale/pdf_uploader.rb +2 -2
- data/app/views/dorsale/customer_vault/people/index.xlsx.ruby +3 -3
- data/features/step_definitions/billing_machine_invoices_steps.rb +3 -3
- data/features/step_definitions/billing_machine_multiple_vat.rb +1 -1
- data/features/step_definitions/billing_machine_quotations_steps.rb +2 -2
- data/features/step_definitions/customer_vault_corporations_steps.rb +3 -3
- data/features/step_definitions/customer_vault_tasks_steps.rb +3 -3
- data/lib/dorsale/engine.rb +5 -5
- data/lib/dorsale/version.rb +1 -1
- data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +1 -1
- data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +1 -1
- data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +1 -1
- data/spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb +1 -1
- 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 -1
- data/spec/factories/billing_machine_payment_terms.rb +1 -1
- data/spec/factories/billing_machine_quotation_lines.rb +1 -1
- data/spec/factories/billing_machine_quotations.rb +1 -1
- 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 +1 -1
- 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 +1 -1
- data/spec/factories/expense_gun_expense_lines.rb +1 -1
- data/spec/factories/expense_gun_expenses.rb +1 -1
- data/spec/factories/flyboy_task_comments.rb +1 -1
- data/spec/factories/flyboy_tasks.rb +1 -1
- data/spec/mailers/user_mailer_spec.rb +2 -2
- data/spec/models/dorsale/alexandrie/attachment_spec.rb +1 -1
- data/spec/models/dorsale/alexandrie/attachment_type_spec.rb +1 -1
- data/spec/models/dorsale/billing_machine/invoice_spec.rb +5 -5
- data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +1 -1
- data/spec/models/dorsale/billing_machine/quotation_spec.rb +4 -4
- data/spec/models/dorsale/billing_machine_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/activity_type_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/corporation_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/event_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/individual_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/link_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/origin_spec.rb +1 -1
- data/spec/models/dorsale/customer_vault/person_spec.rb +1 -1
- data/spec/models/dorsale/expense_gun/category_spec.rb +1 -1
- data/spec/models/dorsale/expense_gun/expense_line_spec.rb +1 -1
- data/spec/models/dorsale/flyboy/task_spec.rb +5 -5
- data/spec/models/dorsale/i18n_spec.rb +1 -1
- data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +3 -3
- data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +3 -3
- data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +3 -3
- data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +3 -3
- data/spec/rails_helper.rb +0 -3
- data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +2 -2
- data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +2 -2
- data/spec/routing/dorsale/customer_vault/activity_types_routing_spec.rb +2 -2
- data/spec/routing/dorsale/customer_vault/events_routing_spec.rb +2 -2
- data/spec/routing/dorsale/customer_vault/origins_routing_spec.rb +2 -2
- data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +2 -2
- data/spec/routing/dorsale/expense_gun/expenses_routing_spec.rb +2 -2
- data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +2 -2
- data/spec/routing/dorsale/flyboy/tasks_routing_spec.rb +2 -2
- data/spec/routing/dorsale/users_routing_spec.rb +2 -2
- data/spec/services/dorsale/expense_gun/expense/copy_spec.rb +2 -2
- metadata +48 -51
|
@@ -150,7 +150,7 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
|
|
|
150
150
|
content << main_document.customer.european_union_vat_number
|
|
151
151
|
end
|
|
152
152
|
|
|
153
|
-
content.
|
|
153
|
+
content.compact_blank.join("\n")
|
|
154
154
|
end
|
|
155
155
|
|
|
156
156
|
def build_customer
|
|
@@ -214,11 +214,11 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
|
|
|
214
214
|
bb height: height do
|
|
215
215
|
table_products = [
|
|
216
216
|
[
|
|
217
|
-
main_document.t(:designation).
|
|
218
|
-
main_document.t(:quantity).
|
|
219
|
-
main_document.t(:unit).
|
|
220
|
-
main_document.t(:unit_price).
|
|
221
|
-
main_document.t(:line_total).
|
|
217
|
+
main_document.t(:designation).upcase.to_s,
|
|
218
|
+
main_document.t(:quantity).upcase.to_s,
|
|
219
|
+
main_document.t(:unit).upcase.to_s,
|
|
220
|
+
main_document.t(:unit_price).upcase.to_s,
|
|
221
|
+
main_document.t(:line_total).upcase.to_s,
|
|
222
222
|
],
|
|
223
223
|
]
|
|
224
224
|
|
|
@@ -260,35 +260,35 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
|
|
|
260
260
|
|
|
261
261
|
if has_discount
|
|
262
262
|
table_totals.push [
|
|
263
|
-
main_document.t(:commercial_discount).
|
|
263
|
+
main_document.t(:commercial_discount).upcase.to_s,
|
|
264
264
|
bm_currency(-main_document.commercial_discount),
|
|
265
265
|
]
|
|
266
266
|
end
|
|
267
267
|
|
|
268
268
|
table_totals.push [
|
|
269
|
-
main_document.t(:total_excluding_taxes).
|
|
269
|
+
main_document.t(:total_excluding_taxes).upcase.to_s,
|
|
270
270
|
bm_currency(main_document.total_excluding_taxes),
|
|
271
271
|
]
|
|
272
272
|
|
|
273
273
|
vat_rate = number(main_document.vat_rate)
|
|
274
274
|
table_totals.push [
|
|
275
|
-
"#{main_document.t(:vat).
|
|
275
|
+
"#{main_document.t(:vat).upcase} #{percentage vat_rate}",
|
|
276
276
|
bm_currency(main_document.vat_amount),
|
|
277
277
|
]
|
|
278
278
|
|
|
279
279
|
if has_advance
|
|
280
280
|
table_totals.push [
|
|
281
|
-
main_document.t(:advance).
|
|
281
|
+
main_document.t(:advance).upcase.to_s,
|
|
282
282
|
bm_currency(main_document.advance),
|
|
283
283
|
]
|
|
284
284
|
|
|
285
285
|
table_totals.push [
|
|
286
|
-
main_document.t(:total_including_taxes).
|
|
286
|
+
main_document.t(:total_including_taxes).upcase.to_s,
|
|
287
287
|
bm_currency(main_document.balance),
|
|
288
288
|
]
|
|
289
289
|
else
|
|
290
290
|
table_totals.push [
|
|
291
|
-
main_document.t(:total_including_taxes).
|
|
291
|
+
main_document.t(:total_including_taxes).upcase.to_s,
|
|
292
292
|
bm_currency(main_document.total_including_taxes),
|
|
293
293
|
]
|
|
294
294
|
end
|
|
@@ -325,7 +325,7 @@ class Dorsale::BillingMachine::InvoiceSingleVatPdf < Dorsale::ApplicationPdf
|
|
|
325
325
|
|
|
326
326
|
txt << main_document.comments
|
|
327
327
|
|
|
328
|
-
txt.
|
|
328
|
+
txt.compact_blank.join("\n\n")
|
|
329
329
|
end
|
|
330
330
|
|
|
331
331
|
def build_document_infos
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
class Dorsale::BillingMachine::QuotationMultipleVatPdf <
|
|
1
|
+
class Dorsale::BillingMachine::QuotationMultipleVatPdf < Dorsale::BillingMachine::InvoiceMultipleVatPdf
|
|
2
2
|
include ::Dorsale::BillingMachine::QuotationPdfCommonMethods
|
|
3
3
|
end
|
|
@@ -34,11 +34,11 @@ class Dorsale::ExpenseGun::ExpensePdf < Dorsale::ApplicationPdf
|
|
|
34
34
|
|
|
35
35
|
private
|
|
36
36
|
|
|
37
|
-
def info(obj, attribute, helper: nil, **
|
|
37
|
+
def info(obj, attribute, helper: nil, **)
|
|
38
38
|
key = obj.t(attribute)
|
|
39
39
|
value = obj.public_send(attribute)
|
|
40
40
|
value = helper ? H.public_send(helper, value) : value.to_s
|
|
41
|
-
text
|
|
41
|
+
text("<b>#{key} :</b> #{value}", inline_format: true, **)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def table_data
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class Dorsale::BillingMachine::Quotation::ToInvoice <
|
|
1
|
+
class Dorsale::BillingMachine::Quotation::ToInvoice < Dorsale::Service
|
|
2
2
|
attr_accessor :quotation, :invoice
|
|
3
3
|
|
|
4
4
|
def initialize(quotation)
|
|
@@ -12,8 +12,8 @@ class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
|
|
|
12
12
|
quotation.attributes.each do |k, v|
|
|
13
13
|
next if ignored_key?(k)
|
|
14
14
|
|
|
15
|
-
if invoice.respond_to?("#{k}=")
|
|
16
|
-
invoice.public_send("#{k}=", v)
|
|
15
|
+
if invoice.respond_to?(:"#{k}=")
|
|
16
|
+
invoice.public_send(:"#{k}=", v)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -23,8 +23,8 @@ class Dorsale::BillingMachine::Quotation::ToInvoice < ::Dorsale::Service
|
|
|
23
23
|
quotation_line.attributes.each do |k, v|
|
|
24
24
|
next if ignored_key?(k)
|
|
25
25
|
|
|
26
|
-
if invoice_line.respond_to?("#{k}=")
|
|
27
|
-
invoice_line.public_send("#{k}=", v)
|
|
26
|
+
if invoice_line.respond_to?(:"#{k}=")
|
|
27
|
+
invoice_line.public_send(:"#{k}=", v)
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class Dorsale::Alexandrie::FileUploader <
|
|
1
|
+
class Dorsale::Alexandrie::FileUploader < Dorsale::ApplicationUploader
|
|
2
2
|
end
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class Dorsale::ApplicationUploader <
|
|
1
|
+
class Dorsale::ApplicationUploader < ApplicationUploader
|
|
2
2
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
fields = %w
|
|
1
|
+
fields = %w[
|
|
2
2
|
person_type
|
|
3
3
|
first_name
|
|
4
4
|
last_name
|
|
@@ -26,7 +26,7 @@ fields = %w(
|
|
|
26
26
|
address.city
|
|
27
27
|
address.zip
|
|
28
28
|
address.country
|
|
29
|
-
|
|
29
|
+
]
|
|
30
30
|
|
|
31
31
|
data = []
|
|
32
32
|
|
|
@@ -41,7 +41,7 @@ data << fields.map { |field| model.t(field) }
|
|
|
41
41
|
elsif field.include?("address.")
|
|
42
42
|
line << person.address.public_send(field.gsub("address.", ""))
|
|
43
43
|
else
|
|
44
|
-
line << person.
|
|
44
|
+
line << person.try(field)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -23,7 +23,7 @@ Given(/^an existing paid invoice$/) do
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
Given(/^billing machine in single vat mode$/) do
|
|
26
|
-
|
|
26
|
+
Dorsale::BillingMachine.vat_mode = :single
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
Given(/^a bunch of existing invoices$/) do
|
|
@@ -149,7 +149,7 @@ When(/^he changes the advance to "(.*?)"€$/) do |value|
|
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
When(/^he goes to the newly created invoice page$/) do
|
|
152
|
-
@invoice =
|
|
152
|
+
@invoice = Dorsale::BillingMachine::Invoice.last_created
|
|
153
153
|
visit dorsale.edit_billing_machine_invoice_path(@invoice)
|
|
154
154
|
end
|
|
155
155
|
|
|
@@ -205,7 +205,7 @@ Then(/^it's added to the invoice list$/) do
|
|
|
205
205
|
step("the user goes to the invoices page")
|
|
206
206
|
expect(page).to have_selector ".invoice .date", text: @date
|
|
207
207
|
# There are no other invoices for this test so we should get the right number
|
|
208
|
-
tracking_id =
|
|
208
|
+
tracking_id = Dorsale::BillingMachine::Invoice.first.tracking_id
|
|
209
209
|
expect(page).to have_selector ".invoice .tracking_id", text: tracking_id
|
|
210
210
|
expect(page).to have_selector ".invoice .customer_name", text: @customer.name
|
|
211
211
|
expect(page).to have_selector ".invoice .total_excluding_taxes", text: "180,00 €"
|
|
@@ -18,7 +18,7 @@ end
|
|
|
18
18
|
|
|
19
19
|
Given(/^(\d+) associated documents to this quotation$/) do |n|
|
|
20
20
|
n.to_i.times do |i|
|
|
21
|
-
instance_variable_set "@document#{i}", create(:alexandrie_attachment, attachable: @quotation)
|
|
21
|
+
instance_variable_set :"@document#{i}", create(:alexandrie_attachment, attachable: @quotation)
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -165,7 +165,7 @@ Then(/^he will see links to the documents$/) do
|
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
Then(/^the quotation informations are visible on the quotation details$/) do
|
|
168
|
-
@quotation =
|
|
168
|
+
@quotation = Dorsale::BillingMachine::Quotation.last_created
|
|
169
169
|
visit dorsale.billing_machine_quotation_path(@quotation)
|
|
170
170
|
expect(page).to have_content @payment_term.label
|
|
171
171
|
expect(page).to have_content "I-am-a-comment"
|
|
@@ -182,7 +182,7 @@ Given(/^a closed task to this corporation$/) do
|
|
|
182
182
|
end
|
|
183
183
|
|
|
184
184
|
Given(/^a link between this individual and this corporation$/) do
|
|
185
|
-
@link =
|
|
185
|
+
@link = Dorsale::CustomerVault::Link.create!(
|
|
186
186
|
:alice => @corporation,
|
|
187
187
|
:bob => @individual,
|
|
188
188
|
:title => "I-am-a-link",
|
|
@@ -203,14 +203,14 @@ Then(/^I am on the corporation page$/) do
|
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
When(/^I delete this corporation$/) do
|
|
206
|
-
@corporations_count =
|
|
206
|
+
@corporations_count = Dorsale::CustomerVault::Corporation.count
|
|
207
207
|
|
|
208
208
|
find(".context [href$=edit]").click
|
|
209
209
|
find(".context [data-method=delete]").click
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
Then(/^the corporation is deleted$/) do
|
|
213
|
-
expect(
|
|
213
|
+
expect(Dorsale::CustomerVault::Corporation.count).to eq(@corporations_count - 1)
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
Then(/^I am on the people page$/) do
|
|
@@ -3,7 +3,7 @@ When(/^I go on the tasks section$/) do
|
|
|
3
3
|
end
|
|
4
4
|
|
|
5
5
|
When(/^I create a task on this person$/) do
|
|
6
|
-
@tasks_count =
|
|
6
|
+
@tasks_count = Dorsale::Flyboy::Task.count
|
|
7
7
|
find("#context-main a[href*='tasks/new']").click
|
|
8
8
|
fill_in :task_name, with: "YepYep"
|
|
9
9
|
fill_in :task_description, with: "Trololo"
|
|
@@ -11,8 +11,8 @@ When(/^I create a task on this person$/) do
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
Then(/^the person task is created$/) do
|
|
14
|
-
expect(
|
|
15
|
-
@task =
|
|
14
|
+
expect(Dorsale::Flyboy::Task.count).to eq(@tasks_count + 1)
|
|
15
|
+
@task = Dorsale::Flyboy::Task.last_created
|
|
16
16
|
person = @corporation || @individual || @person
|
|
17
17
|
expect(current_path).to eq dorsale.tasks_customer_vault_person_path(person)
|
|
18
18
|
end
|
data/lib/dorsale/engine.rb
CHANGED
|
@@ -23,7 +23,7 @@ require "axlsx"
|
|
|
23
23
|
|
|
24
24
|
require "agilibox"
|
|
25
25
|
|
|
26
|
-
if Rails.env.
|
|
26
|
+
if Rails.env.local?
|
|
27
27
|
require "pry"
|
|
28
28
|
require "factory_bot_rails"
|
|
29
29
|
require "factory_bot"
|
|
@@ -42,7 +42,7 @@ module Dorsale
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
initializer "factory_bot" do
|
|
45
|
-
if Rails.env.
|
|
45
|
+
if Rails.env.local?
|
|
46
46
|
FactoryBot.definition_file_paths.unshift Dorsale::Engine.root.join("spec/factories/").to_s
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -54,13 +54,13 @@ module Dorsale
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
config.after_initialize do
|
|
57
|
-
Dorsale::PolicyChecker.check! if Rails.env.
|
|
57
|
+
Dorsale::PolicyChecker.check! if Rails.env.local?
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
initializer "assets" do
|
|
61
|
-
Rails.application.config.assets.precompile += %w
|
|
61
|
+
Rails.application.config.assets.precompile += %w[
|
|
62
62
|
dorsale/avatar.png
|
|
63
|
-
|
|
63
|
+
]
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
initializer "simple_form" do
|
data/lib/dorsale/version.rb
CHANGED
|
@@ -133,7 +133,7 @@ describe Dorsale::Alexandrie::AttachmentsController, type: :controller do
|
|
|
133
133
|
it "should delete attachment" do
|
|
134
134
|
expect {
|
|
135
135
|
delete :destroy, params: {id: attachment}
|
|
136
|
-
}.to change(
|
|
136
|
+
}.to change(Dorsale::Alexandrie::Attachment, :count).by(-1)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
it "should render list" do
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "rails_helper"
|
|
2
2
|
|
|
3
|
-
RSpec.describe
|
|
3
|
+
RSpec.describe Dorsale::ExpenseGun::ExpensesController, type: :controller do
|
|
4
4
|
routes { Dorsale::Engine.routes }
|
|
5
5
|
let(:user) { create(:user) }
|
|
6
6
|
before(:each) { sign_in(user) }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :billing_machine_invoice_line, class:
|
|
2
|
+
factory :billing_machine_invoice_line, class: Dorsale::BillingMachine::InvoiceLine do
|
|
3
3
|
invoice { create(:billing_machine_invoice) }
|
|
4
4
|
label { "Invoice line" + Faker::Lorem.words.join(" ") }
|
|
5
5
|
quantity { 10 }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :billing_machine_invoice, class:
|
|
2
|
+
factory :billing_machine_invoice, class: Dorsale::BillingMachine::Invoice do
|
|
3
3
|
customer { create(:customer_vault_corporation) }
|
|
4
4
|
payment_term { create(:billing_machine_payment_term) }
|
|
5
5
|
date { "2014-02-19" }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :billing_machine_quotation_line, class:
|
|
2
|
+
factory :billing_machine_quotation_line, class: Dorsale::BillingMachine::QuotationLine do
|
|
3
3
|
quotation { create(:billing_machine_quotation) }
|
|
4
4
|
label { "Quotation line" + Faker::Lorem.words.join(" ") }
|
|
5
5
|
quantity { 10 }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :billing_machine_quotation, class:
|
|
2
|
+
factory :billing_machine_quotation, class: Dorsale::BillingMachine::Quotation do
|
|
3
3
|
customer { create(:customer_vault_corporation) }
|
|
4
4
|
payment_term { create(:billing_machine_payment_term) }
|
|
5
5
|
date { "2014-02-19" }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :customer_vault_corporation, class:
|
|
2
|
+
factory :customer_vault_corporation, class: Dorsale::CustomerVault::Corporation do
|
|
3
3
|
activity_type { create(:customer_vault_activity_type) }
|
|
4
4
|
origin { create(:customer_vault_origin) }
|
|
5
5
|
name { "#{Faker::Company.name} #{Faker::Company.suffix}" }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :customer_vault_individual, class:
|
|
2
|
+
factory :customer_vault_individual, class: Dorsale::CustomerVault::Individual do
|
|
3
3
|
origin { create(:customer_vault_origin) }
|
|
4
4
|
first_name { Faker::Name.first_name }
|
|
5
5
|
last_name { Faker::Name.last_name }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :customer_vault_link, class:
|
|
2
|
+
factory :customer_vault_link, class: Dorsale::CustomerVault::Link do
|
|
3
3
|
association :alice, factory: :customer_vault_individual
|
|
4
4
|
association :bob, factory: :customer_vault_corporation
|
|
5
5
|
title { "Manager" }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :expense_gun_category, class:
|
|
2
|
+
factory :expense_gun_category, class: Dorsale::ExpenseGun::Category do
|
|
3
3
|
name { Faker::Lorem.word }
|
|
4
4
|
code { Faker::Number.number(digits: 4) }
|
|
5
5
|
vat_deductible { [true, false].sample }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :expense_gun_expense_line, class:
|
|
2
|
+
factory :expense_gun_expense_line, class: Dorsale::ExpenseGun::ExpenseLine do
|
|
3
3
|
expense { build(:expense_gun_expense) }
|
|
4
4
|
name { Faker::Lorem.sentence(word_count: 3) }
|
|
5
5
|
category { build(:expense_gun_category) }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
FactoryBot.define do
|
|
2
|
-
factory :flyboy_task, class:
|
|
2
|
+
factory :flyboy_task, class: Dorsale::Flyboy::Task do
|
|
3
3
|
name { "I-am-a-task#{Kernel.rand(1_000..9_999)}" }
|
|
4
4
|
description { "I-am-the-task-description_#{Kernel.rand(1_000..9_999)}" }
|
|
5
5
|
progress { Kernel.rand(0..99) }
|