require "rails_helper"

RSpec.describe Loa::GestoresController, type: :routing do
	describe "routing" do

		it "roteia para #new" do
			expect(:get => "/loa/2018/unidades_gestoras/1/gestores/new").to route_to("loa/gestores#new", exercicio: '2018', unidade_gestora_id: '1')
		end

		it "roteia para #edit" do
			expect(:get => "/loa/gestores/1/edit").to route_to("loa/gestores#edit", :id => "1")
		end

		it "roteia para #create" do
			expect(:post => "/loa/2018/unidades_gestoras/1/gestores").to route_to("loa/gestores#create", exercicio: '2018', unidade_gestora_id: '1')
		end

		it "roteia para #update via PUT" do
			expect(:put => "/loa/gestores/1").to route_to("loa/gestores#update", :id => "1")
		end

		it "roteia para #update via PATCH" do
			expect(:patch => "/loa/gestores/1").to route_to("loa/gestores#update", :id => "1")
		end

		it "roteia para #destroy" do
			expect(:delete => "/loa/gestores/1").to route_to("loa/gestores#destroy", :id => "1")
		end

	end
end
