debian-mirror-gitlab/spec/models/concerns/transactions_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
458 B
Ruby
Raw Normal View History

2022-01-26 12:08:38 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Transactions do
let(:model) { build(:project) }
it 'is not in a transaction' do
expect(model.class).not_to be_inside_transaction
end
it 'is in a transaction', :aggregate_failures do
Project.transaction do
expect(model.class).to be_inside_transaction
end
ApplicationRecord.transaction do
expect(model.class).to be_inside_transaction
end
end
end