From 34ee3f25dd9e903e27bbbbcdf85ae2803a869c76 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 15 Jun 2017 12:11:55 +0200 Subject: TableBuilder spec: Decorate companies collection In order to enable access to `CompanyDecorator#action_links`, wrap the companies collection passed to the table builder in the test in the decorator. Specify the class that `CompanyDecorator` decorates explicitly. Since `Chouette::Company` is namespaced, Draper can't infer the model from the decorator class name. Refs #3479 --- spec/helpers/table_builder_helper_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec') diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb index c5cbd972d..89660dd56 100644 --- a/spec/helpers/table_builder_helper_spec.rb +++ b/spec/helpers/table_builder_helper_spec.rb @@ -200,6 +200,11 @@ describe TableBuilderHelper, type: :helper do referential_id: referential.id }) + companies = ModelDecorator.decorate( + companies, + with: CompanyDecorator + ) + expected = <<-HTML