I'm testing a model that receives a optional parameter and Rspec is giving me an error:
no implicit conversion of Symbol into Integer
My route:
get "classification/teams(/:team_id)" => "classifications#teams"
My model:
class Classification
def self.teams(params = [])
team_id = params[:team_id] unless params[:team_id].nil?
...
My test:
it 'returns the classification' do
expect(Classification.teams).to be_true
end
My API is working well, but I need to implement some tests and I'm getting this error. If I change params[:team_id] for params['team_id'] the error occurs but with: no implicit conversion of String into Integer.
My model:- is it active record model? How do you use teams method in your controller?class Classification < ActiveRecord::Base