From c3d752af1ed040f64cd7cbfb964c2c5d5d8f7cde Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 8 Jun 2017 11:36:03 +0200 Subject: Add in-progress `TableBuilderHelper` (WIP) Porting `table_builder` code over from `NewapplicationHelper`. The code is very much in progress and incomplete. Only decided to commit it now because I keep making changes and want to have those tracked so I don't lose anything. A lot of the original is commented out and the initial test I wrote doesn't pass. The test also doesn't use the proper data, I just copied it from the website's output. Anyway, this is sort of the starting point. Refs #3479 --- spec/helpers/table_builder_helper_spec.rb | 120 ++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 spec/helpers/table_builder_helper_spec.rb (limited to 'spec') diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb new file mode 100644 index 000000000..e9d1afed3 --- /dev/null +++ b/spec/helpers/table_builder_helper_spec.rb @@ -0,0 +1,120 @@ +require 'spec_helper' + +describe TableBuilderHelper, type: :helper do + describe "#table_builder_2" do + it "builds a table" do + workbenches = [ + build_stubbed(:referential) + ] + + expected = <<-HTML +
| + + | +Nom | +Etat | +Organisation | +Période de validité englobante | +Lignes | +Créé le | +Edité le | +Intégré le | ++ |
|---|---|---|---|---|---|---|---|---|---|
| + + | +Referential Yanis Gaillard | +
+ En préparation
+ |
+ STIF | +01/05/2017 > 31/08/2017 | +1 | +02/05/2017 | +02/05/2017 | ++ |
+
+
+
+
+ |
+
| + + | +Test Referential 2017.04.25 | +
+ En préparation
+ |
+ STIF | +25/04/2017 > 25/05/2022 | +6 | +25/04/2017 | +25/04/2017 | ++ |
+
+
+
+
+ |
+