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

Add latest changes from gitlab-org/gitlab@master

parent 26a50872
No related branches found
No related tags found
No related merge requests found
Showing
with 194 additions and 76 deletions
Loading
Loading
@@ -36,7 +36,7 @@ describe 'Private Group access' do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe 'GET /groups/:path/issues' do
describe 'GET /groups/:path/-/issues' do
subject { issues_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -51,7 +51,7 @@ describe 'Private Group access' do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe 'GET /groups/:path/merge_requests' do
describe 'GET /groups/:path/-/merge_requests' do
let(:project) { create(:project, :private, :repository, group: group) }
 
subject { merge_requests_group_path(group) }
Loading
Loading
@@ -68,7 +68,7 @@ describe 'Private Group access' do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe 'GET /groups/:path/group_members' do
describe 'GET /groups/:path/-/group_members' do
subject { group_group_members_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -83,7 +83,7 @@ describe 'Private Group access' do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe 'GET /groups/:path/edit' do
describe 'GET /groups/:path/-/edit' do
subject { edit_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ describe 'Public Group access' do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe 'GET /groups/:path/issues' do
describe 'GET /groups/:path/-/issues' do
subject { issues_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -51,7 +51,7 @@ describe 'Public Group access' do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe 'GET /groups/:path/merge_requests' do
describe 'GET /groups/:path/-/merge_requests' do
let(:project) { create(:project, :public, :repository, group: group) }
 
subject { merge_requests_group_path(group) }
Loading
Loading
@@ -68,7 +68,7 @@ describe 'Public Group access' do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe 'GET /groups/:path/group_members' do
describe 'GET /groups/:path/-/group_members' do
subject { group_group_members_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -83,7 +83,7 @@ describe 'Public Group access' do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe 'GET /groups/:path/edit' do
describe 'GET /groups/:path/-/edit' do
subject { edit_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/tree/master" do
describe "GET /:project_path/-/tree/master" do
subject { project_tree_path(project, project.repository.root_ref) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -43,7 +43,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/commits/master" do
describe "GET /:project_path/-/commits/master" do
subject { project_commits_path(project, project.repository.root_ref, limit: 1) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -57,7 +57,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/commit/:sha" do
describe "GET /:project_path/-/commit/:sha" do
subject { project_commit_path(project, project.repository.commit) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -71,7 +71,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/compare" do
describe "GET /:project_path/-/compare" do
subject { project_compare_index_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -127,7 +127,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:external) }
end
 
describe "GET /:project_path/blob" do
describe "GET /:project_path/-/blob" do
let(:commit) { project.repository.commit }
 
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
Loading
Loading
@@ -229,7 +229,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/merge_requests" do
describe "GET /:project_path/-/merge_requests" do
subject { project_merge_requests_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -243,7 +243,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/merge_requests/new" do
describe "GET /:project_path/-/merge_requests/new" do
subject { project_new_merge_request_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -257,7 +257,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/branches" do
describe "GET /:project_path/-/branches" do
subject { project_branches_path(project) }
 
before do
Loading
Loading
@@ -278,7 +278,7 @@ describe "Internal Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/tags" do
describe "GET /:project_path/-/tags" do
subject { project_tags_path(project) }
 
before do
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/tree/master" do
describe "GET /:project_path/-/tree/master" do
subject { project_tree_path(project, project.repository.root_ref) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -43,7 +43,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/commits/master" do
describe "GET /:project_path/-/commits/master" do
subject { project_commits_path(project, project.repository.root_ref, limit: 1) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -57,7 +57,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/commit/:sha" do
describe "GET /:project_path/-/commit/:sha" do
subject { project_commit_path(project, project.repository.commit) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -71,7 +71,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/compare" do
describe "GET /:project_path/-/compare" do
subject { project_compare_index_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -127,7 +127,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/blob" do
describe "GET /:project_path/-/blob" do
let(:commit) { project.repository.commit }
 
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
Loading
Loading
@@ -215,7 +215,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/merge_requests" do
describe "GET /:project_path/-/merge_requests" do
subject { project_merge_requests_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -229,7 +229,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/branches" do
describe "GET /:project_path/-/branches" do
subject { project_branches_path(project) }
 
before do
Loading
Loading
@@ -250,7 +250,7 @@ describe "Private Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/tags" do
describe "GET /:project_path/-/tags" do
subject { project_tags_path(project) }
 
before do
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/tree/master" do
describe "GET /:project_path/-/tree/master" do
subject { project_tree_path(project, project.repository.root_ref) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -43,7 +43,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/commits/master" do
describe "GET /:project_path/-/commits/master" do
subject { project_commits_path(project, project.repository.root_ref, limit: 1) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -57,7 +57,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/commit/:sha" do
describe "GET /:project_path/-/commit/:sha" do
subject { project_commit_path(project, project.repository.commit) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -71,7 +71,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/compare" do
describe "GET /:project_path/-/compare" do
subject { project_compare_index_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -345,7 +345,7 @@ describe "Public Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/blob" do
describe "GET /:project_path/-/blob" do
let(:commit) { project.repository.commit }
 
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
Loading
Loading
@@ -446,7 +446,7 @@ describe "Public Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/merge_requests" do
describe "GET /:project_path/-/merge_requests" do
subject { project_merge_requests_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -460,7 +460,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/merge_requests/new" do
describe "GET /:project_path/-/merge_requests/new" do
subject { project_new_merge_request_path(project) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -474,7 +474,7 @@ describe "Public Project Access" do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/branches" do
describe "GET /:project_path/-/branches" do
subject { project_branches_path(project) }
 
before do
Loading
Loading
@@ -495,7 +495,7 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/tags" do
describe "GET /:project_path/-/tags" do
subject { project_tags_path(project) }
 
before do
Loading
Loading
Loading
Loading
@@ -91,16 +91,37 @@ describe('Monitoring mutations', () => {
expect(stateCopy.projectPath).toEqual('/gitlab-org/gitlab-foss');
});
 
it('should not remove default value of logsPath', () => {
it('should not remove previously set properties', () => {
const defaultLogsPath = stateCopy.logsPath;
 
mutations[types.SET_ENDPOINTS](stateCopy, {
logsPath: defaultLogsPath,
});
mutations[types.SET_ENDPOINTS](stateCopy, {
dashboardEndpoint: 'dashboard.json',
});
mutations[types.SET_ENDPOINTS](stateCopy, {
projectPath: '/gitlab-org/gitlab-foss',
});
 
expect(stateCopy.logsPath).toBe(defaultLogsPath);
expect(stateCopy).toMatchObject({
logsPath: defaultLogsPath,
dashboardEndpoint: 'dashboard.json',
projectPath: '/gitlab-org/gitlab-foss',
});
});
it('should not update unknown properties', () => {
mutations[types.SET_ENDPOINTS](stateCopy, {
dashboardEndpoint: 'dashboard.json',
someOtherProperty: 'some invalid value', // someOtherProperty is not allowed
});
expect(stateCopy.dashboardEndpoint).toBe('dashboard.json');
expect(stateCopy.someOtherProperty).toBeUndefined();
});
});
describe('Individual panel/metric results', () => {
const metricId = '12_system_metrics_kubernetes_container_memory_total';
const result = [
Loading
Loading
import Vuex from 'vuex';
import { mount } from '@vue/test-utils';
import ReleaseDetailApp from '~/releases/detail/components/app.vue';
import { release } from '../../mock_data';
import ReleaseEditApp from '~/releases/components/app_edit.vue';
import { release } from '../mock_data';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
 
describe('Release detail component', () => {
describe('Release edit component', () => {
let wrapper;
let releaseClone;
let actions;
Loading
Loading
@@ -27,9 +27,17 @@ describe('Release detail component', () => {
navigateToReleasesPage: jest.fn(),
};
 
const store = new Vuex.Store({ actions, state });
const store = new Vuex.Store({
modules: {
detail: {
namespaced: true,
actions,
state,
},
},
});
 
wrapper = mount(ReleaseDetailApp, {
wrapper = mount(ReleaseEditApp, {
store,
});
 
Loading
Loading
Loading
Loading
@@ -2,8 +2,8 @@ import { mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import { truncateSha } from '~/lib/utils/text_utility';
import Icon from '~/vue_shared/components/icon.vue';
import { release } from '../../mock_data';
import EvidenceBlock from '~/releases/list/components/evidence_block.vue';
import { release } from '../mock_data';
import EvidenceBlock from '~/releases/components/evidence_block.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
 
describe('Evidence Block', () => {
Loading
Loading
import { mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import { trimText } from 'helpers/text_helper';
import ReleaseBlockFooter from '~/releases/list/components/release_block_footer.vue';
import ReleaseBlockFooter from '~/releases/components/release_block_footer.vue';
import Icon from '~/vue_shared/components/icon.vue';
import { release } from '../../mock_data';
import { release } from '../mock_data';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
 
jest.mock('~/vue_shared/mixins/timeago', () => ({
Loading
Loading
import { shallowMount } from '@vue/test-utils';
import { cloneDeep, merge } from 'lodash';
import { GlLink } from '@gitlab/ui';
import ReleaseBlockHeader from '~/releases/list/components/release_block_header.vue';
import ReleaseBlockHeader from '~/releases/components/release_block_header.vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { release as originalRelease } from '../../mock_data';
import { release as originalRelease } from '../mock_data';
 
describe('Release block header', () => {
let wrapper;
Loading
Loading
import { mount } from '@vue/test-utils';
import { GlProgressBar, GlLink, GlBadge, GlButton } from '@gitlab/ui';
import { trimText } from 'helpers/text_helper';
import ReleaseBlockMilestoneInfo from '~/releases/list/components/release_block_milestone_info.vue';
import { milestones } from '../../mock_data';
import { MAX_MILESTONES_TO_DISPLAY } from '~/releases/list/constants';
import ReleaseBlockMilestoneInfo from '~/releases/components/release_block_milestone_info.vue';
import { milestones } from '../mock_data';
import { MAX_MILESTONES_TO_DISPLAY } from '~/releases/constants';
 
describe('Release block milestone info', () => {
let wrapper;
Loading
Loading
import $ from 'jquery';
import { mount } from '@vue/test-utils';
import { first } from 'underscore';
import EvidenceBlock from '~/releases/list/components/evidence_block.vue';
import ReleaseBlock from '~/releases/list/components/release_block.vue';
import ReleaseBlockFooter from '~/releases/list/components/release_block_footer.vue';
import EvidenceBlock from '~/releases/components/evidence_block.vue';
import ReleaseBlock from '~/releases/components/release_block.vue';
import ReleaseBlockFooter from '~/releases/components/release_block_footer.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago';
import { release } from '../../mock_data';
import { release } from '../mock_data';
import Icon from '~/vue_shared/components/icon.vue';
import { scrollToElement } from '~/lib/utils/common_utils';
 
Loading
Loading
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import * as actions from '~/releases/detail/store/actions';
import * as types from '~/releases/detail/store/mutation_types';
import { release } from '../../mock_data';
import state from '~/releases/detail/store/state';
import * as actions from '~/releases/stores/modules/detail/actions';
import * as types from '~/releases/stores/modules/detail/mutation_types';
import { release } from '../../../mock_data';
import state from '~/releases/stores/modules/detail/state';
import createFlash from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
Loading
Loading
Loading
Loading
@@ -5,10 +5,10 @@
* is resolved
*/
 
import state from '~/releases/detail/store/state';
import mutations from '~/releases/detail/store/mutations';
import * as types from '~/releases/detail/store/mutation_types';
import { release } from '../../mock_data';
import state from '~/releases/stores/modules/detail/state';
import mutations from '~/releases/stores/modules/detail/mutations';
import * as types from '~/releases/stores/modules/detail/mutation_types';
import { release } from '../../../mock_data';
 
describe('Release detail mutations', () => {
let stateClone;
Loading
Loading
import _ from 'underscore';
import Vue from 'vue';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import app from '~/releases/list/components/app.vue';
import createStore from '~/releases/list/store';
import app from '~/releases/components/app_index.vue';
import createStore from '~/releases/stores';
import listModule from '~/releases/stores/modules/list';
import api from '~/api';
import { resetStore } from '../store/helpers';
import { resetStore } from '../stores/modules/list/helpers';
import {
pageInfoHeadersWithoutPagination,
pageInfoHeadersWithPagination,
release,
releases,
} from '../../mock_data';
} from '../mock_data';
 
describe('Releases App ', () => {
const Component = Vue.extend(app);
Loading
Loading
@@ -25,7 +26,7 @@ describe('Releases App ', () => {
};
 
beforeEach(() => {
store = createStore();
store = createStore({ list: listModule });
releasesPagination = _.range(21).map(index => ({ ...release, tag_name: `${index}.00` }));
});
 
Loading
Loading
Loading
Loading
@@ -4,12 +4,12 @@ import {
fetchReleases,
receiveReleasesSuccess,
receiveReleasesError,
} from '~/releases/list/store/actions';
import state from '~/releases/list/store/state';
import * as types from '~/releases/list/store/mutation_types';
} from '~/releases/stores/modules/list/actions';
import state from '~/releases/stores/modules/list/state';
import * as types from '~/releases/stores/modules/list/mutation_types';
import api from '~/api';
import { parseIntPagination } from '~/lib/utils/common_utils';
import { pageInfoHeadersWithoutPagination, releases } from '../../mock_data';
import { pageInfoHeadersWithoutPagination, releases } from '../../../mock_data';
 
describe('Releases State actions', () => {
let mockedState;
Loading
Loading
import state from '~/releases/list/store/state';
import state from '~/releases/stores/modules/list/state';
 
// eslint-disable-next-line import/prefer-default-export
export const resetStore = store => {
Loading
Loading
import state from '~/releases/list/store/state';
import mutations from '~/releases/list/store/mutations';
import * as types from '~/releases/list/store/mutation_types';
import state from '~/releases/stores/modules/list/state';
import mutations from '~/releases/stores/modules/list/mutations';
import * as types from '~/releases/stores/modules/list/mutation_types';
import { parseIntPagination } from '~/lib/utils/common_utils';
import { pageInfoHeadersWithoutPagination, releases } from '../../mock_data';
import { pageInfoHeadersWithoutPagination, releases } from '../../../mock_data';
 
describe('Releases Store Mutations', () => {
let stateCopy;
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::BackgroundMigration::LinkLfsObjects, :migration, schema: 2020_02_10_062432 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:fork_networks) { table(:fork_networks) }
let(:fork_network_members) { table(:fork_network_members) }
let(:lfs_objects) { table(:lfs_objects) }
let(:lfs_objects_projects) { table(:lfs_objects_projects) }
let(:namespace) { namespaces.create(name: 'GitLab', path: 'gitlab') }
let(:source_project) { projects.create(namespace_id: namespace.id) }
let(:another_source_project) { projects.create(namespace_id: namespace.id) }
let(:project) { projects.create(namespace_id: namespace.id) }
let(:another_project) { projects.create(namespace_id: namespace.id) }
let(:other_project) { projects.create(namespace_id: namespace.id) }
let(:linked_project) { projects.create(namespace_id: namespace.id) }
let(:fork_network) { fork_networks.create(root_project_id: source_project.id) }
let(:another_fork_network) { fork_networks.create(root_project_id: another_source_project.id) }
let(:lfs_object) { lfs_objects.create(oid: 'abc123', size: 100) }
let(:another_lfs_object) { lfs_objects.create(oid: 'def456', size: 200) }
before do
# Create links between projects
fork_network_members.create(fork_network_id: fork_network.id, project_id: source_project.id, forked_from_project_id: nil)
[project, another_project, linked_project].each do |p|
fork_network_members.create(
fork_network_id: fork_network.id,
project_id: p.id,
forked_from_project_id: fork_network.root_project_id
)
end
fork_network_members.create(fork_network_id: another_fork_network.id, project_id: another_source_project.id, forked_from_project_id: nil)
fork_network_members.create(fork_network_id: another_fork_network.id, project_id: other_project.id, forked_from_project_id: another_fork_network.root_project_id)
# Links LFS objects to some projects
[source_project, another_source_project, linked_project].each do |p|
lfs_objects_projects.create(lfs_object_id: lfs_object.id, project_id: p.id)
lfs_objects_projects.create(lfs_object_id: another_lfs_object.id, project_id: p.id)
end
end
it 'creates LfsObjectsProject records for forks within the specified range of project IDs' do
expect { subject.perform(project.id, other_project.id) }.to change { lfs_objects_projects.count }.by(6)
expect(lfs_object_ids_for(project)).to match_array(lfs_object_ids_for(source_project))
expect(lfs_object_ids_for(another_project)).to match_array(lfs_object_ids_for(source_project))
expect(lfs_object_ids_for(other_project)).to match_array(lfs_object_ids_for(another_source_project))
expect { subject.perform(project.id, other_project.id) }.not_to change { lfs_objects_projects.count }
end
context 'when it is not necessary to create LfsObjectProject records' do
it 'does not create LfsObjectProject records' do
expect { subject.perform(linked_project.id, linked_project.id) }
.not_to change { lfs_objects_projects.count }
end
end
def lfs_object_ids_for(project)
lfs_objects_projects.where(project_id: project.id).pluck(:lfs_object_id)
end
end
Loading
Loading
@@ -26,6 +26,16 @@ describe Gitlab::ImportExport::GroupObjectBuilder do
 
expect(label.persisted?).to be true
end
context 'when description is an empty string' do
let(:label_attributes) { base_attributes.merge('type' => 'GroupLabel', 'description' => '') }
it 'finds the existing group label' do
group_label = create(:group_label, label_attributes)
expect(described_class.build(Label, label_attributes)).to eq(group_label)
end
end
end
 
context 'milestones' do
Loading
Loading
@@ -41,4 +51,16 @@ describe Gitlab::ImportExport::GroupObjectBuilder do
expect(milestone.persisted?).to be true
end
end
describe '#initialize' do
context 'when attributes contain description as empty string' do
let(:attributes) { base_attributes.merge('description' => '') }
it 'converts empty string to nil' do
builder = described_class.new(Label, attributes)
expect(builder.send(:attributes)).to include({ 'description' => nil })
end
end
end
end
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