Skip to content

Commit

Permalink
Add an additional test to InstRootFirstDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 2, 2018
1 parent 6cfe2c2 commit f538e84
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Makefile.am
Expand Up @@ -6,6 +6,7 @@ TESTS = \
lib/users/users_database_test.rb \
lib/users/leaf_blk_device_test.rb \
lib/users/ssh_public_key_test.rb \
lib/users/dialogs/inst_root_first.rb \
lib/users/widgets/inst_root_first_test.rb \
lib/users/widgets/public_key_selector_test.rb \
dialogs_test.rb \
Expand Down
44 changes: 44 additions & 0 deletions test/lib/users/dialogs/inst_root_first_test.rb
@@ -0,0 +1,44 @@
#!/usr/bin/env rspec
# encoding: utf-8

# Copyright (c) [2018] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require_relative "../../../test_helper"
require "users/dialogs/inst_root_first"
require "cwm/rspec"

describe Yast::InstRootFirstDialog do
subject(:dialog) { described_class.new }

include_examples "CWM::Dialog"

describe "#run" do
context "when the root user does not need a separate password" do
before do
allow(Yast::UsersSimple).to receive(:RootPasswordDialogSkipped)
.and_return(true)
end

it "returns :auto" do
expect(dialog.run).to eq(:auto)
end
end
end
end

0 comments on commit f538e84

Please sign in to comment.