diff --git a/solara/lib/core/doctor/schema/brand_configurations.json b/solara/lib/core/doctor/schema/brand_configurations.json index 9ab807e..fa3c1d0 100644 --- a/solara/lib/core/doctor/schema/brand_configurations.json +++ b/solara/lib/core/doctor/schema/brand_configurations.json @@ -25,7 +25,7 @@ "items": { "type": "object", "properties": { - "key": { + "filename": { "type": "string" }, "name": { @@ -37,7 +37,7 @@ } }, "required": [ - "key", + "filename", "name", "content" ] diff --git a/solara/lib/spec/solara_manager_spec.rb b/solara/lib/spec/solara_manager_spec.rb index 8b3efe6..bec26e5 100644 --- a/solara/lib/spec/solara_manager_spec.rb +++ b/solara/lib/spec/solara_manager_spec.rb @@ -80,15 +80,16 @@ end it 'calls BrandOnboarder and switches to the new brand' do - expect(brand_onboarder_mock).to receive(:onboard) + expect(BrandOnboarder).to receive(:new).and_return(brand_onboarder_mock) + expect(brand_onboarder_mock).to receive(:onboard).with(brand_key, brand_name, clone_brand_key: nil) expect(manager).to receive(:switch).with(brand_key, ignore_health_check: true) manager.onboard(brand_key, brand_name) end it 'opens dashboard when open_dashboard is true' do - expect(BrandOnboarder).to receive(:new).with(brand_key, brand_name, clone_brand_key: nil).and_return(brand_onboarder_mock) - expect(brand_onboarder_mock).to receive(:onboard) + expect(BrandOnboarder).to receive(:new).and_return(brand_onboarder_mock) + expect(brand_onboarder_mock).to receive(:onboard).with(brand_key, brand_name, clone_brand_key: nil) expect(manager).to receive(:switch).with(brand_key, ignore_health_check: true) expect(manager).to receive(:dashboard).with(brand_key) @@ -96,13 +97,22 @@ end it 'does not open dashboard when open_dashboard is false' do - expect(BrandOnboarder).to receive(:new).with(brand_key, brand_name, clone_brand_key: nil).and_return(brand_onboarder_mock) - expect(brand_onboarder_mock).to receive(:onboard) + expect(BrandOnboarder).to receive(:new).and_return(brand_onboarder_mock) + expect(brand_onboarder_mock).to receive(:onboard).with(brand_key, brand_name, clone_brand_key: nil) expect(manager).to receive(:switch).with(brand_key, ignore_health_check: true) expect(manager).not_to receive(:dashboard) manager.onboard(brand_key, brand_name, open_dashboard: false) end + + it 'passes clone_brand_key when provided' do + clone_key = 'source_brand' + expect(BrandOnboarder).to receive(:new).and_return(brand_onboarder_mock) + expect(brand_onboarder_mock).to receive(:onboard).with(brand_key, brand_name, clone_brand_key: clone_key) + expect(manager).to receive(:switch).with(brand_key, ignore_health_check: true) + + manager.onboard(brand_key, brand_name, clone_brand_key: clone_key) + end end end