Sha256: 98e30b14c0403828a69ec49c077cdd07754e6ad26d70fd2841ef4a09fdffbd15
Contents?: true
Size: 888 Bytes
Versions: 19
Compression:
Stored size: 888 Bytes
Contents
require File.join(File.dirname(__FILE__), 'test_helper') describe "activerecord table" do it "with no select gets default options" do pet = stub(:name=>'rufus', :age=>7, :attributes=>{"name"=>'rufus', 'age'=>7}, :class=>stub(:column_names=>%w{age name})) Helpers::AutoTable.active_record__base_view(pet).should == {:fields=>[:age, :name]} end it "with select gets default options" do pet = stub(:name=>'rufus', :age=>7, :attributes=>{'name'=>'rufus'}, :class=>stub(:column_names=>%w{age name})) Helpers::AutoTable.active_record__base_view(pet).should == {:fields=>[:name]} end end describe "mongoid table" do it "only has one _id" do fields = {'_id' => 'x0f0x', 'name' => 'blah'} mongoid_stub = stub(:class => stub(:fields => fields)) Helpers::AutoTable.mongoid__document_view(mongoid_stub).should == {:fields => fields.keys.sort} end end
Version data entries
19 entries across 18 versions & 3 rubygems