I have simple action show
def show
@field = Field.find_by(params[:id])
end
and i want write spec for it
require 'spec_helper'
RSpec.describe FieldsController, type: :controller do
let(:field) { create(:field) }
it 'should show field' do
get :show, id: field
expect(response.status).to eq(200)
end
end
but I have got an error
Failure/Error: get :show, id: field
ArgumentError:
unknown keyword: id
How to fix it?