diff --git a/spec/lib/postzord/dispatch_spec.rb b/spec/lib/postzord/dispatch_spec.rb index 414dde600..6991e8b93 100644 --- a/spec/lib/postzord/dispatch_spec.rb +++ b/spec/lib/postzord/dispatch_spec.rb @@ -302,7 +302,9 @@ describe Postzord::Dispatch do it 'should call object#socket_to_user for each local user' do sc = mock() SocketsController.should_receive(:new).and_return(sc) - sc.should_receive(:outgoing).with(bob, @zord.instance_variable_get(:@object), :aspect_ids => bob.contact_for(alice.person).aspect_memberships.map{|a| a.aspect_id}) + sc.should_receive(:outgoing).with(bob, + @zord.instance_variable_get(:@object), + :aspect_ids => bob.contact_for(alice.person).aspect_memberships.map{|a| postgres? ? a.aspect_id.to_s : a.aspect_id }) @zord.send(:socket_and_notify_users, [bob]) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eeb373643..3eef3e598 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -83,3 +83,7 @@ end def photo_fixture_name @photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png') end + +def postgres? + defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) +end