Sha256: 07647e02e4f536d64645c6dbfdfe1eb8ecb892e6fdc5f3ab4ecae0d18250b27a
Contents?: true
Size: 825 Bytes
Versions: 15
Compression:
Stored size: 825 Bytes
Contents
require 'spec_helper' describe 'when the database is not entire sharded' do before(:each) do allow(Octopus).to receive(:env).and_return('not_entire_sharded') OctopusHelper.clean_connection_proxy end it 'should not send all queries to the specified slave' do skip # User.create!(:name => "Thiago") # # using_environment :not_entire_sharded do # Octopus.using(:russia) do # User.create!(:name => "Thiago") # end # end # # User.count.should == 2 end it 'should pick the shard based on current_shard when you have a sharded model' do Cat.create!(:name => 'Thiago') OctopusHelper.using_environment :not_entire_sharded do Octopus.using(:russia) do Cat.create!(:name => 'Thiago') end end expect(Cat.count).to eq(1) end end
Version data entries
15 entries across 15 versions & 4 rubygems