I am a beginner in ruby and rails and struggling to write rspec code for my model methods as given below:
Please help me write rspec implementation and test examples for my methods for me to have a basic understanding of how can I proceed in this:
quarantine_event_result = quarantine_events.find_by(id: event_id)
select(‘quarantine_events.*,count(quarantine_trails.quarantine_event_id) as count_of_events’).
Here: quarantine_events and quarantine_trails are 2 models where they have direct association in between them. quarantine_events table being my parent table and quarantine_trails being my child table.
inventory_items is another model having association with quarantine_trail table.
Help me create a rspec implementation for this 2 methods for my initial understanding.