Sha256: 6a6a5f0fb86943a735673285b45255e37cedb49aa2000f4c9105855a6abe12e2
Contents?: true
Size: 527 Bytes
Versions: 4
Compression:
Stored size: 527 Bytes
Contents
require 'spec_helper' describe SortableHelper do describe "#sortable_fetch" do class ARDummy alias_method :id, :object_id end context "with no block" do it { expect { helper.sortable_fetch(Array.new) }.to raise_error } end context "with block" do it "should yield item and its object id" do obj = ARDummy.new sortable_fetch([ obj ]) do |item, id| expect(item).to eq obj expect(id).to eq "ARDummy_#{obj.id}" end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems