Skip to content
Snippets Groups Projects
Commit a527fab1 authored by Andrew Smith's avatar Andrew Smith
Browse files

Test all values for `enabled_git_access_protocol`

parent 532f8cbd
No related branches found
No related tags found
1 merge request!7840If SSH prototol is disabled don't say the user requires SSH keys
Loading
@@ -576,15 +576,20 @@ describe User, models: true do
Loading
@@ -576,15 +576,20 @@ describe User, models: true do
end end
end end
   
context 'when current_application_settings.enabled_git_access_protocol does not contain SSH' do describe '#require_ssh_key?' do
before do protocol_and_expectation = {
stub_application_setting(enabled_git_access_protocol: 'HTTP') 'http' => false,
end 'ssh' => true,
'' => true,
it "doesn't require user to have SSH key" do }
user = build(:user)
protocol_and_expectation.each do |protocol, expected|
expect(user.require_ssh_key?).to be_falsey it "has correct require_ssh_key?" do
stub_application_setting(enabled_git_access_protocol: protocol)
user = build(:user)
expect(user.require_ssh_key?).to eq(expected)
end
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment