Sha256: 9a7692c1891b3438ac88859596b24b28a3dfc717bc2aa48bdada95a5a5971b50
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
# encoding: UTF-8 require 'cases/helper_sqlserver' class SQLServerTriggerTest < ActiveRecord::TestCase after { exclude_output_inserted_table_names.clear } let(:exclude_output_inserted_table_names) do ActiveRecord::ConnectionAdapters::SQLServerAdapter.exclude_output_inserted_table_names end it 'can insert into a table with output inserted - with a true setting for table name' do exclude_output_inserted_table_names['sst_table_with_trigger'] = true assert SSTestTriggerHistory.all.empty? obj = SSTestTrigger.create! event_name: 'test trigger' ['Fixnum', 'Integer'].must_include obj.id.class.name obj.event_name.must_equal 'test trigger' obj.id.must_be :present? obj.id.to_s.must_equal SSTestTriggerHistory.first.id_source end it 'can insert into a table with output inserted - with a uniqueidentifier value' do exclude_output_inserted_table_names['sst_table_with_uuid_trigger'] = 'uniqueidentifier' assert SSTestTriggerHistory.all.empty? obj = SSTestTriggerUuid.create! event_name: 'test uuid trigger' obj.id.class.name.must_equal 'String' obj.event_name.must_equal 'test uuid trigger' obj.id.must_be :present? obj.id.to_s.must_equal SSTestTriggerHistory.first.id_source end end
Version data entries
6 entries across 6 versions & 1 rubygems