Test all values for `enabled_git_access_protocol`

parent 532f8cbd
......@@ -576,15 +576,20 @@ describe User, models: true do
end
end
context 'when current_application_settings.enabled_git_access_protocol does not contain SSH' do
before do
stub_application_setting(enabled_git_access_protocol: 'HTTP')
end
it "doesn't require user to have SSH key" do
user = build(:user)
expect(user.require_ssh_key?).to be_falsey
describe '#require_ssh_key?' do
protocol_and_expectation = {
'http' => false,
'ssh' => true,
'' => true,
}
protocol_and_expectation.each do |protocol, expected|
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
......
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