require "rails_helper"

RSpec.describe CommissionsController, type: :routing do
  describe "routing" do

    it "routes to #index" do
      expect(:get => "/commissions").to route_to("commissions#index")
    end

    it "routes to #new" do
      expect(:get => "/commissions/new").to route_to("commissions#new")
    end

    it "routes to #show" do
      expect(:get => "/commissions/1").to route_to("commissions#show", :id => "1")
    end

    it "routes to #edit" do
      expect(:get => "/commissions/1/edit").to route_to("commissions#edit", :id => "1")
    end

    it "routes to #create" do
      expect(:post => "/commissions").to route_to("commissions#create")
    end

    it "routes to #update via PUT" do
      expect(:put => "/commissions/1").to route_to("commissions#update", :id => "1")
    end

    it "routes to #update via PATCH" do
      expect(:patch => "/commissions/1").to route_to("commissions#update", :id => "1")
    end

    it "routes to #destroy" do
      expect(:delete => "/commissions/1").to route_to("commissions#destroy", :id => "1")
    end

  end
end
