title: Rails Test "ActionController::UnknownFormat: is missing a template for this request format and variant"
body: <p>I'm creating a testing suite for a Twitter clone app called "Canary" and I'm having a hard time writing integration tests for chirps#reply and chirps#rechirps</p>
  
  <p>Chirps Controller</p>
  
  <pre><code>def reply
      @chirp = current_user.chirps.new
      @parent = Chirp.find_by(id: params[:parent_id])
      @chirp.parent_id = params[:parent_id]
      respond_to do |format|
          format.js
          format.html
      end
  end
  
  def rechirp
      @chirp = current_user.chirps.new
      @reference = Chirp.find_by(id: params[:reference_id])
      @chirp.reference_id = params[:reference_id]
      respond_to do |format|
          format.js
          format.html
      end 
  end
  </code></pre>
  
  <p>Chirp View</p>
  
  <pre><code>&lt;%= link_to reply_chirp_path(current_user, parent_id: chirp.id), remote: true, data: { target: '#modal_container', toggle: 'modal' } do %&gt;
      &lt;%= icon('far', 'comment') %&gt; &lt;%= chirp.children.size if chirp.children.size &gt; 0 %&gt;
  &lt;% end %&gt;
  
  &lt;%= link_to rechirp_chirp_path(current_user, reference_id: chirp.id), remote: true, data: { target: '#modal_container', toggle: 'modal' } do %&gt;
      &lt;%= icon('fas', 'retweet') %&gt; &lt;%= count_rechirps(chirp) %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Reply.js.erb</p>
  
  <pre><code>$("#modal_container").find(".modal-content").html("&lt;%= j render 'chirps/modal_reply' %&gt;");
  $("#modal_container").modal('show', 'focus');
  </code></pre>
  
  <p>Rechirp.js.erb</p>
  
  <pre><code>$("#modal_container").find(".modal-content").html("&lt;%= j render 'chirps/modal_rechirp' %&gt;");
  $("#modal_container").modal('show', 'focus');
  </code></pre>
  
  <p>Chirps Interface Test</p>
  
  <pre><code># Try to reply to chirp
  assert_select 'a[href=?]', reply_chirp_path(@user, parent_id: @chirp.id)
  assert_difference 'Chirp.count', 1 do
      get reply_chirp_path(@user, parent_id: @chirp)
      assert_select 'div#modal_container &gt; div.modal-dialog &gt; div.modal-content &gt; div.modal-body'
      post chirps_path, params: { chirp: { content: content, parent_id: @chirp.id } }
      assert :success
  end
  assert_redirected_to root_url
  follow_redirect!
  # Try to rechirp chirp
  assert_select 'a[href=?]', rechirp_chirp_path(@user, reference_id: @chirp.id)
  </code></pre>
  
  <p>When I run chirp_interface_test.rb I keep encountering the same error: </p>
  
  <blockquote>
    <p>Error:
    ChirpsInterfaceTest#test_chirp_interface:</p>
    
    <p>ActionController::UnknownFormat: ChirpsController#reply is missing a template for this request format and variant.</p>
    
    <p>request.formats: ["text/html"]</p>
    
    <p>request.variant: []</p>
  
  <pre><code>test/integration/chirps_interface_test.rb:30:in `block (2 levels) in &lt;class:ChirpsInterfaceTest&gt;'
  
  test/integration/chirps_interface_test.rb:29:in `block in &lt;class:ChirpsInterfaceTest&gt;'
  </code></pre>
  </blockquote>
  
  <p>I know that the routes work in app because I've successfully submitted by replies and rechirps multiple times through the localhost. How can I test that these actions work properly with rails testing?</p>