Commit a1b1586d authored by mo khan's avatar mo khan

Add missing unit tests

* as per discussion in
  https://gitlab.com/gitlab-org/gitlab/merge_requests/21261#note_259065473

/cc @ashmckenzie
parent 7da82783
......@@ -48,4 +48,34 @@ describe SoftwareLicensePolicy do
describe "#name" do
specify { expect(subject.name).to eql(subject.software_license.name) }
end
describe "#approval_status" do
where(:classification, :approval_status) do
[
%w[allowed approved],
%w[denied blacklisted]
]
end
with_them do
subject { build(:software_license_policy, classification: classification) }
it { expect(subject.approval_status).to eql(approval_status) }
end
end
describe ".to_classification" do
where(:approval_status, :classification) do
[
%w[approved allowed],
%w[blacklisted denied]
]
end
with_them do
subject { described_class.to_classification(approval_status) }
it { expect(subject).to eql(classification) }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment