Commit 06d2a99c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'ld-remove-DesignAtVersion-instantiate-method' into 'master'

Remove DesignAtVersion.instantiate method

See merge request gitlab-org/gitlab!44528
parents 91885022 d3b34ada
......@@ -21,10 +21,6 @@ module DesignManagement
@design, @version = design, version
end
def self.instantiate(attrs)
new(**attrs).tap { |obj| obj.validate! }
end
# The ID, needed by GraphQL types and as part of the Lazy-fetch
# protocol, includes information about both the design and the version.
#
......
......@@ -274,29 +274,6 @@ RSpec.describe DesignManagement::DesignAtVersion do
build(:design_at_version, design: design, version: version).id
end
describe '.instantiate' do
context 'when attrs are valid' do
subject do
described_class.instantiate(design: design, version: version)
end
it { is_expected.to be_a(described_class).and(be_valid) }
end
context 'when attrs are invalid' do
subject do
described_class.instantiate(
design: create(:design),
version: create(:design_version)
)
end
it 'raises a validation error' do
expect { subject }.to raise_error(ActiveModel::ValidationError)
end
end
end
describe '.lazy_find' do
let!(:version_a) do
create(:design_version, designs: create_list(:design, 3, issue: issue))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment