aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-09-01 18:03:16 +0200
committerTeddy Wing2017-09-01 18:03:16 +0200
commitaf050e3cbd7b6d931dbf7faf9ed1e3a9cf3cf6f7 (patch)
tree498ec603ed1508aebd517859db9db44651b41a92
parentdf64a6dcbc38cefe41c74bcb1d2d166d13711b23 (diff)
downloadchouette-core-af050e3cbd7b6d931dbf7faf9ed1e3a9cf3cf6f7.tar.bz2
TableBuilderHelper spec: Update with `Column#link_to` calls
The `TableBuilderHelper` now requires you to specify a `link_to` attribute in a column you want to make a link out of instead of doing it automagically as before. Update the tests to do this and continue to output the right `<a>`s for links.
-rw-r--r--spec/helpers/table_builder_helper_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb
index c536a4c62..e17196a19 100644
--- a/spec/helpers/table_builder_helper_spec.rb
+++ b/spec/helpers/table_builder_helper_spec.rb
@@ -96,7 +96,10 @@ describe TableBuilderHelper, type: :helper do
[
TableBuilderHelper::Column.new(
key: :name,
- attribute: 'name'
+ attribute: 'name',
+ link_to: lambda do |referential|
+ referential_path(referential)
+ end
),
TableBuilderHelper::Column.new(
key: :status,
@@ -238,7 +241,10 @@ describe TableBuilderHelper, type: :helper do
),
TableBuilderHelper::Column.new(
key: :name,
- attribute: 'name'
+ attribute: 'name',
+ link_to: lambda do |company|
+ referential_company_path(referential, company)
+ end
),
TableBuilderHelper::Column.new(
key: :phone,
@@ -347,7 +353,10 @@ describe TableBuilderHelper, type: :helper do
),
TableBuilderHelper::Column.new(
key: :name,
- attribute: 'name'
+ attribute: 'name',
+ link_to: lambda do |company|
+ referential_company_path(referential, company)
+ end
),
TableBuilderHelper::Column.new(
key: :phone,