diff options
Diffstat (limited to 'spec/helpers')
| -rw-r--r-- | spec/helpers/table_builder_helper/column_spec.rb | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/spec/helpers/table_builder_helper/column_spec.rb b/spec/helpers/table_builder_helper/column_spec.rb index 0f27703b2..0c5c89e8a 100644 --- a/spec/helpers/table_builder_helper/column_spec.rb +++ b/spec/helpers/table_builder_helper/column_spec.rb @@ -20,4 +20,20 @@ describe TableBuilderHelper::Column do        ).to eq('Numéro de téléphone')      end    end + +  describe "#link_to" do +    it "calls the block passed in and returns the result" do +      train = double('train', kind: 'TGV') + +      expect( +        TableBuilderHelper::Column.new( +          name: 'unused', +          attribute: nil, +          link_to: lambda do |train| +            train.kind +          end +        ).link_to(train) +      ).to eq('TGV') +    end +  end  end | 
