diff options
Diffstat (limited to 'vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb')
-rw-r--r-- | vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb b/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb index a599386b26c..e9fd38f474b 100644 --- a/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb +++ b/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb @@ -77,4 +77,26 @@ describe OmniAuth::Strategies::GitLab do end end end + + describe '#callback_url' do + let(:base_url) { 'https://example.com' } + + context 'no script name present' do + it 'has the correct default callback path' do + allow(subject).to receive(:full_host) { base_url } + allow(subject).to receive(:script_name) { '' } + allow(subject).to receive(:query_string) { '' } + expect(subject.callback_url).to eq(base_url + '/auth/gitlab/callback') + end + end + + context 'script name' do + it 'should set the callback path with script_name' do + allow(subject).to receive(:full_host) { base_url } + allow(subject).to receive(:script_name) { '/v1' } + allow(subject).to receive(:query_string) { '' } + expect(subject.callback_url).to eq(base_url + '/v1/auth/gitlab/callback') + end + end + end end |