require 'routing/shared_examples'

describe 'routes for VmInfra' do
  let(:controller_name) { 'vm_infra' }

  it_behaves_like 'A controller that has advanced search routes'
  it_behaves_like 'A controller that has compare routes'
  it_behaves_like 'A controller that has dialog runner routes'
  it_behaves_like 'A controller that has download_data routes'
  it_behaves_like 'A controller that has explorer routes'
  it_behaves_like 'A controller that has performance routes'
  it_behaves_like 'A controller that has policy protect routes'
  it_behaves_like 'A controller that has tagging routes'
  it_behaves_like 'A controller that has timeline routes'
  it_behaves_like 'A controller that has vm_common routes'

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

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

  describe '#launch_html5_console' do
    it 'routes with GET' do
      expect(get("/#{controller_name}/launch_html5_console")).to route_to("#{controller_name}#launch_html5_console")
    end
  end

  describe '#launch_vmrc_console' do
    it 'routes with GET' do
      expect(get("/#{controller_name}/launch_vmrc_console")).to route_to("#{controller_name}#launch_vmrc_console")
    end
  end

  describe '#policies' do
    it 'routes with GET' do
      expect(get("/#{controller_name}/policies")).to route_to("#{controller_name}#policies")
    end
  end

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

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

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

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

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

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

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

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

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

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

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

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

  describe '#filesystem_download' do
    it 'routes with GET' do
      expect(get("/#{controller_name}/filesystem_download")).to route_to("#{controller_name}#filesystem_download")
    end
  end
end
