From a06fd3a9acd0de60c97ac36c42cfb77ab24edcab Mon Sep 17 00:00:00 2001 From: drew uhlmann Date: Thu, 21 Sep 2017 16:57:00 -0400 Subject: [PATCH] Add tests for description inclusion in automate hash --- spec/models/dialog_field_check_box_spec.rb | 11 ++++++++--- spec/models/dialog_field_date_control_spec.rb | 7 ++++++- spec/models/dialog_field_sorted_item_spec.rb | 5 +++++ spec/models/dialog_field_text_area_box_spec.rb | 5 +++++ spec/models/dialog_field_text_box_spec.rb | 5 +++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/spec/models/dialog_field_check_box_spec.rb b/spec/models/dialog_field_check_box_spec.rb index 020c1b9328a..7d7f028cceb 100644 --- a/spec/models/dialog_field_check_box_spec.rb +++ b/spec/models/dialog_field_check_box_spec.rb @@ -76,9 +76,10 @@ let(:dialog_field) { described_class.new } let(:automate_hash) do { - "value" => value, - "required" => true, - "read_only" => true + "value" => value, + "required" => true, + "read_only" => true, + "description" => "description" } end @@ -94,6 +95,10 @@ it "sets the read_only" do expect(dialog_field.read_only).to be_truthy end + + it "sets the description" do + expect(dialog_field.description).to eq("description") + end end context "when the automate hash has a value" do diff --git a/spec/models/dialog_field_date_control_spec.rb b/spec/models/dialog_field_date_control_spec.rb index 2c28d59eeb7..f4bf119797b 100644 --- a/spec/models/dialog_field_date_control_spec.rb +++ b/spec/models/dialog_field_date_control_spec.rb @@ -59,7 +59,8 @@ { "value" => value, "show_past_dates" => true, - "read_only" => true + "read_only" => true, + "description" => "description" } end @@ -79,6 +80,10 @@ it "sets the read_only" do expect(dialog_field.read_only).to be_truthy end + + it "sets the description" do + expect(dialog_field.description).to eq("description") + end end context "when the automate hash has a value" do diff --git a/spec/models/dialog_field_sorted_item_spec.rb b/spec/models/dialog_field_sorted_item_spec.rb index 54f9e7338b1..1c3d892e17e 100644 --- a/spec/models/dialog_field_sorted_item_spec.rb +++ b/spec/models/dialog_field_sorted_item_spec.rb @@ -302,6 +302,7 @@ "sort_order" => "descending", "data_type" => "datatype", "default_value" => "default", + "description" => "description", "required" => true, "read_only" => true, "values" => values @@ -321,6 +322,10 @@ expect(dialog_field.sort_order).to eq(:descending) end + it "sets the description" do + expect(dialog_field.description).to eq("description") + end + it "sets the data_type" do expect(dialog_field.data_type).to eq("datatype") end diff --git a/spec/models/dialog_field_text_area_box_spec.rb b/spec/models/dialog_field_text_area_box_spec.rb index dc999a0be1f..73fd01c8c62 100644 --- a/spec/models/dialog_field_text_area_box_spec.rb +++ b/spec/models/dialog_field_text_area_box_spec.rb @@ -7,6 +7,7 @@ "data_type" => "datatype", "value" => value, "protected" => true, + "description" => "description", "required" => true, "read_only" => true, "validator_rule" => "rule", @@ -35,6 +36,10 @@ expect(dialog_field.required).to be_truthy end + it "sets the description" do + expect(dialog_field.description).to eq("description") + end + it "sets the read_only" do expect(dialog_field.read_only).to be_truthy end diff --git a/spec/models/dialog_field_text_box_spec.rb b/spec/models/dialog_field_text_box_spec.rb index d6c6dbe5ab2..d25d403219a 100644 --- a/spec/models/dialog_field_text_box_spec.rb +++ b/spec/models/dialog_field_text_box_spec.rb @@ -283,6 +283,7 @@ "data_type" => "datatype", "value" => value, "protected" => true, + "description" => "description", "required" => true, "read_only" => true, "validator_type" => "regex", @@ -303,6 +304,10 @@ expect(dialog_field.required).to be_truthy end + it "sets the description" do + expect(dialog_field.description).to eq("description") + end + it "sets the read_only" do expect(dialog_field.read_only).to be_truthy end