Sha256: 9b3fdb03bc04a951b5d63d7a5aaa66b996c0ebcd2caa101eb37211124c6e2fe5

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper'


describe 'Fetcher::Mongoid::Models::Db' do 
  context 'When I create a column' do
    
    before do
      Fetcher::Mongoid::Models::Db.new "./config/main.yml"
      @column = Column.new
    end

    it 'should return true when insert it empty' do
      @column.save.should == true
    end

    it 'should return true when insert with a Filter that is in the Db and i can get the filter back' do
      @column.save
      f = Filter.new :Column => @column
      Filter::Column_id = @column._id
      f.save

      @column.Filter.push f
      @column.save.should == true

      aux_filter = Column.find(@column._id).Filter
      aux_filter.first.should == f
      f.remove
    end

    after do
      @column.remove
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fetcher-mongoid-models-0.0.0 spec/models/column_spec.rb