Sha256: a2eb928b4a9e879a780b112e213f1bf5104feb52986d15807d1bcd4c13fbd9c4
Contents?: true
Size: 796 Bytes
Versions: 7
Compression:
Stored size: 796 Bytes
Contents
require 'spec_helper' describe "many to many associations" do it "it is time to count some comments" do React::IsomorphicHelpers.load_context ReactiveRecord.load do TodoItem.find_by_title("a todo for mitch").comments.count end.then do |count| expect(count).to be(1) end end it "is time to see who made the comment" do ReactiveRecord.load do TodoItem.find_by_title("a todo for mitch").comments.first.user.email end.then do |email| expect(email).to eq("adamg@catprint.com") end end it "is time to get it directly through the relationship" do ReactiveRecord.load do TodoItem.find_by_title("a todo for mitch").commenters.first.email end.then do |email| expect(email).to eq("adamg@catprint.com") end end end
Version data entries
7 entries across 7 versions & 1 rubygems