Files
ubicloud/spec/model/account_spec.rb
Jeremy Evans 4b819d3cb2 Change all create_with_id to create
It hasn't been necessary to use create_with_id since
ebc79622df, in December 2024.

I have plans to introduce:

```ruby
def create_with_id(id, values)
  obj = new(values)
  obj.id = id
  obj.save_changes
end
```

This will make it easier to use the same id when creating
multiple objects.  The first step is removing the existing
uses of create_with_id.
2025-08-06 01:55:51 +09:00

17 lines
583 B
Ruby

# frozen_string_literal: true
RSpec.describe Account do
let(:account) { described_class.create(email: "test@example.com") }
it "removes referencing access control entries and subject tag memberships" do
project = account.create_project_with_default_policy("project-1", default_policy: false)
tag = SubjectTag.create(project_id: project.id, name: "t")
tag.add_member(account.id)
ace = AccessControlEntry.create(project_id: project.id, subject_id: account.id)
account.destroy
expect(tag.member_ids).to be_empty
expect(ace).not_to be_exists
end
end