Sha256: a525aea79559c418aaba819de91c8c5ed73482c9fb8c488cd0e30ff3a11b41fe

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

# encoding: utf-8
require "spec_helper"

describe ActiveMerge do

  describe "::merge_all" do

    before(:all) { Lord.extend ActiveMerge }

    let!(:lords) { 3.times.map{ Lord.create! }}

    it "defined" do
      Lord.should respond_to :merge_all
    end

    it "allows options" do
      Lord.should respond_to(:merge_all).with(1).argument
    end

    it "merges records from given request" do
      Lord.where("id < 3").merge_all
      Lord.all.pluck(:id).should eq [1, 3]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_merge-1.2.1 spec/active_merge_spec.rb
active_merge-1.2.0 spec/active_merge_spec.rb
active_merge-1.1.0 spec/active_merge_spec.rb