require "rails_helper"

RSpec.describe Obra::PreConveniosController, type: :routing do
	describe "routing" do

		it "roteia para #index" do
			expect(:get => "/obra/pre_convenios").to route_to("obra/pre_convenios#index")
		end

		it "roteia para #new" do
			expect(:get => "/obra/pre_convenios/new").to route_to("obra/pre_convenios#new")
		end

		it "roteia para #show" do
			expect(:get => "/obra/pre_convenios/1").to route_to("obra/pre_convenios#show", :id => "1")
		end

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

		it "roteia para #create" do
			expect(:post => "/obra/pre_convenios").to route_to("obra/pre_convenios#create")
		end

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

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

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

		it "roteia para #gerar_convenio via PATCH" do
			expect(:patch => "/obra/pre_convenios/1/gerar_convenio").to route_to("obra/pre_convenios#gerar_convenio", :id => "1")
		end

		it "roteia para #editar_fontes via PATCH" do
			expect(:get => "/obra/pre_convenios/1/editar_fontes").to route_to("obra/pre_convenios#editar_fontes", :id => "1")
		end

		it "roteia para #adiciona_fontes via PATCH" do
			expect(:patch => "/obra/pre_convenios/1/adiciona_fontes").to route_to("obra/pre_convenios#adiciona_fontes", :id => "1")
		end

	end
end
