Skip to content

Commit

Permalink
Fixed routing spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kataria committed Jan 2, 2021
1 parent 1e55563 commit 02874cf
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions spec/routing/miq_policy_set_routing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,35 @@
describe 'routes for MiqPolicySetController' do
let(:controller_name) { 'miq_policy_set' }

describe '#button' do
it 'routes with POST' do
expect(post("/#{controller_name}/button")).to route_to("#{controller_name}#button")
end
end
get_routes = %w[
edit
new
show
show_list
]

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

describe '#form_field_changed' do
it 'routes with POST' do
expect(post("/#{controller_name}/form_field_changed")).to route_to("#{controller_name}#form_field_changed")
end
end
post_routes = %w[
button
edit
form_field_changed
reload
show
show_list
]

describe '#reload' do
it 'routes with POST' do
expect(post("/#{controller_name}/reload")).to route_to("#{controller_name}#reload")
describe 'GET routes' do
get_routes.each do |route|
it "##{route}" do
expect(get("/#{controller_name}/#{route}")).to route_to("#{controller_name}##{route}")
end
end
end

describe '#show' do
it 'routes with POST' do
expect(post("/#{controller_name}/show")).to route_to("#{controller_name}#show")
describe 'POST routes' do
post_routes.each do |route|
it "##{route}" do
expect(post("/#{controller_name}/#{route}")).to route_to("#{controller_name}##{route}")
end
end
end
end

0 comments on commit 02874cf

Please sign in to comment.