Skip to content

Commit 162a86c

Browse files
committed
RUBY-2090 update tests for new constructor
1 parent 1a56b10 commit 162a86c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

spec/mongo/dbref_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
context 'when the database is not provided' do
1616

1717
let(:dbref) do
18-
described_class.new('users', object_id)
18+
described_class.new({'$ref' => 'users', '$id' => object_id})
1919
end
2020

2121
it 'returns the json document without database' do
@@ -26,7 +26,7 @@
2626
context 'when the database is provided' do
2727

2828
let(:dbref) do
29-
described_class.new('users', object_id, 'database')
29+
described_class.new({'$ref' => 'users', '$id' => object_id, '$db' => 'database'})
3030
end
3131

3232
it 'returns the json document with database' do
@@ -42,7 +42,7 @@
4242
describe '#initialize' do
4343

4444
let(:dbref) do
45-
described_class.new('users', object_id)
45+
described_class.new({'$ref' => 'users', '$id' => object_id})
4646
end
4747

4848
it 'sets the collection' do
@@ -56,7 +56,7 @@
5656
context 'when a database is provided' do
5757

5858
let(:dbref) do
59-
described_class.new('users', object_id, 'db')
59+
described_class.new({'$ref' => 'users', '$id' => object_id, '$db' => 'db'})
6060
end
6161

6262
it 'sets the database' do
@@ -68,7 +68,7 @@
6868
describe '#to_bson' do
6969

7070
let(:dbref) do
71-
described_class.new('users', object_id, 'database')
71+
described_class.new({'$ref' => 'users', '$id' => object_id, '$db' => 'database'})
7272
end
7373

7474
it 'converts the underlying document to bson' do
@@ -81,7 +81,7 @@
8181
context 'when the database is not provided' do
8282

8383
let(:dbref) do
84-
described_class.new('users', object_id)
84+
described_class.new({'$ref' => 'users', '$id' => object_id})
8585
end
8686

8787
it 'returns the json document without database' do
@@ -92,7 +92,7 @@
9292
context 'when the database is provided' do
9393

9494
let(:dbref) do
95-
described_class.new('users', object_id, 'database')
95+
described_class.new({'$ref' => 'users', '$id' => object_id, '$db' => 'database'})
9696
end
9797

9898
it 'returns the json document with database' do
@@ -114,7 +114,7 @@
114114
context 'when a database exists' do
115115

116116
let(:dbref) do
117-
described_class.new('users', object_id, 'database')
117+
described_class.new({'$ref' => 'users', '$id' => object_id, '$db' => 'database'})
118118
end
119119

120120
it 'decodes the ref' do
@@ -133,7 +133,7 @@
133133
context 'when no database exists' do
134134

135135
let(:dbref) do
136-
described_class.new('users', object_id)
136+
described_class.new({'$ref' => 'users', '$id' => object_id})
137137
end
138138

139139
it 'decodes the ref' do

0 commit comments

Comments
 (0)