Commit aa264f5a authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Add explicit arg check in :minutes_cost_factor

parent 2fc4cd6d
...@@ -15,8 +15,10 @@ module EE ...@@ -15,8 +15,10 @@ module EE
case access_level case access_level
when ::Gitlab::VisibilityLevel::PUBLIC when ::Gitlab::VisibilityLevel::PUBLIC
public_projects_minutes_cost_factor public_projects_minutes_cost_factor
else # Gitlab::VisibilityLevel::PRIVATE/INTERNAL when ::Gitlab::VisibilityLevel::PRIVATE, ::Gitlab::VisibilityLevel::INTERNAL
private_projects_minutes_cost_factor private_projects_minutes_cost_factor
else
raise ArgumentError, 'Invalid visibility level'
end end
end end
......
...@@ -71,6 +71,14 @@ describe EE::Ci::Runner do ...@@ -71,6 +71,14 @@ describe EE::Ci::Runner do
it { is_expected.to eq(1.1) } it { is_expected.to eq(1.1) }
end end
context 'with invalid visibility level' do
let(:visibility_level) { 123 }
it 'raises an error' do
expect { subject }.to raise_error(ArgumentError)
end
end
end 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