Skip to content
Snippets Groups Projects
Commit 22e9af3c authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent c8e28a0b
No related branches found
No related tags found
No related merge requests found
Showing
with 81 additions and 125 deletions
Loading
@@ -32,8 +32,8 @@ describe('Repository parent row component', () => {
Loading
@@ -32,8 +32,8 @@ describe('Repository parent row component', () => {
   
it.each` it.each`
path | to path | to
${'app'} | ${'/tree/master/'} ${'app'} | ${'/-/tree/master/'}
${'app/assets'} | ${'/tree/master/app'} ${'app/assets'} | ${'/-/tree/master/app'}
`('renders link in $path to $to', ({ path, to }) => { `('renders link in $path to $to', ({ path, to }) => {
factory(path); factory(path);
   
Loading
@@ -48,7 +48,7 @@ describe('Repository parent row component', () => {
Loading
@@ -48,7 +48,7 @@ describe('Repository parent row component', () => {
vm.find('td').trigger('click'); vm.find('td').trigger('click');
   
expect($router.push).toHaveBeenCalledWith({ expect($router.push).toHaveBeenCalledWith({
path: '/tree/master/app', path: '/-/tree/master/app',
}); });
}); });
   
Loading
@@ -60,7 +60,7 @@ describe('Repository parent row component', () => {
Loading
@@ -60,7 +60,7 @@ describe('Repository parent row component', () => {
vm.find('a').trigger('click'); vm.find('a').trigger('click');
   
expect($router.push).not.toHaveBeenCalledWith({ expect($router.push).not.toHaveBeenCalledWith({
path: '/tree/master/app', path: '/-/tree/master/app',
}); });
}); });
   
Loading
Loading
Loading
@@ -88,7 +88,7 @@ describe('Repository table row component', () => {
Loading
@@ -88,7 +88,7 @@ describe('Repository table row component', () => {
vm.trigger('click'); vm.trigger('click');
   
if (pushes) { if (pushes) {
expect($router.push).toHaveBeenCalledWith({ path: '/tree/master/test' }); expect($router.push).toHaveBeenCalledWith({ path: '/-/tree/master/test' });
} else { } else {
expect($router.push).not.toHaveBeenCalled(); expect($router.push).not.toHaveBeenCalled();
} }
Loading
Loading
Loading
@@ -4,11 +4,11 @@ import createRouter from '~/repository/router';
Loading
@@ -4,11 +4,11 @@ import createRouter from '~/repository/router';
   
describe('Repository router spec', () => { describe('Repository router spec', () => {
it.each` it.each`
path | component | componentName path | component | componentName
${'/'} | ${IndexPage} | ${'IndexPage'} ${'/'} | ${IndexPage} | ${'IndexPage'}
${'/tree/master'} | ${TreePage} | ${'TreePage'} ${'/-/tree/master'} | ${TreePage} | ${'TreePage'}
${'/tree/master/app/assets'} | ${TreePage} | ${'TreePage'} ${'/-/tree/master/app/assets'} | ${TreePage} | ${'TreePage'}
${'/tree/123/app/assets'} | ${null} | ${'null'} ${'/-/tree/123/app/assets'} | ${null} | ${'null'}
`('sets component as $componentName for path "$path"', ({ path, component }) => { `('sets component as $componentName for path "$path"', ({ path, component }) => {
const router = createRouter('', 'master'); const router = createRouter('', 'master');
   
Loading
Loading
Loading
@@ -56,7 +56,7 @@ describe BlobHelper do
Loading
@@ -56,7 +56,7 @@ describe BlobHelper do
stub_feature_flags(web_ide_default: false) stub_feature_flags(web_ide_default: false)
link = helper.edit_blob_button(project, 'master', 'README.md') link = helper.edit_blob_button(project, 'master', 'README.md')
   
expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/edit/master/README.md") expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/-/edit/master/README.md")
end end
   
it 'returns a link with a Web IDE route' do it 'returns a link with a Web IDE route' do
Loading
@@ -69,7 +69,7 @@ describe BlobHelper do
Loading
@@ -69,7 +69,7 @@ describe BlobHelper do
stub_feature_flags(web_ide_default: false) stub_feature_flags(web_ide_default: false)
link = helper.edit_blob_button(project, 'master', 'README.md', link_opts: { mr_id: 10 }) link = helper.edit_blob_button(project, 'master', 'README.md', link_opts: { mr_id: 10 })
   
expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/edit/master/README.md?mr_id=10") expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/-/edit/master/README.md?mr_id=10")
end end
end end
   
Loading
Loading
Loading
@@ -103,7 +103,7 @@ describe MarkupHelper do
Loading
@@ -103,7 +103,7 @@ describe MarkupHelper do
let(:requested_path) { 'files/images/README.md' } let(:requested_path) { 'files/images/README.md' }
   
it 'returns the correct HTML for the image' do it 'returns the correct HTML for the image' do
expanded_path = "/#{project.full_path}/raw/master/files/images/#{image_file}" expanded_path = "/#{project.full_path}/-/raw/master/files/images/#{image_file}"
   
expect(subject.css('a')[0].attr('href')).to eq(expanded_path) expect(subject.css('a')[0].attr('href')).to eq(expanded_path)
expect(subject.css('img')[0].attr('data-src')).to eq(expanded_path) expect(subject.css('img')[0].attr('data-src')).to eq(expanded_path)
Loading
Loading
Loading
@@ -100,34 +100,34 @@ describe SubmoduleHelper do
Loading
@@ -100,34 +100,34 @@ describe SubmoduleHelper do
allow(repo).to receive(:project).and_return(project) allow(repo).to receive(:project).and_return(project)
   
stub_url('./') stub_url('./')
expect(subject).to eq(["/master-project/#{project.path}", "/master-project/#{project.path}/tree/hash"]) expect(subject).to eq(["/master-project/#{project.path}", "/master-project/#{project.path}/-/tree/hash"])
end end
end end
   
context 'submodule on gitlab.com' do context 'submodule on gitlab.com' do
it 'detects ssh' do it 'detects ssh' do
stub_url('git@gitlab.com:gitlab-org/gitlab-foss.git') stub_url('git@gitlab.com:gitlab-org/gitlab-foss.git')
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
   
it 'detects http' do it 'detects http' do
stub_url('http://gitlab.com/gitlab-org/gitlab-foss.git') stub_url('http://gitlab.com/gitlab-org/gitlab-foss.git')
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
   
it 'detects https' do it 'detects https' do
stub_url('https://gitlab.com/gitlab-org/gitlab-foss.git') stub_url('https://gitlab.com/gitlab-org/gitlab-foss.git')
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
   
it 'handles urls with no .git on the end' do it 'handles urls with no .git on the end' do
stub_url('http://gitlab.com/gitlab-org/gitlab-foss') stub_url('http://gitlab.com/gitlab-org/gitlab-foss')
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
   
it 'handles urls with trailing whitespace' do it 'handles urls with trailing whitespace' do
stub_url('http://gitlab.com/gitlab-org/gitlab-foss.git ') stub_url('http://gitlab.com/gitlab-org/gitlab-foss.git ')
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
   
it 'returns original with non-standard url' do it 'returns original with non-standard url' do
Loading
@@ -171,7 +171,7 @@ describe SubmoduleHelper do
Loading
@@ -171,7 +171,7 @@ describe SubmoduleHelper do
stub_url(relative_path) stub_url(relative_path)
result = subject result = subject
   
expect(result).to eq([expected_path, "#{expected_path}/tree/#{submodule_item.id}"]) expect(result).to eq([expected_path, "#{expected_path}/-/tree/#{submodule_item.id}"])
end end
   
it 'handles project under same group' do it 'handles project under same group' do
Loading
Loading
Loading
@@ -38,11 +38,11 @@ describe('DiffViewer', () => {
Loading
@@ -38,11 +38,11 @@ describe('DiffViewer', () => {
   
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('.deleted img').getAttribute('src')).toBe( expect(vm.$el.querySelector('.deleted img').getAttribute('src')).toBe(
`//raw/DEF/${RED_BOX_IMAGE_URL}`, `//-/raw/DEF/${RED_BOX_IMAGE_URL}`,
); );
   
expect(vm.$el.querySelector('.added img').getAttribute('src')).toBe( expect(vm.$el.querySelector('.added img').getAttribute('src')).toBe(
`//raw/ABC/${GREEN_BOX_IMAGE_URL}`, `//-/raw/ABC/${GREEN_BOX_IMAGE_URL}`,
); );
   
done(); done();
Loading
Loading
import { shallowMount, createLocalVue } from '@vue/test-utils';
import GraphqlPagination from '~/vue_shared/components/pagination/graphql_pagination.vue';
const localVue = createLocalVue();
describe('Graphql Pagination component', () => {
let wrapper;
function factory({ hasNextPage = true, hasPreviousPage = true }) {
wrapper = shallowMount(localVue.extend(GraphqlPagination), {
propsData: {
hasNextPage,
hasPreviousPage,
},
localVue,
});
}
afterEach(() => {
wrapper.destroy();
});
describe('without previous page', () => {
beforeEach(() => {
factory({ hasPreviousPage: false });
});
it('renders disabled previous button', () => {
expect(wrapper.find('.js-prev-btn').attributes().disabled).toEqual('true');
});
});
describe('with previous page', () => {
beforeEach(() => {
factory({ hasPreviousPage: true });
});
it('renders enabled previous button', () => {
expect(wrapper.find('.js-prev-btn').attributes().disabled).toEqual(undefined);
});
it('emits previousClicked on click', () => {
wrapper.find('.js-prev-btn').vm.$emit('click');
expect(wrapper.emitted().previousClicked.length).toBe(1);
});
});
describe('without next page', () => {
beforeEach(() => {
factory({ hasNextPage: false });
});
it('renders disabled next button', () => {
expect(wrapper.find('.js-next-btn').attributes().disabled).toEqual('true');
});
});
describe('with next page', () => {
beforeEach(() => {
factory({ hasNextPage: true });
});
it('renders enabled next button', () => {
expect(wrapper.find('.js-next-btn').attributes().disabled).toEqual(undefined);
});
it('emits nextClicked on click', () => {
wrapper.find('.js-next-btn').vm.$emit('click');
expect(wrapper.emitted().nextClicked.length).toBe(1);
});
});
});
Loading
@@ -152,7 +152,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -152,7 +152,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
it 'rebuilds absolute URL for a file in the repo' do it 'rebuilds absolute URL for a file in the repo' do
doc = filter(link('/doc/api/README.md')) doc = filter(link('/doc/api/README.md'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md"
end end
   
it 'does not modify relative URLs in system notes' do it 'does not modify relative URLs in system notes' do
Loading
@@ -170,13 +170,13 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -170,13 +170,13 @@ describe Banzai::Filter::RepositoryLinkFilter do
it 'rebuilds relative URL for a file in the repo' do it 'rebuilds relative URL for a file in the repo' do
doc = filter(link('doc/api/README.md')) doc = filter(link('doc/api/README.md'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md"
end end
   
it 'rebuilds relative URL for a file in the repo with leading ./' do it 'rebuilds relative URL for a file in the repo with leading ./' do
doc = filter(link('./doc/api/README.md')) doc = filter(link('./doc/api/README.md'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md"
end end
   
it 'rebuilds relative URL for a file in the repo up one directory' do it 'rebuilds relative URL for a file in the repo up one directory' do
Loading
@@ -184,7 +184,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -184,7 +184,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
doc = filter(relative_link, requested_path: 'doc/update/7.14-to-8.0.md') doc = filter(relative_link, requested_path: 'doc/update/7.14-to-8.0.md')
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md"
end end
   
it 'rebuilds relative URL for a file in the repo up multiple directories' do it 'rebuilds relative URL for a file in the repo up multiple directories' do
Loading
@@ -192,7 +192,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -192,7 +192,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
doc = filter(relative_link, requested_path: 'doc/foo/bar/baz/README.md') doc = filter(relative_link, requested_path: 'doc/foo/bar/baz/README.md')
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md"
end end
   
it 'rebuilds relative URL for a file in the repository root' do it 'rebuilds relative URL for a file in the repository root' do
Loading
@@ -200,47 +200,47 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -200,47 +200,47 @@ describe Banzai::Filter::RepositoryLinkFilter do
doc = filter(relative_link, requested_path: 'doc/some-file.md') doc = filter(relative_link, requested_path: 'doc/some-file.md')
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/README.md" .to eq "/#{project_path}/-/blob/#{ref}/README.md"
end end
   
it 'rebuilds relative URL for a file in the repo with an anchor' do it 'rebuilds relative URL for a file in the repo with an anchor' do
doc = filter(link('README.md#section')) doc = filter(link('README.md#section'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/blob/#{ref}/README.md#section" .to eq "/#{project_path}/-/blob/#{ref}/README.md#section"
end end
   
it 'rebuilds relative URL for a directory in the repo' do it 'rebuilds relative URL for a directory in the repo' do
doc = filter(link('doc/api/')) doc = filter(link('doc/api/'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/tree/#{ref}/doc/api" .to eq "/#{project_path}/-/tree/#{ref}/doc/api"
end end
   
it 'rebuilds relative URL for an image in the repo' do it 'rebuilds relative URL for an image in the repo' do
doc = filter(image('files/images/logo-black.png')) doc = filter(image('files/images/logo-black.png'))
   
expect(doc.at_css('img')['src']) expect(doc.at_css('img')['src'])
.to eq "/#{project_path}/raw/#{ref}/files/images/logo-black.png" .to eq "/#{project_path}/-/raw/#{ref}/files/images/logo-black.png"
end end
   
it 'rebuilds relative URL for link to an image in the repo' do it 'rebuilds relative URL for link to an image in the repo' do
doc = filter(link('files/images/logo-black.png')) doc = filter(link('files/images/logo-black.png'))
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/raw/#{ref}/files/images/logo-black.png" .to eq "/#{project_path}/-/raw/#{ref}/files/images/logo-black.png"
end end
   
it 'rebuilds relative URL for a video in the repo' do it 'rebuilds relative URL for a video in the repo' do
doc = filter(video('files/videos/intro.mp4'), commit: project.commit('video'), ref: 'video') doc = filter(video('files/videos/intro.mp4'), commit: project.commit('video'), ref: 'video')
   
expect(doc.at_css('video')['src']) expect(doc.at_css('video')['src'])
.to eq "/#{project_path}/raw/video/files/videos/intro.mp4" .to eq "/#{project_path}/-/raw/video/files/videos/intro.mp4"
end end
   
it 'rebuilds relative URL for audio in the repo' do it 'rebuilds relative URL for audio in the repo' do
doc = filter(audio('files/audio/sample.wav'), commit: project.commit('audio'), ref: 'audio') doc = filter(audio('files/audio/sample.wav'), commit: project.commit('audio'), ref: 'audio')
   
expect(doc.at_css('audio')['src']) expect(doc.at_css('audio')['src'])
.to eq "/#{project_path}/raw/audio/files/audio/sample.wav" .to eq "/#{project_path}/-/raw/audio/files/audio/sample.wav"
end end
   
it 'does not modify relative URL with an anchor only' do it 'does not modify relative URL with an anchor only' do
Loading
@@ -267,7 +267,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -267,7 +267,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
allow_any_instance_of(described_class).to receive(:uri_type).and_return(:raw) allow_any_instance_of(described_class).to receive(:uri_type).and_return(:raw)
   
doc = filter(image(escaped)) doc = filter(image(escaped))
expect(doc.at_css('img')['src']).to eq "/#{project_path}/raw/#{Addressable::URI.escape(ref)}/#{escaped}" expect(doc.at_css('img')['src']).to eq "/#{project_path}/-/raw/#{Addressable::URI.escape(ref)}/#{escaped}"
end end
   
context 'when requested path is a file in the repo' do context 'when requested path is a file in the repo' do
Loading
@@ -275,7 +275,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -275,7 +275,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
   
it 'rebuilds URL relative to the containing directory' do it 'rebuilds URL relative to the containing directory' do
doc = filter(link('users.md')) doc = filter(link('users.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md"
end end
end end
   
Loading
@@ -284,7 +284,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -284,7 +284,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
   
it 'rebuilds URL relative to the directory' do it 'rebuilds URL relative to the directory' do
doc = filter(link('users.md')) doc = filter(link('users.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md"
end end
end end
   
Loading
@@ -295,7 +295,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -295,7 +295,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
   
it 'correctly escapes the ref' do it 'correctly escapes the ref' do
doc = filter(link('.gitkeep')) doc = filter(link('.gitkeep'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep" expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep"
end end
end end
   
Loading
@@ -314,7 +314,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -314,7 +314,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
doc = filter(link(path)) doc = filter(link(path))
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/raw/#{ref_escaped}/files/images/logo-black.png" .to eq "/#{project_path}/-/raw/#{ref_escaped}/files/images/logo-black.png"
end end
end end
   
Loading
@@ -325,7 +325,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
Loading
@@ -325,7 +325,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
   
it 'does not escape the space twice' do it 'does not escape the space twice' do
doc = filter(link('README.md')) doc = filter(link('README.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md"
end end
end end
end end
Loading
Loading
Loading
@@ -31,7 +31,7 @@ describe ExtractsPath do
Loading
@@ -31,7 +31,7 @@ describe ExtractsPath do
   
it "log tree path has no escape sequences" do it "log tree path has no escape sequences" do
assign_ref_vars assign_ref_vars
expect(@logs_path).to eq("/#{@project.full_path}/refs/#{ref}/logs_tree/files/ruby/popen.rb") expect(@logs_path).to eq("/#{@project.full_path}/-/refs/#{ref}/logs_tree/files/ruby/popen.rb")
end end
   
context 'ref contains %20' do context 'ref contains %20' do
Loading
Loading
Loading
@@ -95,6 +95,17 @@ describe Gitlab::Auth::Saml::AuthHash do
Loading
@@ -95,6 +95,17 @@ describe Gitlab::Auth::Saml::AuthHash do
end end
end end
   
context 'with ADFS SAML response_object' do
before do
auth_hash_data[:extra][:response_object] = { document:
saml_xml(File.read('spec/fixtures/authentication/adfs_saml_response.xml')) }
end
it 'can extract authn_context' do
expect(saml_auth_hash.authn_context).to eq 'urn:federation:authentication:windows'
end
end
context 'without response_object' do context 'without response_object' do
it 'returns an empty string' do it 'returns an empty string' do
expect(saml_auth_hash.authn_context).to be_nil expect(saml_auth_hash.authn_context).to be_nil
Loading
Loading
Loading
@@ -258,7 +258,7 @@ FILE
Loading
@@ -258,7 +258,7 @@ FILE
describe '#as_json' do describe '#as_json' do
it 'includes the blob path for the file' do it 'includes the blob path for the file' do
expect(conflict_file.as_json[:blob_path]) expect(conflict_file.as_json[:blob_path])
.to eq("/#{project.full_path}/blob/#{our_commit.oid}/files/ruby/regex.rb") .to eq("/#{project.full_path}/-/blob/#{our_commit.oid}/files/ruby/regex.rb")
end end
   
it 'includes the blob icon for the file' do it 'includes the blob icon for the file' do
Loading
Loading
Loading
@@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do
Loading
@@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do
end end
   
it 'links GitLab projects' do it 'links GitLab projects' do
expect(subject).to include(link('gitlab.com/group/project/path', 'https://gitlab.com/group/project/tree/master/path')) expect(subject).to include(link('gitlab.com/group/project/path', 'https://gitlab.com/group/project/-/tree/master/path'))
expect(subject).to include(link('gitlab.com/group/subgroup/project.git/path', 'https://gitlab.com/group/subgroup/project/tree/master/path')) expect(subject).to include(link('gitlab.com/group/subgroup/project.git/path', 'https://gitlab.com/group/subgroup/project/-/tree/master/path'))
end end
   
it 'links Golang packages' do it 'links Golang packages' do
Loading
Loading
Loading
@@ -21,7 +21,7 @@ describe Gitlab::Graphql::Representation::SubmoduleTreeEntry do
Loading
@@ -21,7 +21,7 @@ describe Gitlab::Graphql::Representation::SubmoduleTreeEntry do
) )
   
expect(entries.map(&:tree_url)).to contain_exactly( expect(entries.map(&:tree_url)).to contain_exactly(
"https://gitlab.com/gitlab-org/gitlab-grack/tree/645f6c4c82fd3f5e06f67134450a570b795e55a6", "https://gitlab.com/gitlab-org/gitlab-grack/-/tree/645f6c4c82fd3f5e06f67134450a570b795e55a6",
"https://github.com/gitlabhq/gitlab-shell/tree/79bceae69cb5750d6567b223597999bfa91cb3b9", "https://github.com/gitlabhq/gitlab-shell/tree/79bceae69cb5750d6567b223597999bfa91cb3b9",
"https://github.com/randx/six/tree/409f37c4f05865e4fb208c771485f211a22c4c2d" "https://github.com/randx/six/tree/409f37c4f05865e4fb208c771485f211a22c4c2d"
) )
Loading
Loading
Loading
@@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do
Loading
@@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do
project_url = "http://#{Gitlab.config.gitlab.host}/#{path}" project_url = "http://#{Gitlab.config.gitlab.host}/#{path}"
expect(response[0]).to eq(200) expect(response[0]).to eq(200)
expect(response[1]['Content-Type']).to eq('text/html') expect(response[1]['Content-Type']).to eq('text/html')
expected_body = %{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/tree/#{branch}{/dir} #{project_url}/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>} expected_body = %{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/-/tree/#{branch}{/dir} #{project_url}/-/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>}
expect(response[2].body).to eq([expected_body]) expect(response[2].body).to eq([expected_body])
end end
end end
Loading
Loading
Loading
@@ -38,7 +38,7 @@ describe Gitlab::SubmoduleLinks do
Loading
@@ -38,7 +38,7 @@ describe Gitlab::SubmoduleLinks do
end end
   
it 'returns links and caches the by ref' do it 'returns links and caches the by ref' do
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
   
cache_store = links.instance_variable_get("@cache_store") cache_store = links.instance_variable_get("@cache_store")
   
Loading
@@ -49,7 +49,7 @@ describe Gitlab::SubmoduleLinks do
Loading
@@ -49,7 +49,7 @@ describe Gitlab::SubmoduleLinks do
let(:ref) { 'signed-commits' } let(:ref) { 'signed-commits' }
   
it 'returns links' do it 'returns links' do
expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/tree/hash']) expect(subject).to eq(['https://gitlab.com/gitlab-org/gitlab-foss', 'https://gitlab.com/gitlab-org/gitlab-foss/-/tree/hash'])
end end
end end
end end
Loading
Loading
Loading
@@ -189,7 +189,7 @@ describe Key, :mailer do
Loading
@@ -189,7 +189,7 @@ describe Key, :mailer do
   
it 'removes key from authorized_file' do it 'removes key from authorized_file' do
key = create(:personal_key) key = create(:personal_key)
expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, key.shell_id, key.key) expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, key.shell_id)
key.destroy key.destroy
end end
end end
Loading
Loading
Loading
@@ -725,7 +725,7 @@ describe Project do
Loading
@@ -725,7 +725,7 @@ describe Project do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
   
it 'returns the README' do it 'returns the README' do
expect(project.readme_url).to eq("#{project.web_url}/blob/master/README.md") expect(project.readme_url).to eq("#{project.web_url}/-/blob/master/README.md")
end end
end end
end end
Loading
Loading
Loading
@@ -1817,10 +1817,28 @@ describe Repository do
Loading
@@ -1817,10 +1817,28 @@ describe Repository do
end end
   
describe '#after_import' do describe '#after_import' do
subject { repository.after_import }
it 'flushes and builds the cache' do it 'flushes and builds the cache' do
expect(repository).to receive(:expire_content_cache) expect(repository).to receive(:expire_content_cache)
   
repository.after_import subject
end
it 'calls DetectRepositoryLanguagesWorker' do
expect(DetectRepositoryLanguagesWorker).to receive(:perform_async)
subject
end
context 'with a wiki repository' do
let(:repository) { project.wiki.repository }
it 'does not call DetectRepositoryLanguagesWorker' do
expect(DetectRepositoryLanguagesWorker).not_to receive(:perform_async)
subject
end
end end
end end
   
Loading
Loading
Loading
@@ -21,7 +21,7 @@ describe BlobPresenter, :seed_helper do
Loading
@@ -21,7 +21,7 @@ describe BlobPresenter, :seed_helper do
   
subject { described_class.new(blob) } subject { described_class.new(blob) }
   
it { expect(subject.web_url).to eq("http://localhost/#{project.full_path}/blob/#{blob.commit_id}/#{blob.path}") } it { expect(subject.web_url).to eq("http://localhost/#{project.full_path}/-/blob/#{blob.commit_id}/#{blob.path}") }
end end
   
describe '#highlight' do describe '#highlight' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment