Skip to content

Commit

Permalink
Changes based on code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Mar 16, 2018
1 parent d20b218 commit f0533b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions package/yast2-registration.changes
@@ -1,11 +1,10 @@
-------------------------------------------------------------------
Fri Mar 16 13:22:35 UTC 2018 - knut.anderssen@suse.com

- Just use the first product availble from the media When a self
- Just use the first product available from the media When a self
update id is defined in the control file (bsc#1084820)
- 4.0.25


-------------------------------------------------------------------
Tue Mar 13 09:37:14 UTC 2018 - knut.anderssen@suse.com

Expand Down
18 changes: 9 additions & 9 deletions test/registration_spec.rb
Expand Up @@ -200,18 +200,15 @@
end

describe "#get_updates_list" do
let(:self_update_id) { "SLES" }
let(:base_product) { { "name" => "base" } }
let(:installer_update_base_product) { { "name" => "self_update_id" } }
let(:installer_update_base_product) { { "name" => self_update_id } }
let(:remote_product) { { "name" => "base" } }
let(:updates) { ["http://updates.suse.com/sles12/"] }
let(:suse_connect) { double("suse_connect") }
let(:self_update_id) { "self_update_id" }

before do
allow(Registration::SwMgmt).to receive(:base_product_to_register).and_return(base_product)
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "self_update_id")
.and_return(self_update_id)
stub_const("SUSE::Connect::YaST", suse_connect)
end

Expand All @@ -223,20 +220,23 @@

context "when the control file defines a self_update_id" do
it "returns updates list from the server for the self update id" do
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "self_update_id").and_return(self_update_id)
expect(Registration::SwMgmt).to receive(:installer_update_base_product)
.with(self_update_id).and_return(installer_update_base_product)
expect(Registration::SwMgmt).to receive(:remote_product).with("name" => "self_update_id")
.and_return("name" => "self_update_id")
expect(Registration::SwMgmt).to receive(:remote_product)
.with(installer_update_base_product).and_return(installer_update_base_product)
expect(suse_connect).to receive(:list_installer_updates)
.with({ "name" => "self_update_id" }, anything)
.with(installer_update_base_product, anything)
.and_return(updates)
expect(subject.get_updates_list).to eq(updates)
end
end

context "when the control file does not define a self_update_id" do
let(:self_update_id) { "" }
it "returns updates list from the server for the base product" do
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "self_update_id").and_return("")
expect(Registration::SwMgmt).to receive(:remote_product).with(base_product)
.and_return(remote_product)
expect(suse_connect).to receive(:list_installer_updates).with(remote_product, anything)
Expand Down

0 comments on commit f0533b5

Please sign in to comment.