<commit_before>require "rails_helper"

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

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

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

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

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

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

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

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

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

  end
end<commit_msg>Add tests for nested routes<commit_after>require "rails_helper"

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

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

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

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

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

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

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

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

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

    context "nested in meetings" do 
      it "routes to #index" do 
        expect(:get => "/meetings/1/talks").to route_to("talks#index", :meeting_id => "1")
      end

      it "routes to #new" do 
        expect(:get => "/meetings/1/talks/new").to route_to("talks#new", :meeting_id => "1")
      end

      it "routes to #create" do 
        expect(:post => "/meetings/1/talks").to route_to("talks#create", :meeting_id => "1")
      end
    end

    context "nested in speakers" do 
      it "routes to #index" do 
        expect(:get => "/speakers/1/talks").to route_to("talks#index", :speaker_id => "1")
      end

      it "routes to #new" do 
        expect(:get => "/speakers/1/talks/new").to route_to("talks#new", :speaker_id => "1")
      end

      it "routes to #create" do 
        expect(:post => "/speakers/1/talks").to route_to("talks#create", :speaker_id => "1")
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.17434537620152468, 'fraction_numerical': 0.010606562810739144, 'mean_word_length': 2.5422535211267605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4021736', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1061, 'n_words': 282}