spec/mongo/collection/view/readable_spec.rb in mongo-2.4.3 vs spec/mongo/collection/view/readable_spec.rb in mongo-2.5.0.beta
- old
+ new
@@ -1132,31 +1132,22 @@
end
end
describe '#read' do
- context 'when providing a hash' do
-
- it 'converts to a read preference' do
- expect(view.read(:mode => :primary_preferred).read).to be_a(
- Mongo::ServerSelector::PrimaryPreferred
- )
- end
- end
-
context 'when a read pref is specified' do
let(:options) do
- { :read => Mongo::ServerSelector.get(:mode => :secondary) }
+ { :read => { :mode => :secondary } }
end
let(:new_read) do
- Mongo::ServerSelector.get(:mode => :secondary_preferred)
+ { :mode => :secondary_preferred }
end
it 'sets the read preference' do
new_view = view.read(new_read)
- expect(new_view.read).to eq(new_read)
+ expect(new_view.read).to eq(BSON::Document.new(new_read))
end
it 'returns a new View' do
expect(view.read(new_read)).not_to be(view)
end