Hi,
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:

def get_quarantine_trails(event_id)
quarantine_event_result = quarantine_events.find_by(id: event_id)
quarantine_event_result.inventory_items.select([:item_number, :id])
end

def quarantine_events_list
quarantine_events.joins(:quarantine_trails).
select('quarantine_events.*,count(quarantine_trails.quarantine_event_id) as 
count_of_events').
group('quarantine_events.id')
end


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.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/f6fe1bad-9992-46b1-be79-5eb7849abe82n%40googlegroups.com.

Reply via email to