Skip to content

Commit

Permalink
Fixed mocking in additional_addresses widget unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Dec 17, 2020
1 parent 312d134 commit 933a544
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/y2network/widgets/additional_addresses_test.rb
Expand Up @@ -30,19 +30,19 @@

describe "#handle" do
it "opens address dialog for edit address button" do
expect(Yast::UI).to receive(:UserInput).and_return(:cancel)
expect_any_instance_of(dialog).to receive(:run).and_return(:cancel)

subject.handle("EventReason" => "Activated", "ID" => :edit_address)
end

it "opens address dialog for add address button" do
expect(Yast::UI).to receive(:UserInput).and_return(:cancel)
expect_any_instance_of(dialog).to receive(:run).and_return(:cancel)

subject.handle("EventReason" => "Activated", "ID" => :add_address)
end

it "do validations in address dialog" do
expect(Yast::UI).to receive(:UserInput).and_return(:ok)
expect_any_instance_of(dialog).to receive(:run).and_return(:ok)
allow(Yast::UI).to receive(:QueryWidget)
allow(Yast::UI).to receive(:QueryWidget).with(Id(:name), :Value).and_return("test")
allow(Yast::UI).to receive(:QueryWidget).with(Id(:ipaddr), :Value).and_return("10.0.0.1")
Expand Down

0 comments on commit 933a544

Please sign in to comment.