spec/lib/ki/model_spec.rb in ki-0.4.5 vs spec/lib/ki/model_spec.rb in ki-0.4.6
- old
+ new
@@ -19,17 +19,17 @@
id = Foo.create({hello: 'world'})['id']
Foo.find(id).first['hello'].should == 'world'
Foo.update('id' => id, 'hello' => 'universe')
Foo.find(id).first['hello'].should == 'universe'
Foo.delete(id)
- }.to change{Foo.count}.by 0
+ }.to change { Foo.count }.by 0
end
it 'should find or create' do
expect {
- h = { 'time' => Time.now.to_i.to_s }
- r = Foo.find_or_create(h)
- r = Foo.find_or_create(h)
+ h = { time: Time.now.to_i.to_s, random: SecureRandom.uuid }
+ Foo.find_or_create(h)
+ Foo.find_or_create(h)
}.to change { Foo.count }.by 1
end
end
it 'should have restrictions configured' do