title: How to send only 1 parameter with get method?
body: <p>I have a controller with this index method
  (app/controllers/api/v1/users_controller.rb)</p>
  
  <pre><code>...
    before_action :find_user, only: [:show, :destroy]
  
    def index
      @users = User.order('created_at DESC')
    end
  ...
  </code></pre>
  
  <p>And I have a view 
  (app/view/api/v1/users/index.json.jbuilder)</p>
  
  <pre><code>json.array! @users do |user|
    json.id user.id
    json.name user.name
    json.posts user.posts do |post|
      json.id post.id
      json.title post.title
      json.body post.body
    end
  end
  </code></pre>
  
  <p>And when I run the server it works fine, after accessing <code>localhost:3000/api/v1/users</code> it is showing the expected output.
  But when I launch these RSpec tests 
  (spec/controllers/api/v1/users_controller_spec.rb)</p>
  
  <pre><code>require 'rails_helper'
  
  RSpec.describe Api::V1::UsersController, type: :controller do
    describe "GET #index" do
      before do
        get :index
      end
      it "returns http success" do
        expect(response).to have_http_status(:success)
      end
    end
  end
  </code></pre>
  
  <p>I get an error <a href="https://i.stack.imgur.com/e1Gid.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e1Gid.png" alt="enter image description here"></a>
  If I remove <code>:index</code> from <code>get :index</code> it gives the same error but (given 0, expected 1).
  How come <code>get :index</code> sending 2 parameters if there is only one and how can I rewrite this code so the test will pass? </p>
  
  <p>If I rewrite index method like this</p>
  
  <pre><code>  def index
      @users = User.order('created_at DESC')
      render json: @users, status: 200 
    end
  </code></pre>
  
  <p>The test will pass, but in this case I will not get the JSON file that I need (which I made with jbuilder)</p>