Upgrading to Mongoid 2.0 beta 11 and fixing specs
This commit is contained in:
parent
eb82548452
commit
c6240dd7eb
3
Gemfile
3
Gemfile
@ -7,8 +7,7 @@ gem 'rails', '3.0.0.beta4'
|
|||||||
gem 'liquid', '2.0.0'
|
gem 'liquid', '2.0.0'
|
||||||
gem 'bson_ext', '>= 1.0.1'
|
gem 'bson_ext', '>= 1.0.1'
|
||||||
gem 'mongo_ext'
|
gem 'mongo_ext'
|
||||||
gem 'mongoid-locomotive'
|
gem 'mongoid', "2.0.0.beta11"
|
||||||
# gem 'mongoid', "2.0.0.beta11"
|
|
||||||
gem 'mongoid_acts_as_tree', '0.1.5'
|
gem 'mongoid_acts_as_tree', '0.1.5'
|
||||||
gem 'mongo_session_store', '2.0.0.pre'
|
gem 'mongo_session_store', '2.0.0.pre'
|
||||||
gem 'warden'
|
gem 'warden'
|
||||||
|
10
Gemfile.lock
10
Gemfile.lock
@ -137,14 +137,6 @@ GEM
|
|||||||
mongo (~> 1.0.5)
|
mongo (~> 1.0.5)
|
||||||
tzinfo (~> 0.3.22)
|
tzinfo (~> 0.3.22)
|
||||||
will_paginate (~> 3.0.pre)
|
will_paginate (~> 3.0.pre)
|
||||||
mongoid-locomotive (2.0.0.beta9)
|
|
||||||
activemodel (~> 3.0.0.beta)
|
|
||||||
bson (~> 1.0.4)
|
|
||||||
bson_ext (~> 1.0.4)
|
|
||||||
bundler
|
|
||||||
mongo (~> 1.0.5)
|
|
||||||
tzinfo (~> 0.3.22)
|
|
||||||
will_paginate (~> 3.0.pre)
|
|
||||||
mongoid_acts_as_tree (0.1.5)
|
mongoid_acts_as_tree (0.1.5)
|
||||||
bson (>= 0.20.1)
|
bson (>= 0.20.1)
|
||||||
mongoid (<= 2.0.0)
|
mongoid (<= 2.0.0)
|
||||||
@ -249,7 +241,7 @@ DEPENDENCIES
|
|||||||
mocha!
|
mocha!
|
||||||
mongo_ext
|
mongo_ext
|
||||||
mongo_session_store (= 2.0.0.pre)
|
mongo_session_store (= 2.0.0.pre)
|
||||||
mongoid-locomotive
|
mongoid (= 2.0.0.beta11)
|
||||||
mongoid_acts_as_tree (= 0.1.5)
|
mongoid_acts_as_tree (= 0.1.5)
|
||||||
mongrel
|
mongrel
|
||||||
mongrel_experimental
|
mongrel_experimental
|
||||||
|
@ -116,7 +116,7 @@ describe AssetCollection do
|
|||||||
|
|
||||||
it 'should add new field' do
|
it 'should add new field' do
|
||||||
@collection.asset_custom_fields.build :label => 'Active at', :name => 'active_at', :kind => 'Date'
|
@collection.asset_custom_fields.build :label => 'Active at', :name => 'active_at', :kind => 'Date'
|
||||||
@collection.upsert(false)
|
@collection.upsert(:validate => false)
|
||||||
@collection.reload
|
@collection.reload
|
||||||
asset = @collection.assets.first
|
asset = @collection.assets.first
|
||||||
lambda { asset.active_at }.should_not raise_error
|
lambda { asset.active_at }.should_not raise_error
|
||||||
@ -124,7 +124,7 @@ describe AssetCollection do
|
|||||||
|
|
||||||
it 'should remove field' do
|
it 'should remove field' do
|
||||||
@collection.asset_custom_fields.clear
|
@collection.asset_custom_fields.clear
|
||||||
@collection.upsert(false)
|
@collection.upsert(:validate => false)
|
||||||
@collection.reload
|
@collection.reload
|
||||||
asset = @collection.assets.first
|
asset = @collection.assets.first
|
||||||
lambda { asset.active }.should raise_error
|
lambda { asset.active }.should raise_error
|
||||||
@ -133,7 +133,7 @@ describe AssetCollection do
|
|||||||
it 'should rename field label' do
|
it 'should rename field label' do
|
||||||
@collection.asset_custom_fields.first.label = 'Simple description'
|
@collection.asset_custom_fields.first.label = 'Simple description'
|
||||||
@collection.asset_custom_fields.first._alias = nil
|
@collection.asset_custom_fields.first._alias = nil
|
||||||
@collection.upsert(false)
|
@collection.upsert(:validate => false)
|
||||||
@collection.reload
|
@collection.reload
|
||||||
asset = @collection.assets.first
|
asset = @collection.assets.first
|
||||||
asset.simple_description.should == 'Lorem ipsum'
|
asset.simple_description.should == 'Lorem ipsum'
|
||||||
@ -157,7 +157,7 @@ describe AssetCollection do
|
|||||||
@collection.save; @collection = AssetCollection.first
|
@collection.save; @collection = AssetCollection.first
|
||||||
@collection.update_attributes(:asset_custom_fields_attributes => {
|
@collection.update_attributes(:asset_custom_fields_attributes => {
|
||||||
'0' => { 'label' => 'My Description', 'kind' => 'Text', '_destroy' => '1' },
|
'0' => { 'label' => 'My Description', 'kind' => 'Text', '_destroy' => '1' },
|
||||||
'1' => { 'label' => 'Active', 'kind' => 'Boolean', '_destroy' => '0' },
|
'1' => { 'label' => 'Active', 'kind' => 'Boolean', '_destroy' => '1' },
|
||||||
'2' => { 'label' => 'My Title !', 'kind' => 'String' },
|
'2' => { 'label' => 'My Title !', 'kind' => 'String' },
|
||||||
'new_record' => { 'label' => 'Published at', 'kind' => 'String' }
|
'new_record' => { 'label' => 'Published at', 'kind' => 'String' }
|
||||||
})
|
})
|
||||||
|
@ -351,7 +351,7 @@ describe Page do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'does forget to set the content type id' do
|
it 'does forget to set the content type id' do
|
||||||
@page.content_type_id.should == '42'
|
@page.content_type_id.should == 42
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user