aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/table_builder_helper/custom_links_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/table_builder_helper/custom_links_spec.rb b/spec/helpers/table_builder_helper/custom_links_spec.rb
index d6fbd2c64..ac60c7da3 100644
--- a/spec/helpers/table_builder_helper/custom_links_spec.rb
+++ b/spec/helpers/table_builder_helper/custom_links_spec.rb
@@ -1,4 +1,20 @@
describe TableBuilderHelper::CustomLinks do
+ describe "#polymorphic_url" do
+ it "returns the correct URL path for Companies#show" do
+ company = build_stubbed(:company)
+ user_context = UserContext.new(build_stubbed(:user))
+
+ expect(
+ TableBuilderHelper::CustomLinks.new(
+ company,
+ user_context,
+ [:show],
+ company.line_referential
+ ).polymorphic_url(:show)
+ ).to eq([company.line_referential, company])
+ end
+ end
+
describe "#authorized_actions" do
it "includes :show" do
referential = build_stubbed(:referential)