spec/syncers_spec.rb in rubyrep-1.0.9 vs spec/syncers_spec.rb in rubyrep-1.1.0

- old
+ new

@@ -99,19 +99,19 @@ it "sync_difference should delete in the right database" do sync = TableSync.new(Session.new, 'scanner_records') helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :left, :delete => true}) syncer = Syncers::OneWaySyncer.new(helper) - helper.should_receive(:delete_record).with(:left, :dummy_record) + helper.should_receive(:delete_record).with(:left, 'scanner_records', :dummy_record) helper.should_not_receive(:update_record) helper.should_not_receive(:insert_record) syncer.sync_difference(:left, :dummy_record) helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :right, :delete => true}) syncer = Syncers::OneWaySyncer.new(helper) - helper.should_receive(:delete_record).with(:right, :dummy_record) + helper.should_receive(:delete_record).with(:right, 'scanner_records', :dummy_record) syncer.sync_difference(:right, :dummy_record) end it "sync_difference should not insert if :insert option is not true" do sync = TableSync.new(Session.new, 'scanner_records') @@ -129,17 +129,17 @@ helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :left, :insert => true}) syncer = Syncers::OneWaySyncer.new(helper) helper.should_not_receive(:delete_record) helper.should_not_receive(:update_record) - helper.should_receive(:insert_record).with(:left, :dummy_record) + helper.should_receive(:insert_record).with(:left, 'scanner_records', :dummy_record) syncer.sync_difference(:right, :dummy_record) helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :right, :insert => true}) syncer = Syncers::OneWaySyncer.new(helper) - helper.should_receive(:insert_record).with(:right, :dummy_record) + helper.should_receive(:insert_record).with(:right, 'scanner_records', :dummy_record) syncer.sync_difference(:left, :dummy_record) end it "sync_difference should not update if :update option is not true" do sync = TableSync.new(Session.new, 'scanner_records') @@ -156,16 +156,16 @@ sync = TableSync.new(Session.new, 'scanner_records') helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :left, :update => true}) syncer = Syncers::OneWaySyncer.new(helper) helper.should_not_receive(:delete_record) - helper.should_receive(:update_record).with(:left, :right_record) + helper.should_receive(:update_record).with(:left, 'scanner_records', :right_record) helper.should_not_receive(:insert_record) syncer.sync_difference(:conflict, [:left_record, :right_record]) helper = SyncHelper.new(sync) helper.stub!(:sync_options).and_return({:direction => :right, :update => true}) syncer = Syncers::OneWaySyncer.new(helper) - helper.should_receive(:update_record).with(:right, :left_record) + helper.should_receive(:update_record).with(:right, 'scanner_records', :left_record) syncer.sync_difference(:conflict, [:left_record, :right_record]) end end \ No newline at end of file