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

Version Path
hirber-0.8.5 test/views_test.rb
hirber-0.8.4 test/views_test.rb
hirber-0.8.2 test/views_test.rb
hirber-0.8.1 test/views_test.rb
hirber-0.8.0 test/views_test.rb
hirb-0.7.3 test/views_test.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
hirb-0.7.2 test/views_test.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/hirb-0.7.1/test/views_test.rb
hirb-0.7.1 test/views_test.rb
hirb-0.7.0 test/views_test.rb
hirb-0.6.2 test/views_test.rb
hirb-0.6.1 test/views_test.rb