spec/models/source_spec.rb in fetcher-mongoid-models-0.0.0 vs spec/models/source_spec.rb in fetcher-mongoid-models-0.0.1

- old
+ new

@@ -1,36 +1,17 @@ require 'spec_helper' describe 'Fetcher::Mongoid::Models::Db' do context 'When I create a source' do + before do Fetcher::Mongoid::Models::Db.new "./config/main.yml" @source = Source.new end - - it 'should return false when insert without a Column' do - expect { - @source.save - }.to raise_error NameError, "uninitialized constant Source::Column_id" - end - - it 'should return false when insert with a Column that is not in the db' do - column = Column.new - @source.Column = column - expect { - @source.save - }.to raise_error NameError, "uninitialized constant Source::Column_id" - end - - it 'should return true when insert with a valid Column' do - column = Column.new - column.save - s = Source.new :Column => column - Source::Column_id = column._id - s.save.should == true - column.remove - s.remove + + it 'should return true when inserted on the db' do + @source.save.should == true end after do @source.remove end \ No newline at end of file