Commit 74e6b606 authored by Corinna Wiesner's avatar Corinna Wiesner

Add spec for License#data_filename

The spec for License#data_filename was missing, this change will add the
missing test coverage for the method.
parent 51e1ee63
...@@ -755,6 +755,24 @@ RSpec.describe License do ...@@ -755,6 +755,24 @@ RSpec.describe License do
end end
end end
describe "#data_filename" do
subject { license.data_filename }
context 'when licensee includes company information' do
let(:gl_license) do
build(:gitlab_license, licensee: { 'Company' => ' Example & Partner Inc. 2 ', 'Name' => 'User Example' })
end
it { is_expected.to eq('ExamplePartnerInc2.gitlab-license') }
end
context 'when licensee does not include company information' do
let(:gl_license) { build(:gitlab_license, licensee: { 'Name' => 'User Example' }) }
it { is_expected.to eq('UserExample.gitlab-license') }
end
end
describe "#md5" do describe "#md5" do
it "returns the same MD5 for licenses with carriage returns and those without" do it "returns the same MD5 for licenses with carriage returns and those without" do
other_license = build(:license, data: license.data.gsub("\n", "\r\n")) other_license = build(:license, data: license.data.gsub("\n", "\r\n"))
......
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