aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/table_builder_helper/column_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/helpers/table_builder_helper/column_spec.rb b/spec/helpers/table_builder_helper/column_spec.rb
index 0c5c89e8a..e0bfd8a6a 100644
--- a/spec/helpers/table_builder_helper/column_spec.rb
+++ b/spec/helpers/table_builder_helper/column_spec.rb
@@ -21,6 +21,29 @@ describe TableBuilderHelper::Column do
end
end
+ describe "#linkable?" do
+ it "returns true if :link_to is not nil" do
+ expect(
+ TableBuilderHelper::Column.new(
+ name: 'unused',
+ attribute: nil,
+ link_to: lambda do
+ train.kind
+ end
+ ).linkable?
+ ).to be true
+ end
+
+ it "returns false if :link_to is nil" do
+ expect(
+ TableBuilderHelper::Column.new(
+ name: 'unused',
+ attribute: nil
+ ).linkable?
+ ).to be false
+ end
+ end
+
describe "#link_to" do
it "calls the block passed in and returns the result" do
train = double('train', kind: 'TGV')