Skip to content

Commit

Permalink
Add tests for description inclusion in automate hash
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Sep 21, 2017
1 parent 5761f57 commit a06fd3a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
11 changes: 8 additions & 3 deletions spec/models/dialog_field_check_box_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion spec/models/dialog_field_date_control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
{
"value" => value,
"show_past_dates" => true,
"read_only" => true
"read_only" => true,
"description" => "description"
}
end

Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/models/dialog_field_sorted_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
"sort_order" => "descending",
"data_type" => "datatype",
"default_value" => "default",
"description" => "description",
"required" => true,
"read_only" => true,
"values" => values
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/models/dialog_field_text_area_box_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"data_type" => "datatype",
"value" => value,
"protected" => true,
"description" => "description",
"required" => true,
"read_only" => true,
"validator_rule" => "rule",
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/models/dialog_field_text_box_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
"data_type" => "datatype",
"value" => value,
"protected" => true,
"description" => "description",
"required" => true,
"read_only" => true,
"validator_type" => "regex",
Expand All @@ -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
Expand Down

0 comments on commit a06fd3a

Please sign in to comment.