diff options
Diffstat (limited to 'qa/spec/support/ssh_spec.rb')
-rw-r--r-- | qa/spec/support/ssh_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qa/spec/support/ssh_spec.rb b/qa/spec/support/ssh_spec.rb index f4d382f8adc..2edff824fd6 100644 --- a/qa/spec/support/ssh_spec.rb +++ b/qa/spec/support/ssh_spec.rb @@ -26,6 +26,16 @@ RSpec.describe QA::Support::SSH do end end + context 'when no port specified in https uri' do + let(:uri) { 'https://foo.com' } + + it 'does not provide port in ssh command' do + expect(ssh).to receive(:run).with(expected_ssh_command_no_port, any_args).and_return(result) + + call_method + end + end + context 'when port 80 specified in uri' do let(:uri) { 'http://foo.com:80' } @@ -86,6 +96,18 @@ RSpec.describe QA::Support::SSH do end end + context 'when running on a review app in CI' do + let(:uri) { 'https://gitlab-review.app' } + + before do + allow(QA::Runtime::Env).to receive(:running_in_ci?).and_return(true) + end + + it 'returns git user' do + expect(ssh.send(:git_user)).to eq('git') + end + end + context 'when running against environment on a port other than 80 or 443' do let(:uri) { 'http://localhost:3000' } |