Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1006 from lgalis/display_second_value_for_dropdow…
…n_in_dialog Show the display value for the dropdown in the automation dialog (cherry picked from commit 612d662) https://bugzilla.redhat.com/show_bug.cgi?id=1442232
- Loading branch information
Showing
4 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
spec/views/shared/dialogs/_dialog_field_drop_down_list.html.haml_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
describe "shared/dialogs/dialog_field_drop_down_list.html.haml" do | ||
context 'display field value' do | ||
before do | ||
@edit = false | ||
attributes = {:values => [[nil, "<Choose>"], %w(Value1 Desc1), %w(Value2 Desc2)]} | ||
value = 'Value2' | ||
@field = DialogFieldDropDownList.new(:id => 1, | ||
:name => 'Options List Field', | ||
:type => 'DialogFieldDropDownList', | ||
:attributes => attributes, :value => value) | ||
end | ||
|
||
it 'shows the display value for the dropdown field' do | ||
render :partial => "/shared/dialogs/dialog_field_drop_down_list.html.haml", :locals => {:edit => @edit, :field => @field} | ||
expect(rendered).to eq("Desc2\n") | ||
end | ||
end | ||
end |