Skip to content

Commit

Permalink
Merge pull request ManageIQ#12288 from jrafanie/fix_sporadic_dialog_g…
Browse files Browse the repository at this point in the history
…roup_failure

Check the dialog_fields labels without regard to order
  • Loading branch information
bdunne authored Oct 30, 2016
2 parents 5aa5c4a + c1378b8 commit e6d4d33
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions spec/models/dialog_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,10 @@
{ 'name' => 'new field', 'label' => 'new field label' }
]
end

it 'updates a the dialog fields with an id' do
it 'creates or updates the dialog fields' do
dialog_group.update_dialog_fields(updated_fields)

dialog_group.reload
expect(dialog_group.dialog_fields.first.label).to eq('updated_field_label')
expect(dialog_group.dialog_fields.last.label).to eq('updated_field_label')
end

it 'creates a new dialog field from the dialog fields without an id' do
expect do
dialog_group.update_dialog_fields(updated_fields)
end.to change(dialog_group.reload.dialog_fields, :count).by(1)
expect(dialog_group.dialog_fields.collect(&:label)).to match_array(['updated_field_label', 'updated_field_label', 'new field label'])
end
end

Expand Down

0 comments on commit e6d4d33

Please sign in to comment.