Skip to content

Commit

Permalink
Updated testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jan 11, 2017
1 parent 5a1962a commit 4b949b8
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion test/proposal_runner_test.rb
Expand Up @@ -90,7 +90,6 @@ class C < ::Installation::ProposalStore; end
.and_return("software")
expect_any_instance_of(::Installation::ProposalStore)
.not_to receive(:read_only?)
.and_return(true)

# initialization of internal state
expect(subject.run).to eq :auto
Expand Down Expand Up @@ -150,6 +149,42 @@ class C < ::Installation::ProposalStore; end
expect(subject.run).to eq(:next)
end
end

context "and it enables soft r/o proposal in case of error" do
PROPERTIES = {
"enable_skip" => "no",
"label" => "Installation Settings",
"mode" => "autoinstallation",
"name" => "initial",
"stage" => "initial",
"unique_id" => "auto_inst_proposal",
"proposal_modules" => [
{ "name" => "software", "presentation_order" => "15", "read_only" => "soft" }
]
}.freeze
let(:proposals) { [["software_proposal", 15]] }

it "makes a proposal" do
allow(subject)
.to receive(:html_header)
.with("software_proposal")
.and_call_original

# we need ProposalStore#make_proposal to call the callback
expect(Yast::WFM)
.to receive(:CallFunction)
.and_return(
"preformated_proposal" => "",
"warning_lever" => :error
)
expect(subject)
.to receive(:html_header)
.with("software_proposal", force_rw: true)
.at_least(:once)
.and_call_original
expect(subject.run).to eq(:next)
end
end
end
end
end

0 comments on commit 4b949b8

Please sign in to comment.