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.
20 lines
513 B
Ruby
20 lines
513 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "spec_helper"
|
|
|
|
RSpec.describe BootImage do
|
|
subject(:boot_image) { described_class.new }
|
|
|
|
describe "#remove_boot_image" do
|
|
it "creates a strand to delete boot image" do
|
|
expect(Strand).to receive(:create) do |args|
|
|
expect(args[:prog]).to eq("RemoveBootImage")
|
|
expect(args[:label]).to eq("start")
|
|
expect(args[:stack]).to eq([{subject_id: 1}])
|
|
end
|
|
boot_image.id = 1
|
|
boot_image.remove_boot_image
|
|
end
|
|
end
|
|
end
|