dorsale 3.14.4 → 3.14.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/features/access.feature +17 -0
  4. data/features/billing_machine_invoices.feature +261 -0
  5. data/features/billing_machine_multiple_vat.feature +53 -0
  6. data/features/billing_machine_payment_terms.feature +19 -0
  7. data/features/billing_machine_quotations.feature +193 -0
  8. data/features/customer_vault_activity_types.feature +19 -0
  9. data/features/customer_vault_corporations.feature +95 -0
  10. data/features/customer_vault_filters.feature +14 -0
  11. data/features/customer_vault_individuals.feature +35 -0
  12. data/features/customer_vault_invoices.feature +10 -0
  13. data/features/customer_vault_links.feature +54 -0
  14. data/features/customer_vault_origins.feature +19 -0
  15. data/features/customer_vault_people.feature +25 -0
  16. data/features/customer_vault_search.feature +22 -0
  17. data/features/customer_vault_tasks.feature +35 -0
  18. data/features/expense_gun_categories.feature +19 -0
  19. data/features/expense_gun_expenses.feature +60 -0
  20. data/features/flyboy_task_comments.feature +21 -0
  21. data/features/flyboy_tasks.feature +122 -0
  22. data/features/flyboy_tasks_summary.feature +22 -0
  23. data/features/step_definitions/access_steps.rb +15 -0
  24. data/features/step_definitions/alexandrie_steps.rb +25 -0
  25. data/features/step_definitions/billing_machine_invoices_steps.rb +377 -0
  26. data/features/step_definitions/billing_machine_multiple_vat.rb +19 -0
  27. data/features/step_definitions/billing_machine_payment_terms_steps.rb +42 -0
  28. data/features/step_definitions/billing_machine_quotations_steps.rb +248 -0
  29. data/features/step_definitions/common_steps.rb +91 -0
  30. data/features/step_definitions/customer_vault_activity_types_steps.rb +42 -0
  31. data/features/step_definitions/customer_vault_corporations_steps.rb +218 -0
  32. data/features/step_definitions/customer_vault_filters_steps.rb +37 -0
  33. data/features/step_definitions/customer_vault_individuals_steps.rb +67 -0
  34. data/features/step_definitions/customer_vault_invoices_steps.rb +7 -0
  35. data/features/step_definitions/customer_vault_links_steps.rb +73 -0
  36. data/features/step_definitions/customer_vault_origins_steps.rb +42 -0
  37. data/features/step_definitions/customer_vault_people_steps.rb +26 -0
  38. data/features/step_definitions/customer_vault_search_steps.rb +48 -0
  39. data/features/step_definitions/customer_vault_tasks_steps.rb +34 -0
  40. data/features/step_definitions/expense_gun_categories_steps.rb +50 -0
  41. data/features/step_definitions/expense_gun_expenses_steps.rb +135 -0
  42. data/features/step_definitions/flyboy_task_comments_steps.rb +10 -0
  43. data/features/step_definitions/flyboy_tasks_steps.rb +196 -0
  44. data/features/step_definitions/tasks_summary_steps.rb +30 -0
  45. data/features/step_definitions/users_management_step.rb +29 -0
  46. data/features/support/env.rb +8 -0
  47. data/features/users_management.feature +18 -0
  48. data/lib/dorsale/version.rb +1 -1
  49. data/spec/controllers/dorsale/alexandrie/attachments_controller_spec.rb +145 -0
  50. data/spec/controllers/dorsale/billing_machine/invoices_controller_spec.rb +153 -0
  51. data/spec/controllers/dorsale/billing_machine/quotations_controller_spec.rb +24 -0
  52. data/spec/controllers/dorsale/comments_controller_spec.rb +50 -0
  53. data/spec/controllers/dorsale/customer_vault/events_controller_spec.rb +42 -0
  54. data/spec/controllers/dorsale/customer_vault/people_controller_spec.rb +129 -0
  55. data/spec/controllers/dorsale/expense_gun/expenses_controller_spec.rb +55 -0
  56. data/spec/controllers/dorsale/flyboy/task_comments_controller_spec.rb +40 -0
  57. data/spec/controllers/dorsale/flyboy/tasks_controller_spec.rb +349 -0
  58. data/spec/factories/alexandrie_attachment_types.rb +5 -0
  59. data/spec/factories/alexandrie_attachments.rb +16 -0
  60. data/spec/factories/billing_machine_invoice_lines.rb +9 -0
  61. data/spec/factories/billing_machine_invoices.rb +9 -0
  62. data/spec/factories/billing_machine_payment_terms.rb +5 -0
  63. data/spec/factories/billing_machine_quotation_lines.rb +9 -0
  64. data/spec/factories/billing_machine_quotations.rb +9 -0
  65. data/spec/factories/customer_vault_activity_types.rb +5 -0
  66. data/spec/factories/customer_vault_corporations.rb +13 -0
  67. data/spec/factories/customer_vault_event.rb +13 -0
  68. data/spec/factories/customer_vault_individuals.rb +17 -0
  69. data/spec/factories/customer_vault_links.rb +7 -0
  70. data/spec/factories/customer_vault_origins.rb +5 -0
  71. data/spec/factories/dorsale_addresses.rb +9 -0
  72. data/spec/factories/dorsale_comments.rb +7 -0
  73. data/spec/factories/expense_gun_categories.rb +7 -0
  74. data/spec/factories/expense_gun_expense_lines.rb +11 -0
  75. data/spec/factories/expense_gun_expenses.rb +13 -0
  76. data/spec/factories/flyboy_task_comments.rb +9 -0
  77. data/spec/factories/flyboy_tasks.rb +8 -0
  78. data/spec/files/avatar.png +0 -0
  79. data/spec/files/pdf.pdf +0 -0
  80. data/spec/mailers/user_mailer_spec.rb +21 -0
  81. data/spec/models/dorsale/address_spec.rb +46 -0
  82. data/spec/models/dorsale/alexandrie/attachment_spec.rb +36 -0
  83. data/spec/models/dorsale/alexandrie/attachment_type_spec.rb +11 -0
  84. data/spec/models/dorsale/billing_machine/invoice_line_spec.rb +52 -0
  85. data/spec/models/dorsale/billing_machine/invoice_spec.rb +258 -0
  86. data/spec/models/dorsale/billing_machine/quotation_line_spec.rb +51 -0
  87. data/spec/models/dorsale/billing_machine/quotation_spec.rb +213 -0
  88. data/spec/models/dorsale/billing_machine_spec.rb +57 -0
  89. data/spec/models/dorsale/comment_spec.rb +24 -0
  90. data/spec/models/dorsale/customer_vault/activity_type_spec.rb +10 -0
  91. data/spec/models/dorsale/customer_vault/corporation_spec.rb +33 -0
  92. data/spec/models/dorsale/customer_vault/event_spec.rb +22 -0
  93. data/spec/models/dorsale/customer_vault/individual_spec.rb +44 -0
  94. data/spec/models/dorsale/customer_vault/link_spec.rb +14 -0
  95. data/spec/models/dorsale/customer_vault/origin_spec.rb +8 -0
  96. data/spec/models/dorsale/customer_vault/person_spec.rb +112 -0
  97. data/spec/models/dorsale/email_spec.rb +39 -0
  98. data/spec/models/dorsale/expense_gun/category_spec.rb +9 -0
  99. data/spec/models/dorsale/expense_gun/expense_line_spec.rb +53 -0
  100. data/spec/models/dorsale/expense_gun/expense_spec.rb +176 -0
  101. data/spec/models/dorsale/flyboy/task_comment_spec.rb +54 -0
  102. data/spec/models/dorsale/flyboy/task_spec.rb +254 -0
  103. data/spec/models/dorsale/i18n_spec.rb +30 -0
  104. data/spec/models/dorsale/users_spec.rb +65 -0
  105. data/spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb +42 -0
  106. data/spec/pdfs/dorsale/billing_machine/invoice_single_vat_pdf_spec.rb +42 -0
  107. data/spec/pdfs/dorsale/billing_machine/quotation_multiple_vat_pdf_spec.rb +42 -0
  108. data/spec/pdfs/dorsale/billing_machine/quotation_single_vat_pdf_spec.rb +55 -0
  109. data/spec/pdfs/dorsale/expense_gun/expense_pdf_spec.rb +11 -0
  110. data/spec/rails_helper.rb +57 -0
  111. data/spec/routing/dorsale/alexandrie/attachments_routing_spec.rb +32 -0
  112. data/spec/routing/dorsale/billing_machine/invoices_routing_spec.rb +67 -0
  113. data/spec/routing/dorsale/billing_machine/quotations_routing_spec.rb +67 -0
  114. data/spec/routing/dorsale/comments_routing_spec.rb +23 -0
  115. data/spec/routing/dorsale/customer_vault/activity_types_routing_spec.rb +40 -0
  116. data/spec/routing/dorsale/customer_vault/events_routing_spec.rb +12 -0
  117. data/spec/routing/dorsale/customer_vault/origins_routing_spec.rb +40 -0
  118. data/spec/routing/dorsale/customer_vault/people_routing_spec.rb +109 -0
  119. data/spec/routing/dorsale/expense_gun/expenses_routing_spec.rb +62 -0
  120. data/spec/routing/dorsale/flyboy/task_comments_routing_spec.rb +11 -0
  121. data/spec/routing/dorsale/flyboy/tasks_routing_spec.rb +51 -0
  122. data/spec/routing/dorsale/users_routing_spec.rb +38 -0
  123. data/spec/services/dorsale/billing_machine/quotation/copy_spec.rb +55 -0
  124. data/spec/services/dorsale/billing_machine/quotation/statistics.rb +23 -0
  125. data/spec/services/dorsale/billing_machine/quotation/to_invoice_spec.rb +46 -0
  126. data/spec/services/dorsale/expense_gun/expense/copy_spec.rb +83 -0
  127. data/spec/services/dorsale/flyboy/task/copy_spec.rb +24 -0
  128. data/spec/services/dorsale/flyboy/task/snoozer_spec.rb +117 -0
  129. data/spec/spec_helper.rb +86 -0
  130. data/spec/support/devise.rb +3 -0
  131. data/spec/support/message_delivery.rb +5 -0
  132. metadata +258 -2
@@ -0,0 +1,55 @@
1
+ require "rails_helper"
2
+
3
+ describe ::Dorsale::BillingMachine::QuotationSingleVatPdf, pdfs: true do
4
+ before :each do
5
+ ::Dorsale::BillingMachine.vat_mode = :single
6
+ end
7
+
8
+ let(:quotation) {
9
+ q = create(:billing_machine_quotation)
10
+
11
+ create(:billing_machine_quotation_line,
12
+ :quotation => q,
13
+ :vat_rate => 19.6,
14
+ )
15
+
16
+ q
17
+ }
18
+
19
+ let(:generate!) {
20
+ Dorsale::BillingMachine::PdfFileGenerator.(quotation)
21
+ quotation.reload
22
+ }
23
+
24
+ let(:content) {
25
+ generate!
26
+ Yomu.new(quotation.pdf_file.path).text
27
+ }
28
+
29
+ it "should display global vat rate" do
30
+ expect(content).to include "TVA 19,60"
31
+ expect(content).to_not include "MONTANT TVA"
32
+ expect(content).to_not include "TVA %"
33
+ end
34
+
35
+ it "should work with empty quotation" do
36
+ quotation = ::Dorsale::BillingMachine::Quotation.new
37
+
38
+ expect {
39
+ described_class.new(quotation).tap(&:build).render_with_attachments
40
+ }.to_not raise_error
41
+ end
42
+
43
+ describe "attachments" do
44
+ let(:quotation) {
45
+ quotation = create(:billing_machine_quotation)
46
+ attachment = create(:alexandrie_attachment, attachable: quotation)
47
+ quotation
48
+ }
49
+
50
+ it "should build attachments" do
51
+ expect(content).to include "page 1"
52
+ expect(content).to include "page 2"
53
+ end
54
+ end # describe "attachments"
55
+ end
@@ -0,0 +1,11 @@
1
+ require "rails_helper"
2
+
3
+ describe Dorsale::ExpenseGun::ExpensePdf do
4
+ it "should work" do
5
+ expense = create(:expense_gun_expense_line).expense
6
+
7
+ expect {
8
+ described_class.new(expense).tap(&:build).render_with_attachments
9
+ }.to_not raise_error
10
+ end
11
+ end
@@ -0,0 +1,57 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] = 'test'
3
+ require 'spec_helper'
4
+ require File.expand_path("../dummy/config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+ require "agilibox/rspec"
7
+ require "yomu"
8
+ # Add additional requires below this line. Rails is not loaded until this point!
9
+ # Requires supporting ruby files with custom matchers and macros, etc,
10
+ # in spec/support/ and its subdirectories.
11
+ Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |f| require f }
12
+
13
+ # Requires supporting ruby files with custom matchers and macros, etc, in
14
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
15
+ # run as spec files by default. This means that files in spec/support that end
16
+ # in _spec.rb will both be required and run as specs, causing the specs to be
17
+ # run twice. It is recommended that you do not name files matching this glob to
18
+ # end with _spec.rb. You can configure this pattern with the --pattern
19
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
20
+ #
21
+ # The following line is provided for convenience purposes. It has the downside
22
+ # of increasing the boot-up time by auto-requiring all files in the support
23
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
24
+ # require only the support files necessary.
25
+ #
26
+ # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
27
+
28
+ # Checks for pending migrations before tests are run.
29
+ # If you are not using ActiveRecord, you can remove this line.
30
+ ActiveRecord::Migration.maintain_test_schema!
31
+
32
+ RSpec.configure do |config|
33
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
34
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
35
+
36
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
37
+ # examples within a transaction, remove the following line or assign false
38
+ # instead of true.
39
+ config.use_transactional_fixtures = true
40
+
41
+ # RSpec Rails can automatically mix in different behaviours to your tests
42
+ # based on their file location, for example enabling you to call `get` and
43
+ # `post` in specs under `spec/controllers`.
44
+ #
45
+ # You can disable this behaviour by removing the line below, and instead
46
+ # explicitly tag your specs with their type, e.g.:
47
+ #
48
+ # RSpec.describe UsersController, :type => :controller do
49
+ # # ...
50
+ # end
51
+ #
52
+ # The different available types are documented in the features, such as in
53
+ # https://relishapp.com/rspec/rspec-rails/docs
54
+ config.infer_spec_type_from_file_location!
55
+
56
+ Prawn::Font::AFM.hide_m17n_warning = true
57
+ end
@@ -0,0 +1,32 @@
1
+ require "rails_helper"
2
+
3
+ RSpec.describe Dorsale::Alexandrie::AttachmentsController, type: :routing do
4
+ routes { Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#create" do
8
+ expect(get "/alexandrie/attachments").to \
9
+ route_to("dorsale/alexandrie/attachments#index")
10
+ end
11
+
12
+ it "#create" do
13
+ expect(post "/alexandrie/attachments").to \
14
+ route_to("dorsale/alexandrie/attachments#create")
15
+ end
16
+
17
+ it "#edit" do
18
+ expect(get "/alexandrie/attachments/3/edit").to \
19
+ route_to("dorsale/alexandrie/attachments#edit", id: "3")
20
+ end
21
+
22
+ it "#update" do
23
+ expect(patch "/alexandrie/attachments/3").to \
24
+ route_to("dorsale/alexandrie/attachments#update", id: "3")
25
+ end
26
+
27
+ it "#destroy" do
28
+ expect(delete "/alexandrie/attachments/3").to \
29
+ route_to("dorsale/alexandrie/attachments#destroy", id: "3")
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,67 @@
1
+ require "rails_helper"
2
+
3
+ describe ::Dorsale::BillingMachine::InvoicesController, type: :routing do
4
+ routes { ::Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#index" do
8
+ expect(get "/billing_machine/invoices").to \
9
+ route_to("dorsale/billing_machine/invoices#index")
10
+ end
11
+
12
+ it "#new" do
13
+ expect(get "/billing_machine/invoices/new").to \
14
+ route_to("dorsale/billing_machine/invoices#new")
15
+ end
16
+
17
+ it "#create" do
18
+ expect(post "/billing_machine/invoices").to \
19
+ route_to("dorsale/billing_machine/invoices#create")
20
+ end
21
+
22
+ it "#show" do
23
+ expect(get "/billing_machine/invoices/1").to \
24
+ route_to("dorsale/billing_machine/invoices#show", id: "1")
25
+ end
26
+
27
+ it "#show pdf" do
28
+ expect(get "/billing_machine/invoices/1.pdf").to \
29
+ route_to("dorsale/billing_machine/invoices#show", id: "1", format: "pdf")
30
+ end
31
+
32
+ it "#pay" do
33
+ expect(patch "/billing_machine/invoices/1/pay").to \
34
+ route_to("dorsale/billing_machine/invoices#pay", id: "1")
35
+ end
36
+
37
+ it "#copy" do
38
+ expect(get "/billing_machine/invoices/1/copy").to \
39
+ route_to("dorsale/billing_machine/invoices#copy", id: "1")
40
+ end
41
+
42
+ it "#edit" do
43
+ expect(get "/billing_machine/invoices/1/edit").to \
44
+ route_to("dorsale/billing_machine/invoices#edit", id: "1")
45
+ end
46
+
47
+ it "#update" do
48
+ expect(patch "/billing_machine/invoices/1").to \
49
+ route_to("dorsale/billing_machine/invoices#update", id: "1")
50
+ end
51
+
52
+ it "#preview" do
53
+ expect(post "/billing_machine/invoices/preview").to \
54
+ route_to("dorsale/billing_machine/invoices#preview")
55
+ end
56
+
57
+ it "#email via GET" do
58
+ expect(get "/billing_machine/invoices/1/email").to \
59
+ route_to("dorsale/billing_machine/invoices#email", id: "1")
60
+ end
61
+
62
+ it "#email via PORT" do
63
+ expect(post "/billing_machine/invoices/1/email").to \
64
+ route_to("dorsale/billing_machine/invoices#email", id: "1")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ require "rails_helper"
2
+
3
+ describe ::Dorsale::BillingMachine::QuotationsController do
4
+ describe "routing" do
5
+ routes { ::Dorsale::Engine.routes }
6
+
7
+ it "#index" do
8
+ expect(get "/billing_machine/quotations").to \
9
+ route_to("dorsale/billing_machine/quotations#index")
10
+ end
11
+
12
+ it "#new" do
13
+ expect(get "/billing_machine/quotations/new").to \
14
+ route_to("dorsale/billing_machine/quotations#new")
15
+ end
16
+
17
+ it "#show" do
18
+ expect(get "/billing_machine/quotations/1").to \
19
+ route_to("dorsale/billing_machine/quotations#show", id: "1")
20
+ end
21
+
22
+ it "#edit" do
23
+ expect(get "/billing_machine/quotations/1/edit").to \
24
+ route_to("dorsale/billing_machine/quotations#edit", id: "1")
25
+ end
26
+
27
+ it "#create" do
28
+ expect(post "/billing_machine/quotations").to \
29
+ route_to("dorsale/billing_machine/quotations#create")
30
+ end
31
+
32
+ it "#update" do
33
+ expect(patch "/billing_machine/quotations/1").to \
34
+ route_to("dorsale/billing_machine/quotations#update", id: "1")
35
+ end
36
+
37
+ it "#destroy" do
38
+ expect(delete "/billing_machine/quotations/1").to \
39
+ route_to("dorsale/billing_machine/quotations#destroy", id: "1")
40
+ end
41
+
42
+ it "#preview" do
43
+ expect(post "/billing_machine/quotations/preview").to \
44
+ route_to("dorsale/billing_machine/quotations#preview")
45
+ end
46
+
47
+ it "#copy" do
48
+ expect(post "/billing_machine/quotations/1/copy").to \
49
+ route_to("dorsale/billing_machine/quotations#copy", id: "1")
50
+ end
51
+
52
+ it "#create_invoice" do
53
+ expect(get "/billing_machine/quotations/1/create_invoice").to \
54
+ route_to("dorsale/billing_machine/quotations#create_invoice", id: "1")
55
+ end
56
+
57
+ it "#email via GET" do
58
+ expect(get "/billing_machine/quotations/1/email").to \
59
+ route_to("dorsale/billing_machine/quotations#email", id: "1")
60
+ end
61
+
62
+ it "#email via PORT" do
63
+ expect(post "/billing_machine/quotations/1/email").to \
64
+ route_to("dorsale/billing_machine/quotations#email", id: "1")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,23 @@
1
+ require "rails_helper"
2
+
3
+ RSpec.describe Dorsale::CommentsController, type: :routing do
4
+ routes { Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "routes to #create" do
8
+ expect(post: "/comments").to route_to("dorsale/comments#create")
9
+ end
10
+
11
+ it "routes to #edit" do
12
+ expect(get: "/comments/3/edit").to route_to("dorsale/comments#edit", id: "3")
13
+ end
14
+
15
+ it "routes to #update" do
16
+ expect(patch: "/comments/3").to route_to("dorsale/comments#update", id: "3")
17
+ end
18
+
19
+ it "routes to #destroy" do
20
+ expect(delete: "/comments/3").to route_to("dorsale/comments#destroy", id: "3")
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,40 @@
1
+ require "rails_helper"
2
+
3
+ describe ::Dorsale::CustomerVault::ActivityTypesController do
4
+ routes { ::Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#index" do
8
+ expect(get "/customer_vault/activity_types").to \
9
+ route_to("dorsale/customer_vault/activity_types#index")
10
+ end
11
+
12
+ it "#new" do
13
+ expect(get "/customer_vault/activity_types/new").to \
14
+ route_to("dorsale/customer_vault/activity_types#new")
15
+ end
16
+
17
+ it "#create" do
18
+ expect(post "/customer_vault/activity_types").to \
19
+ route_to("dorsale/customer_vault/activity_types#create")
20
+ end
21
+
22
+ it "#show" do
23
+ expect(get "/customer_vault/activity_types/3").to_not be_routable
24
+ end
25
+
26
+ it "#edit" do
27
+ expect(get "/customer_vault/activity_types/3/edit").to \
28
+ route_to("dorsale/customer_vault/activity_types#edit", id: "3")
29
+ end
30
+
31
+ it "#update" do
32
+ expect(patch "/customer_vault/activity_types/3").to \
33
+ route_to("dorsale/customer_vault/activity_types#update", id: "3")
34
+ end
35
+
36
+ it "#destroy" do
37
+ expect(delete "/customer_vault/activity_types/3").to_not be_routable
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,12 @@
1
+ require "rails_helper"
2
+
3
+ RSpec.describe ::Dorsale::CustomerVault::EventsController, type: :routing do
4
+ routes { ::Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#index" do
8
+ expect(get "/customer_vault/events").to \
9
+ route_to("dorsale/customer_vault/events#index")
10
+ end
11
+ end # describe "routing"
12
+ end
@@ -0,0 +1,40 @@
1
+ require "rails_helper"
2
+
3
+ describe ::Dorsale::CustomerVault::OriginsController do
4
+ routes { ::Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#index" do
8
+ expect(get "/customer_vault/origins").to \
9
+ route_to("dorsale/customer_vault/origins#index")
10
+ end
11
+
12
+ it "#new" do
13
+ expect(get "/customer_vault/origins/new").to \
14
+ route_to("dorsale/customer_vault/origins#new")
15
+ end
16
+
17
+ it "#create" do
18
+ expect(post "/customer_vault/origins").to \
19
+ route_to("dorsale/customer_vault/origins#create")
20
+ end
21
+
22
+ it "#show" do
23
+ expect(get "/customer_vault/origins/3").to_not be_routable
24
+ end
25
+
26
+ it "#edit" do
27
+ expect(get "/customer_vault/origins/3/edit").to \
28
+ route_to("dorsale/customer_vault/origins#edit", id: "3")
29
+ end
30
+
31
+ it "#update" do
32
+ expect(patch "/customer_vault/origins/3").to \
33
+ route_to("dorsale/customer_vault/origins#update", id: "3")
34
+ end
35
+
36
+ it "#destroy" do
37
+ expect(delete "/customer_vault/origins/3").to_not be_routable
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,109 @@
1
+ require "rails_helper"
2
+
3
+ RSpec.describe ::Dorsale::CustomerVault::PeopleController, type: :routing do
4
+ routes { ::Dorsale::Engine.routes }
5
+
6
+ describe "routing" do
7
+ it "#index" do
8
+ expect(get "/customer_vault/people").to \
9
+ route_to("dorsale/customer_vault/people#index")
10
+ end
11
+
12
+ it "#corporations via get" do
13
+ expect(get "/customer_vault/corporations").to \
14
+ route_to("dorsale/customer_vault/people#corporations")
15
+ end
16
+
17
+ it "#individuals via get" do
18
+ expect(get "/customer_vault/individuals").to \
19
+ route_to("dorsale/customer_vault/people#individuals")
20
+ end
21
+
22
+ it "#new person" do
23
+ expect(get "/customer_vault/people/new").to \
24
+ route_to("dorsale/customer_vault/people#new")
25
+ end
26
+
27
+ it "#new corporation" do
28
+ expect(get "/customer_vault/corporations/new").to \
29
+ route_to("dorsale/customer_vault/people#new")
30
+ end
31
+
32
+ it "#new individual" do
33
+ expect(get "/customer_vault/individuals/new").to \
34
+ route_to("dorsale/customer_vault/people#new")
35
+ end
36
+
37
+ it "#create person" do
38
+ expect(post "/customer_vault/people").to \
39
+ route_to("dorsale/customer_vault/people#create")
40
+ end
41
+
42
+ it "#create individual" do
43
+ expect(post "/customer_vault/individuals").to \
44
+ route_to("dorsale/customer_vault/people#create")
45
+ end
46
+
47
+ it "#create corporation" do
48
+ expect(post "/customer_vault/corporations").to \
49
+ route_to("dorsale/customer_vault/people#create")
50
+ end
51
+
52
+ it "#show" do
53
+ expect(get "/customer_vault/people/1").to \
54
+ route_to("dorsale/customer_vault/people#show", id: "1")
55
+ end
56
+
57
+ it "#tasks" do
58
+ expect(get "/customer_vault/people/1/tasks").to \
59
+ route_to("dorsale/customer_vault/people#tasks", id: "1")
60
+ end
61
+
62
+ it "#invoices" do
63
+ expect(get "/customer_vault/people/1/invoices").to \
64
+ route_to("dorsale/customer_vault/people#invoices", id: "1")
65
+ end
66
+
67
+ it "#links" do
68
+ expect(get "/customer_vault/people/1/links").to \
69
+ route_to("dorsale/customer_vault/links#index", person_id: "1")
70
+ end
71
+
72
+ it "#edit" do
73
+ expect(get "/customer_vault/people/1/edit").to \
74
+ route_to("dorsale/customer_vault/people#edit", id: "1")
75
+ end
76
+
77
+ it "#update" do
78
+ expect(patch "/customer_vault/people/1").to \
79
+ route_to("dorsale/customer_vault/people#update", id: "1")
80
+ end
81
+
82
+ it "#destroy" do
83
+ expect(delete "/customer_vault/people/1").to \
84
+ route_to("dorsale/customer_vault/people#destroy", id: "1")
85
+ end
86
+ end # describe "routing"
87
+
88
+ describe "route helpers" do
89
+ it "#new_customer_vault_corporation_path" do
90
+ expect(new_customer_vault_corporation_path).to \
91
+ eq "/dorsale/customer_vault/corporations/new"
92
+ end
93
+
94
+ it "#new_customer_vault_individual_path" do
95
+ expect(new_customer_vault_individual_path).to \
96
+ eq "/dorsale/customer_vault/individuals/new"
97
+ end
98
+
99
+ it "#customer_vault_corporation_path" do
100
+ expect(customer_vault_corporations_path).to \
101
+ eq "/dorsale/customer_vault/corporations"
102
+ end
103
+
104
+ it "#customer_vault_individual_path" do
105
+ expect(customer_vault_individuals_path).to \
106
+ eq "/dorsale/customer_vault/individuals"
107
+ end
108
+ end # describe "route helpers"
109
+ end