Sha256: d96ffc480265abacf371767095ba3fe13dbb672e13fc6884e2170b903f23f38a
Contents?: true
Size: 942 Bytes
Versions: 2
Compression:
Stored size: 942 Bytes
Contents
require 'spec_helper' require 'synchromesh/integration/test_components' describe "reactive-record edge cases", js: true do before(:each) do # spec_helper resets the policy system after each test so we have to setup # before each test stub_const 'TestApplication', Class.new stub_const 'TestApplicationPolicy', Class.new TestApplicationPolicy.class_eval do always_allow_connection regulate_all_broadcasts { |policy| policy.send_all } end size_window(:small, :portrait) end it "trims the association tree" do 5.times do |i| user = FactoryGirl.create(:user, first_name: i) unless i == 3 FactoryGirl.create(:todo, title: "User #{i}'s todo", owner: user) end expect_promise do ReactiveRecord.load do Todo.all.collect do |todo| todo.owner && todo.owner.first_name end.compact end end.to contain_exactly('0', '1', '2', '4') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hyper-mesh-0.5.1 | spec/reactive_record/edge_cases_spec.rb |
hyper-mesh-0.5.0 | spec/reactive_record/edge_cases_spec.rb |