require "rails_helper"

RSpec.describe Transactions::SalesController, type: :routing do
  describe "routing" do

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

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

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

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

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

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

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

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

  end
end
