Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added missing search related routes.
  • Loading branch information
h-kataria committed Nov 26, 2014
1 parent 29d16b9 commit c0afa53
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 92 deletions.
12 changes: 9 additions & 3 deletions vmdb/config/routes.rb
Expand Up @@ -346,6 +346,7 @@
create
dynamic_list_refresh
form_field_changed
listnav_search_selected
panel_control
protect
quick_search
Expand All @@ -362,7 +363,8 @@
adv_search_post +
compare_post +
discover_get_post +
exp_post
exp_post +
save_post
},

:ems_cluster => {
Expand Down Expand Up @@ -419,6 +421,7 @@
button
create
form_field_changed
listnav_search_selected
panel_control
protect
quick_search
Expand All @@ -437,7 +440,8 @@
adv_search_post +
compare_post +
discover_get_post +
exp_post
exp_post +
save_post
},

:flavor => {
Expand Down Expand Up @@ -1192,6 +1196,7 @@
compare_get,
:post => %w(
button
listnav_search_selected
panel_control
protect
save_col_widths
Expand All @@ -1204,7 +1209,8 @@
) +
adv_search_post +
compare_post +
exp_post
exp_post +
save_post
},

:security_group => {
Expand Down
60 changes: 26 additions & 34 deletions vmdb/spec/routing/ems_cloud_routing_spec.rb
Expand Up @@ -14,43 +14,35 @@
it_behaves_like "A controller that has tagging routes"
it_behaves_like "A controller that has timeline routes"

describe "#button" do
it "routes with POST" do
expect(post("/ems_cloud/button")).to route_to("ems_cloud#button")
%w(
edit
index
new
show
show_list
).each do |task|
describe "##{task}" do
it 'routes with GET' do
expect(get("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end

describe "#dynamic_list_refresh" do
it "routes with POST" do
expect(post("/ems_cloud/dynamic_list_refresh")).to route_to("ems_cloud#dynamic_list_refresh")
end
end

describe "#form_field_changed" do
it "routes with POST" do
expect(post("/ems_cloud/form_field_changed")).to route_to("ems_cloud#form_field_changed")
end
end

describe "#new" do
it "routes with GET" do
expect(get("/ems_cloud/new")).to route_to("ems_cloud#new")
end
end

describe "#sections_field_changed" do
it "routes with POST" do
expect(post("/ems_cloud/sections_field_changed")).to route_to("ems_cloud#sections_field_changed")
end
end

describe "#show_list" do
it "routes with GET" do
expect(get("/ems_cloud/show_list")).to route_to("ems_cloud#show_list")
end

it "routes with POST" do
expect(post("/ems_cloud/show_list")).to route_to("ems_cloud#show_list")
%w(
button
create
dynamic_list_refresh
form_field_changed
listnav_search_selected
save_default_search
show
show_list
update
).each do |task|
describe "##{task}" do
it 'routes with POST' do
expect(post("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end
end
67 changes: 27 additions & 40 deletions vmdb/spec/routing/ems_infra_routing_spec.rb
Expand Up @@ -14,49 +14,36 @@
it_behaves_like "A controller that has tagging routes"
it_behaves_like "A controller that has timeline routes"

describe "#button" do
it "routes with POST" do
expect(post("/ems_infra/button")).to route_to("ems_infra#button")
%w(
edit
index
new
show
show_list
).each do |task|
describe "##{task}" do
it 'routes with GET' do
expect(get("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end

describe "#form_field_changed" do
it "routes with POST" do
expect(post("/ems_infra/form_field_changed")).to route_to("ems_infra#form_field_changed")
end
end

describe "#new" do
it "routes with GET" do
expect(get("/ems_infra/new")).to route_to("ems_infra#new")
end
end

describe "#sections_field_changed" do
it "routes with POST" do
expect(post("/ems_infra/sections_field_changed")).to route_to("ems_infra#sections_field_changed")
end
end

describe "#show_list" do
it "routes with GET" do
expect(get("/ems_infra/show_list")).to route_to("ems_infra#show_list")
end

it "routes with POST" do
expect(post("/ems_infra/show_list")).to route_to("ems_infra#show_list")
end
end

describe "#tree_autoload_dynatree" do
it "routes with POST" do
expect(post("/ems_infra/tree_autoload_dynatree")).to route_to("ems_infra#tree_autoload_dynatree")
end
end

describe "#tree_autoload_quads" do
it "routes with POST" do
expect(post("/ems_infra/tree_autoload_quads")).to route_to("ems_infra#tree_autoload_quads")
%w(
button
create
form_field_changed
listnav_search_selected
save_default_search
show
show_list
tree_autoload_dynatree
tree_autoload_quads
update
).each do |task|
describe "##{task}" do
it 'routes with POST' do
expect(post("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end
end
33 changes: 18 additions & 15 deletions vmdb/spec/routing/resource_pool_routing_spec.rb
Expand Up @@ -12,24 +12,27 @@
it_behaves_like "A controller that has tagging routes"
it_behaves_like "A controller that has policy protect routes"

describe "#index" do
it "routes with GET" do
expect(get("/#{controller_name}")).to route_to("#{controller_name}#index")
%w(
index
show
).each do |task|
describe "##{task}" do
it 'routes with GET' do
expect(get("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end

describe "#show" do
it "routes with GET" do
expect(get("/#{controller_name}/show/123")).to route_to("#{controller_name}#show", :id => "123")
end
it "routes with POST" do
expect(post("/#{controller_name}/show/123")).to route_to("#{controller_name}#show", :id => "123")
end
end

describe "#button" do
it "routes with POST" do
expect(post("/#{controller_name}/button")).to route_to("#{controller_name}#button")
%w(
button
listnav_search_selected
save_default_search
show
).each do |task|
describe "##{task}" do
it 'routes with POST' do
expect(post("/#{controller_name}/#{task}")).to route_to("#{controller_name}##{task}")
end
end
end
end

0 comments on commit c0afa53

Please sign in to comment.