spec/unit/base_spec.rb in couchrest_model-2.0.4 vs spec/unit/base_spec.rb in couchrest_model-2.1.0.beta1
- old
+ new
@@ -12,11 +12,11 @@
@obj.database.name.should == 'couchrest-model-test'
end
it "should override the default db" do
@obj.database = TEST_SERVER.database!('couchrest-extendedmodel-test')
- @obj.database.name.should == 'couchrest-extendedmodel-test'
+ expect(@obj.database.name).to eql 'couchrest-extendedmodel-test'
@obj.database.delete!
end
end
describe "a new model" do
@@ -175,11 +175,11 @@
p.should eql(Project.get(p.id))
end
it "should not be true if databases do not match" do
p = Project.create
p2 = p.dup
- p2.stub!(:database).and_return('other')
+ p2.stub(:database).and_return('other')
p.should_not eql(p2)
end
it "should always be false if one document not saved" do
p = Project.create(:name => 'test')
o = Project.new(:name => 'test')
@@ -221,15 +221,15 @@
@art.update_attributes_without_saving('_rev' => 'foobar')
@art['_rev'].should_not == 'foobar'
end
it "should silently ignore created_at" do
@art.update_attributes_without_saving('created_at' => 'foobar')
- @art['created_at'].should_not == 'foobar'
+ expect(@art['created_at'].to_s).to_not eql('foobar')
end
it "should silently ignore updated_at" do
@art.update_attributes_without_saving('updated_at' => 'foobar')
- @art['updated_at'].should_not == 'foobar'
+ expect(@art['updated_at']).to_not eql('foobar')
end
it "should also work using attributes= alias" do
@art.respond_to?(:attributes=).should be_true
@art.attributes = {'date' => Time.now, :title => "something else"}
@art['title'].should == "something else"
@@ -275,10 +275,10 @@
end
it "should automatically call a proc default at initialization" do
@obj.set_by_proc.should be_an_instance_of(Time)
@obj.set_by_proc.should == @obj.set_by_proc
- @obj.set_by_proc.should < Time.now
+ expect(@obj.set_by_proc.utc).to be < Time.now.utc
end
it "should let you overwrite the default values" do
obj = WithDefaultValues.new(:preset => 'test')
obj.preset = 'test'