Skip to content

Commit

Permalink
Add spec test for changes in center_toolbar_filename_classic method
Browse files Browse the repository at this point in the history
Add spec test for changes related to Ansible Playbooks/Repositories/Credentials pages.
  • Loading branch information
Hilda Stastna committed Apr 6, 2018
1 parent ee00164 commit 0412356
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/helpers/application_helper/toolbar_chooser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,36 @@
end
end
end

describe '#center_toolbar_filename_classic' do
subject { chooser.send(:center_toolbar_filename_classic) }

{ "manageiq/providers/embedded_ansible/automation_manager/playbook" => "playbook",
"manageiq/providers/embedded_automation_manager/configuration_script_source" => "repository",
"manageiq/providers/embedded_automation_manager/authentication" => "credential"}.each do |layout, screen|
context "toolbar for summary screen of Ansible #{screen}" do
let(:chooser) { ApplicationHelper::ToolbarChooser.new(nil, nil, :display => "main", :lastaction => "show", :layout => layout) }

it 'returns proper toolbar filename for the screen' do
expect(subject).to eq("ansible_#{screen}_center")
end
end

context "toolbars for list screens of Ansible #{screen.pluralize}" do
let(:chooser) { ApplicationHelper::ToolbarChooser.new(nil, nil, :lastaction => "show_list", :layout => layout) }

it 'returns proper toolbar filename for the screen' do
expect(subject).to eq("ansible_#{screen.pluralize}_center")
end
end

context "toolbars for nested list screens of Ansible #{screen.pluralize}" do
let(:chooser) { ApplicationHelper::ToolbarChooser.new(nil, nil, :display => screen.pluralize, :lastaction => "show", :layout => layout) }

it 'returns proper toolbar filename for the screen' do
expect(subject).to eq("ansible_#{screen.pluralize}_center")
end
end
end
end
end

0 comments on commit 0412356

Please sign in to comment.