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

Add latest changes from gitlab-org/gitlab@master

parent 46b10c0f
No related branches found
No related tags found
No related merge requests found
Showing
with 453 additions and 132 deletions
Loading
Loading
@@ -159,7 +159,7 @@ module Gitlab
def build_relation(relation_key, relation_definition, data_hash)
# TODO: This is hack to not create relation for the author
# Rather make `RelationFactory#set_note_author` to take care of that
return data_hash if relation_key == 'author'
return data_hash if relation_key == 'author' || already_restored?(data_hash)
 
# create relation objects recursively for all sub-objects
relation_definition.each do |sub_relation_key, sub_relation_definition|
Loading
Loading
@@ -169,6 +169,13 @@ module Gitlab
@relation_factory.create(relation_factory_params(relation_key, data_hash))
end
 
# Since we update the data hash in place as we restore relation items,
# and since we also de-duplicate items, we might encounter items that
# have already been restored in a previous iteration.
def already_restored?(relation_item)
!relation_item.is_a?(Hash)
end
def transform_sub_relations!(data_hash, sub_relation_key, sub_relation_definition)
sub_data_hash = data_hash[sub_relation_key]
return unless sub_data_hash
Loading
Loading
Loading
Loading
@@ -8450,6 +8450,9 @@ msgstr ""
msgid "For public projects, anyone can view pipelines and access job details (output logs and artifacts)"
msgstr ""
 
msgid "For renewal instructions %{link_start}view our Licensing FAQ.%{link_end}"
msgstr ""
msgid "Forgot your password?"
msgstr ""
 
Loading
Loading
# frozen_string_literal: true
 
FactoryBot.define do
factory :detailed_error_tracking_error, class: 'Gitlab::ErrorTracking::DetailedError' do
id { '1' }
title { 'title' }
type { 'error' }
user_count { 1 }
count { 2 }
first_seen { Time.now.iso8601 }
last_seen { Time.now.iso8601 }
message { 'message' }
culprit { 'culprit' }
external_url { 'http://example.com/id' }
factory :detailed_error_tracking_error, parent: :error_tracking_error, class: 'Gitlab::ErrorTracking::DetailedError' do
gitlab_issue { 'http://gitlab.example.com/issues/1' }
external_base_url { 'http://example.com' }
project_id { 'project1' }
project_name { 'project name' }
project_slug { 'project_name' }
short_id { 'ID' }
status { 'unresolved' }
first_release_last_commit { '68c914da9' }
last_release_last_commit { '9ad419c86' }
first_release_short_version { 'abc123' }
last_release_short_version { 'abc123' }
first_release_version { '12345678' }
tags do
{
level: 'error',
logger: 'rails'
}
end
frequency do
[
[Time.now.to_i, 10]
]
end
gitlab_issue { 'http://gitlab.example.com/issues/1' }
first_release_last_commit { '68c914da9' }
last_release_last_commit { '9ad419c86' }
first_release_short_version { 'abc123' }
last_release_short_version { 'abc123' }
first_release_version { '12345678' }
skip_create
end
end
Loading
Loading
@@ -2,13 +2,13 @@
 
FactoryBot.define do
factory :error_tracking_error, class: 'Gitlab::ErrorTracking::Error' do
id { 'id' }
id { '1' }
title { 'title' }
type { 'error' }
user_count { 1 }
count { 2 }
first_seen { Time.now }
last_seen { Time.now }
first_seen { Time.now.iso8601 }
last_seen { Time.now.iso8601 }
message { 'message' }
culprit { 'culprit' }
external_url { 'http://example.com/id' }
Loading
Loading
@@ -17,7 +17,11 @@ FactoryBot.define do
project_slug { 'project_name' }
short_id { 'ID' }
status { 'unresolved' }
frequency { [] }
frequency do
[
[Time.now.to_i, 10]
]
end
 
skip_create
end
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ describe 'issue move to another project' do
let(:new_project) { create(:project) }
let(:new_project_search) { create(:project) }
let(:text) { "Text with #{mr.to_reference}" }
let(:cross_reference) { old_project.to_reference(new_project) }
let(:cross_reference) { old_project.to_reference_base(new_project) }
 
before do
old_project.add_reporter(user)
Loading
Loading
{
"simple": 42,
"duped_hash_with_id": {
"id": 0,
"v1": 1
},
"duped_hash_no_id": {
"v1": 1
},
"duped_array": [
"v2"
],
"array": [
{
"duped_hash_with_id": {
"id": 0,
"v1": 1
}
},
{
"duped_array": [
"v2"
]
},
{
"duped_hash_no_id": {
"v1": 1
}
}
],
"nested": {
"duped_hash_with_id": {
"id": 0,
"v1": 1
},
"duped_array": [
"v2"
],
"array": [
"don't touch"
]
}
}
\ No newline at end of file
import { mount } from '@vue/test-utils';
import Tracking from '~/tracking';
import stubChildren from 'helpers/stub_children';
import component from '~/registry/settings/components/settings_form.vue';
import { createStore } from '~/registry/settings/store/';
Loading
Loading
@@ -15,6 +16,9 @@ describe('Settings Form', () => {
let dispatchSpy;
 
const FORM_ELEMENTS_ID_PREFIX = '#expiration-policy';
const trackingPayload = {
label: 'docker_container_retention_and_expiration_policies',
};
 
const GlLoadingIcon = { name: 'gl-loading-icon-stub', template: '<svg></svg>' };
 
Loading
Loading
@@ -48,6 +52,7 @@ describe('Settings Form', () => {
store.dispatch('setInitialState', stringifiedFormOptions);
dispatchSpy = jest.spyOn(store, 'dispatch');
mountComponent();
jest.spyOn(Tracking, 'event');
});
 
afterEach(() => {
Loading
Loading
@@ -118,15 +123,23 @@ describe('Settings Form', () => {
beforeEach(() => {
form = findForm();
});
it('cancel has type reset', () => {
expect(findCancelButton().attributes('type')).toBe('reset');
});
 
it('form reset event call the appropriate function', () => {
dispatchSpy.mockReturnValue();
form.trigger('reset');
// expect.any(Object) is necessary because the event payload is passed to the function
expect(dispatchSpy).toHaveBeenCalledWith('resetSettings', expect.any(Object));
describe('form cancel event', () => {
it('has type reset', () => {
expect(findCancelButton().attributes('type')).toBe('reset');
});
it('calls the appropriate function', () => {
dispatchSpy.mockReturnValue();
form.trigger('reset');
expect(dispatchSpy).toHaveBeenCalledWith('resetSettings');
});
it('tracks the reset event', () => {
dispatchSpy.mockReturnValue();
form.trigger('reset');
expect(Tracking.event).toHaveBeenCalledWith(undefined, 'reset_form', trackingPayload);
});
});
 
it('save has type submit', () => {
Loading
Loading
@@ -177,6 +190,12 @@ describe('Settings Form', () => {
expect(dispatchSpy).toHaveBeenCalledWith('saveSettings');
});
 
it('tracks the submit event', () => {
dispatchSpy.mockResolvedValue();
form.trigger('submit');
expect(Tracking.event).toHaveBeenCalledWith(undefined, 'submit_form', trackingPayload);
});
it('show a success toast when submit succeed', () => {
dispatchSpy.mockResolvedValue();
form.trigger('submit');
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Resolvers::ErrorTracking::SentryErrorCollectionResolver do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
let_it_be(:current_user) { create(:user) }
let(:list_issues_service) { spy('ErrorTracking::ListIssuesService') }
before do
project.add_developer(current_user)
allow(ErrorTracking::ListIssuesService)
.to receive(:new)
.and_return list_issues_service
end
describe '#resolve' do
it 'returns an error collection object' do
expect(resolve_error_collection).to be_a Gitlab::ErrorTracking::ErrorCollection
end
it 'provides the service url' do
fake_url = 'http://test.com'
expect(list_issues_service)
.to receive(:external_url)
.and_return(fake_url)
result = resolve_error_collection
expect(result.external_url).to eq fake_url
end
it 'provides the project' do
expect(resolve_error_collection.project).to eq project
end
end
private
def resolve_error_collection(context = { current_user: current_user })
resolve(described_class, obj: project, args: {}, ctx: context)
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Resolvers::ErrorTracking::SentryErrorsResolver do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
let_it_be(:current_user) { create(:user) }
let_it_be(:error_collection) { Gitlab::ErrorTracking::ErrorCollection.new(project: project) }
let(:list_issues_service) { spy('ErrorTracking::ListIssuesService') }
let(:issues) { nil }
let(:pagination) { nil }
describe '#resolve' do
context 'insufficient user permission' do
let(:user) { create(:user) }
it 'returns nil' do
context = { current_user: user }
expect(resolve_errors({}, context)).to eq nil
end
end
context 'user with permission' do
before do
project.add_developer(current_user)
allow(ErrorTracking::ListIssuesService)
.to receive(:new)
.and_return list_issues_service
end
context 'when after arg given' do
let(:after) { "1576029072000:0:0" }
it 'gives the cursor arg' do
expect(ErrorTracking::ListIssuesService)
.to receive(:new)
.with(project, current_user, { cursor: after })
.and_return list_issues_service
resolve_errors({ after: after })
end
end
context 'when no issues fetched' do
before do
allow(list_issues_service)
.to receive(:execute)
.and_return(
issues: nil
)
end
it 'returns nil' do
expect(resolve_errors).to eq nil
end
end
context 'when issues returned' do
let(:issues) { [:issue_1, :issue_2] }
let(:pagination) do
{
'next' => { 'cursor' => 'next' },
'previous' => { 'cursor' => 'prev' }
}
end
before do
allow(list_issues_service)
.to receive(:execute)
.and_return(
issues: issues,
pagination: pagination
)
end
it 'sets the issues' do
expect(resolve_errors).to contain_exactly(*issues)
end
it 'sets the pagination variables' do
result = resolve_errors
expect(result.next_cursor).to eq 'next'
expect(result.previous_cursor).to eq 'prev'
end
it 'returns an externally paginated array' do
expect(resolve_errors).to be_a Gitlab::Graphql::ExternallyPaginatedArray
end
end
end
end
private
def resolve_errors(args = {}, context = { current_user: current_user })
resolve(described_class, obj: error_collection, args: args, ctx: context)
end
end
# frozen_string_literal: true
require 'spec_helper'
describe GitlabSchema.types['SentryErrorCollection'] do
it { expect(described_class.graphql_name).to eq('SentryErrorCollection') }
it { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) }
it 'exposes the expected fields' do
expected_fields = %i[
errors
detailed_error
external_url
]
is_expected.to have_graphql_fields(*expected_fields)
end
describe 'errors field' do
subject { described_class.fields['errors'] }
it 'returns errors' do
aggregate_failures 'testing the correct types are returned' do
is_expected.to have_graphql_type(Types::ErrorTracking::SentryErrorType.connection_type)
is_expected.to have_graphql_extension(Gitlab::Graphql::Extensions::ExternallyPaginatedArrayExtension)
is_expected.to have_graphql_resolver(Resolvers::ErrorTracking::SentryErrorsResolver)
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe GitlabSchema.types['SentryError'] do
it { expect(described_class.graphql_name).to eq('SentryError') }
it 'exposes the expected fields' do
expected_fields = %i[
id
sentryId
title
type
userCount
count
firstSeen
lastSeen
message
culprit
externalUrl
sentryProjectId
sentryProjectName
sentryProjectSlug
shortId
status
frequency
]
is_expected.to have_graphql_fields(*expected_fields)
end
end
Loading
Loading
@@ -229,10 +229,10 @@ describe Banzai::Filter::CommitRangeReferenceFilter do
end
 
it 'ignores invalid commit IDs on the referenced project' do
exp = act = "Fixed #{project2.to_reference}@#{commit1.id.reverse}...#{commit2.id}"
exp = act = "Fixed #{project2.to_reference_base}@#{commit1.id.reverse}...#{commit2.id}"
expect(reference_filter(act).to_html).to eq exp
 
exp = act = "Fixed #{project2.to_reference}@#{commit1.id}...#{commit2.id.reverse}"
exp = act = "Fixed #{project2.to_reference_base}@#{commit1.id}...#{commit2.id.reverse}"
expect(reference_filter(act).to_html).to eq exp
end
end
Loading
Loading
Loading
Loading
@@ -369,7 +369,7 @@ describe Banzai::Filter::LabelReferenceFilter do
end
 
context 'with project reference' do
let(:reference) { "#{project.to_reference}#{group_label.to_reference(format: :name)}" }
let(:reference) { "#{project.to_reference_base}#{group_label.to_reference(format: :name)}" }
 
it 'links to a valid reference' do
doc = reference_filter("See #{reference}", project: project)
Loading
Loading
@@ -385,7 +385,7 @@ describe Banzai::Filter::LabelReferenceFilter do
end
 
it 'ignores invalid label names' do
exp = act = %(Label #{project.to_reference}#{Label.reference_prefix}"#{group_label.name.reverse}")
exp = act = %(Label #{project.to_reference_base}#{Label.reference_prefix}"#{group_label.name.reverse}")
 
expect(reference_filter(act).to_html).to eq exp
end
Loading
Loading
Loading
Loading
@@ -367,15 +367,17 @@ describe Banzai::Filter::MilestoneReferenceFilter do
expect(doc.css('a').first.text).to eq(urls.milestone_url(milestone))
end
 
it 'does not support cross-project references' do
it 'does not support cross-project references', :aggregate_failures do
another_group = create(:group)
another_project = create(:project, :public, group: group)
project_reference = another_project.to_reference(project)
project_reference = another_project.to_reference_base(project)
input_text = "See #{project_reference}#{reference}"
 
milestone.update!(group: another_group)
 
doc = reference_filter("See #{project_reference}#{reference}")
doc = reference_filter(input_text)
 
expect(input_text).to match(Milestone.reference_pattern)
expect(doc.css('a')).to be_empty
end
 
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ describe Banzai::Filter::ProjectReferenceFilter do
end
 
def get_reference(project)
project.to_reference_with_postfix
project.to_reference
end
 
let(:project) { create(:project, :public) }
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ describe Gitlab::Gfm::ReferenceRewriter do
let(:new_project) { create(:project, name: 'new-project', group: group) }
let(:user) { create(:user) }
 
let(:old_project_ref) { old_project.to_reference(new_project) }
let(:old_project_ref) { old_project.to_reference_base(new_project) }
let(:text) { 'some text' }
 
before do
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::ImportExport::ProjectTreeLoader do
let(:fixture) { 'spec/fixtures/lib/gitlab/import_export/with_duplicates.json' }
let(:project_tree) { JSON.parse(File.read(fixture)) }
context 'without de-duplicating entries' do
let(:parsed_tree) do
subject.load(fixture)
end
it 'parses the JSON into the expected tree' do
expect(parsed_tree).to eq(project_tree)
end
it 'does not de-duplicate entries' do
expect(parsed_tree['duped_hash_with_id']).not_to be(parsed_tree['array'][0]['duped_hash_with_id'])
end
end
context 'with de-duplicating entries' do
let(:parsed_tree) do
subject.load(fixture, dedup_entries: true)
end
it 'parses the JSON into the expected tree' do
expect(parsed_tree).to eq(project_tree)
end
it 'de-duplicates equal values' do
expect(parsed_tree['duped_hash_with_id']).to be(parsed_tree['array'][0]['duped_hash_with_id'])
expect(parsed_tree['duped_hash_with_id']).to be(parsed_tree['nested']['duped_hash_with_id'])
expect(parsed_tree['duped_array']).to be(parsed_tree['array'][1]['duped_array'])
expect(parsed_tree['duped_array']).to be(parsed_tree['nested']['duped_array'])
end
it 'does not de-duplicate hashes without IDs' do
expect(parsed_tree['duped_hash_no_id']).to eq(parsed_tree['array'][2]['duped_hash_no_id'])
expect(parsed_tree['duped_hash_no_id']).not_to be(parsed_tree['array'][2]['duped_hash_no_id'])
end
it 'keeps single entries intact' do
expect(parsed_tree['simple']).to eq(42)
expect(parsed_tree['nested']['array']).to eq(["don't touch"])
end
end
end
Loading
Loading
@@ -450,7 +450,9 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
context 'project.json file access check' do
let(:user) { create(:user) }
let!(:project) { create(:project, :builds_disabled, :issues_disabled, name: 'project', path: 'project') }
let(:project_tree_restorer) { described_class.new(user: user, shared: shared, project: project) }
let(:project_tree_restorer) do
described_class.new(user: user, shared: shared, project: project)
end
let(:restored_project_json) { project_tree_restorer.restore }
 
it 'does not read a symlink' do
Loading
Loading
@@ -725,7 +727,9 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:tree_hash) { { 'visibility_level' => visibility } }
let(:restorer) { described_class.new(user: user, shared: shared, project: project) }
let(:restorer) do
described_class.new(user: user, shared: shared, project: project)
end
 
before do
expect(restorer).to receive(:read_tree_hash) { tree_hash }
Loading
Loading
Loading
Loading
@@ -131,23 +131,19 @@ describe Project do
end
 
context 'when creating a new project' do
it 'automatically creates a CI/CD settings row' do
project = create(:project)
let_it_be(:project) { create(:project) }
 
it 'automatically creates a CI/CD settings row' do
expect(project.ci_cd_settings).to be_an_instance_of(ProjectCiCdSetting)
expect(project.ci_cd_settings).to be_persisted
end
 
it 'automatically creates a container expiration policy row' do
project = create(:project)
expect(project.container_expiration_policy).to be_an_instance_of(ContainerExpirationPolicy)
expect(project.container_expiration_policy).to be_persisted
end
 
it 'automatically creates a Pages metadata row' do
project = create(:project)
expect(project.pages_metadatum).to be_an_instance_of(ProjectPagesMetadatum)
expect(project.pages_metadatum).to be_persisted
end
Loading
Loading
@@ -532,111 +528,114 @@ describe Project do
it { is_expected.to delegate_method(:last_pipeline).to(:commit).with_arguments(allow_nil: true) }
end
 
describe '#to_reference_with_postfix' do
it 'returns the full path with reference_postfix' do
namespace = create(:namespace, path: 'sample-namespace')
project = create(:project, path: 'sample-project', namespace: namespace)
expect(project.to_reference_with_postfix).to eq 'sample-namespace/sample-project>'
end
end
describe 'reference methods' do
let_it_be(:owner) { create(:user, name: 'Gitlab') }
let_it_be(:namespace) { create(:namespace, name: 'Sample namespace', path: 'sample-namespace', owner: owner) }
let_it_be(:project) { create(:project, name: 'Sample project', path: 'sample-project', namespace: namespace) }
let_it_be(:group) { create(:group, name: 'Group', path: 'sample-group') }
let_it_be(:another_project) { create(:project, namespace: namespace) }
let_it_be(:another_namespace_project) { create(:project, name: 'another-project') }
 
describe '#to_reference' do
let(:owner) { create(:user, name: 'Gitlab') }
let(:namespace) { create(:namespace, path: 'sample-namespace', owner: owner) }
let(:project) { create(:project, path: 'sample-project', namespace: namespace) }
let(:group) { create(:group, name: 'Group', path: 'sample-group') }
describe '#to_reference' do
it 'returns the path with reference_postfix' do
expect(project.to_reference).to eq("#{project.full_path}>")
end
 
context 'when nil argument' do
it 'returns nil' do
expect(project.to_reference).to be_nil
it 'returns the path with reference_postfix when arg is self' do
expect(project.to_reference(project)).to eq("#{project.full_path}>")
end
end
 
context 'when full is true' do
it 'returns complete path to the project' do
expect(project.to_reference(full: true)).to eq 'sample-namespace/sample-project'
expect(project.to_reference(project, full: true)).to eq 'sample-namespace/sample-project'
expect(project.to_reference(group, full: true)).to eq 'sample-namespace/sample-project'
it 'returns the full_path with reference_postfix when full' do
expect(project.to_reference(full: true)).to eq("#{project.full_path}>")
end
end
 
context 'when same project argument' do
it 'returns nil' do
expect(project.to_reference(project)).to be_nil
it 'returns the full_path with reference_postfix when cross-project' do
expect(project.to_reference(build_stubbed(:project))).to eq("#{project.full_path}>")
end
end
 
context 'when cross namespace project argument' do
let(:another_namespace_project) { create(:project, name: 'another-project') }
it 'returns complete path to the project' do
expect(project.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project'
describe '#to_reference_base' do
context 'when nil argument' do
it 'returns nil' do
expect(project.to_reference_base).to be_nil
end
end
end
 
context 'when same namespace / cross-project argument' do
let(:another_project) { create(:project, namespace: namespace) }
context 'when full is true' do
it 'returns complete path to the project', :aggregate_failures do
be_full_path = eq('sample-namespace/sample-project')
 
it 'returns path to the project' do
expect(project.to_reference(another_project)).to eq 'sample-project'
expect(project.to_reference_base(full: true)).to be_full_path
expect(project.to_reference_base(project, full: true)).to be_full_path
expect(project.to_reference_base(group, full: true)).to be_full_path
end
end
end
 
context 'when different namespace / cross-project argument' do
let(:another_namespace) { create(:namespace, path: 'another-namespace', owner: owner) }
let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) }
context 'when same project argument' do
it 'returns nil' do
expect(project.to_reference_base(project)).to be_nil
end
end
 
it 'returns full path to the project' do
expect(project.to_reference(another_project)).to eq 'sample-namespace/sample-project'
context 'when cross namespace project argument' do
it 'returns complete path to the project' do
expect(project.to_reference_base(another_namespace_project)).to eq 'sample-namespace/sample-project'
end
end
end
 
context 'when argument is a namespace' do
context 'with same project path' do
context 'when same namespace / cross-project argument' do
it 'returns path to the project' do
expect(project.to_reference(namespace)).to eq 'sample-project'
expect(project.to_reference_base(another_project)).to eq 'sample-project'
end
end
 
context 'with different project path' do
context 'when different namespace / cross-project argument with same owner' do
let(:another_namespace_same_owner) { create(:namespace, path: 'another-namespace', owner: owner) }
let(:another_project_same_owner) { create(:project, path: 'another-project', namespace: another_namespace_same_owner) }
it 'returns full path to the project' do
expect(project.to_reference(group)).to eq 'sample-namespace/sample-project'
expect(project.to_reference_base(another_project_same_owner)).to eq 'sample-namespace/sample-project'
end
end
end
end
 
describe '#to_human_reference' do
let(:owner) { create(:user, name: 'Gitlab') }
let(:namespace) { create(:namespace, name: 'Sample namespace', owner: owner) }
let(:project) { create(:project, name: 'Sample project', namespace: namespace) }
context 'when argument is a namespace' do
context 'with same project path' do
it 'returns path to the project' do
expect(project.to_reference_base(namespace)).to eq 'sample-project'
end
end
 
context 'when nil argument' do
it 'returns nil' do
expect(project.to_human_reference).to be_nil
context 'with different project path' do
it 'returns full path to the project' do
expect(project.to_reference_base(group)).to eq 'sample-namespace/sample-project'
end
end
end
end
 
context 'when same project argument' do
it 'returns nil' do
expect(project.to_human_reference(project)).to be_nil
describe '#to_human_reference' do
context 'when nil argument' do
it 'returns nil' do
expect(project.to_human_reference).to be_nil
end
end
end
context 'when cross namespace project argument' do
let(:another_namespace_project) { create(:project, name: 'another-project') }
 
it 'returns complete name with namespace of the project' do
expect(project.to_human_reference(another_namespace_project)).to eq 'Gitlab / Sample project'
context 'when same project argument' do
it 'returns nil' do
expect(project.to_human_reference(project)).to be_nil
end
end
end
 
context 'when same namespace / cross-project argument' do
let(:another_project) { create(:project, namespace: namespace) }
context 'when cross namespace project argument' do
it 'returns complete name with namespace of the project' do
expect(project.to_human_reference(another_namespace_project)).to eq 'Gitlab / Sample project'
end
end
 
it 'returns name of the project' do
expect(project.to_human_reference(another_project)).to eq 'Sample project'
context 'when same namespace / cross-project argument' do
it 'returns name of the project' do
expect(project.to_human_reference(another_project)).to eq 'Sample project'
end
end
end
end
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe SentryDetailedErrorPresenter do
describe SentryErrorPresenter do
let(:error) { build(:detailed_error_tracking_error) }
let(:presenter) { described_class.new(error) }
 
Loading
Loading
@@ -10,7 +10,7 @@ describe SentryDetailedErrorPresenter do
subject { presenter.frequency }
 
it 'returns an array of frequency structs' do
expect(subject).to include(a_kind_of(SentryDetailedErrorPresenter::FrequencyStruct))
expect(subject).to include(a_kind_of(SentryErrorPresenter::FrequencyStruct))
end
 
it 'converts the times into UTC time objects' 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