Skip to content

Commit

Permalink
Removed redundant routes
Browse files Browse the repository at this point in the history
- Removed `db_list` that was accidentally added in this PR
- Fixed routing spec tests.
- Reverted changes made in toolbar_chooser, see ManageIQ#7039 (comment) for more info
  • Loading branch information
h-kataria authored and kbrock committed Jul 13, 2020
1 parent a9d4ced commit 165840a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
15 changes: 3 additions & 12 deletions app/helpers/application_helper/toolbar_chooser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ def x_view_toolbar_filename
end
end

NO_SUMMARY_VIEW_TB = [
'all_tasks',
'chargeback_rate',
'diagnostics',
'miq_server',
'my_tasks',
'timeline',
'usage'
]

def view_toolbar_filename
if render_gtl_view_tb?
'gtl_view_tb'
Expand All @@ -45,8 +35,9 @@ def view_toolbar_filename
'dashboard_summary_toggle_view_tb'
elsif %w[container_project].include?(@layout)
'container_project_view_tb'
elsif !NO_SUMMARY_VIEW_TB.include?(@layout) && !@layout.starts_with?("miq_request") &&
@display == "main" && @showtype == "main" && !@in_a_form
elsif !%w[all_tasks timeline diagnostics my_tasks miq_server usage].include?(@layout) &&
!@layout.starts_with?("miq_request") && @display == "main" &&
@showtype == "main" && !@in_a_form
'summary_view_tb'
end
end
Expand Down
3 changes: 0 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,7 @@
:post => %w(
button
cb_rate_form_field_changed
cb_rate_show
cb_rates_delete
cb_rates_list
cb_tier_add
cb_tier_remove
edit
Expand Down Expand Up @@ -2546,7 +2544,6 @@
db_backup
db_backup_form_field_changed
db_gc_collection
db_list
diagnostics_server_list
diagnostics_tree_select
edit_rhn
Expand Down
16 changes: 2 additions & 14 deletions spec/routing/chargeback_rate_routing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,13 @@
end
end

describe '#cb_rate_show' do
it 'routes with POST' do
expect(post("/#{controller_name}/cb_rate_show")).to route_to("#{controller_name}#cb_rate_show")
end
end

describe '#cb_rates_delete' do
it 'routes with POST' do
expect(post("/#{controller_name}/cb_rates_delete")).to route_to("#{controller_name}#cb_rates_delete")
end
end

describe '#cb_rates_list' do
it 'routes with POST' do
expect(post("/#{controller_name}/cb_rates_list")).to route_to("#{controller_name}#cb_rates_list")
end
end

describe '#explorer' do
describe '#show_list' do
it 'routes with GET' do
expect(get("/#{controller_name}/show_list")).to route_to("#{controller_name}#show_list")
end
Expand All @@ -49,7 +37,7 @@
end
end

describe '#x_show' do
describe '#show' do
it 'routes with POST' do
expect(post("/#{controller_name}/show")).to route_to("#{controller_name}#show")
end
Expand Down

0 comments on commit 165840a

Please sign in to comment.