Skip to content

Commit

Permalink
remove duplicite file
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 30, 2018
1 parent 88307ec commit 2ac788f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 124 deletions.
124 changes: 0 additions & 124 deletions src/lib/y2firewall/widgets/overview.rb

This file was deleted.

65 changes: 65 additions & 0 deletions test/lib/y2firewall/widgets/pages/zones_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,68 @@

include_examples "CWM::Page"
end

describe Y2Firewall::Widgets::Pages::Zones::AddButton do
subject { described_class.new(double("pager"), double("table", value: "dmz")) }
before do
allow(Y2Firewall::Dialogs::Zone).to receive(:run)
end

include_examples "CWM::PushButton"

describe "#handle" do
it "shows zone dialog" do
expect(Y2Firewall::Dialogs::Zone).to receive(:run)

subject.handle
end

context "zone dialog confirmed" do
before do
allow(Y2Firewall::Dialogs::Zone).to receive(:run).and_return(:ok)
end

it "returns :redraw" do
expect(subject.handle).to eq :redraw
end

it "adds zone to zones" do
expect { subject.handle }.to change(subject.firewall, :zones)
end
end

context "zone dialog canceled" do
before do
allow(Y2Firewall::Dialogs::Zone).to receive(:run).and_return(:cancel)
end

it "returns nil" do
expect(subject.handle).to eq nil
end
end
end
end

describe Y2Firewall::Widgets::Pages::Zones::EditButton do
subject { described_class.new(double("pager"), double("table", value: "dmz")) }

before do
allow(Y2Firewall::Dialogs::Zone).to receive(:run)

allow(subject.firewall).to receive(:find_zone).and_return(double(name: "dmz"))
end

include_examples "CWM::PushButton"
end

describe Y2Firewall::Widgets::Pages::Zones::RemoveButton do
subject { described_class.new(double("pager"), double("table", value: "my_zone")) }

before do
allow(Y2Firewall::Dialogs::Zone).to receive(:run)

allow(subject.firewall).to receive(:find_zone).and_return(double(name: "my_zone"))
end

include_examples "CWM::PushButton"
end

0 comments on commit 2ac788f

Please sign in to comment.