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

Add latest changes from gitlab-org/gitlab@master

parent cd4cb29b
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
 
module QA
context 'Manage', :orchestrated, :smtp do
describe 'mail notification' do
context 'Plan', :orchestrated, :smtp do
describe 'Email Notification' do
let(:user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end
Loading
Loading
@@ -17,7 +17,7 @@ module QA
Flow::Login.sign_in
end
 
it 'user receives email for project invitation' do
it 'is received by a user for project invitation' do
Flow::Project.add_member(project: project, username: user.username)
 
expect(page).to have_content(/@#{user.username}(\n| )?Given access/)
Loading
Loading
# frozen_string_literal: true
FactoryBot.define do
factory :oauth_openid_request, class: 'Doorkeeper::OpenidConnect::Request' do
access_grant factory: :oauth_access_grant
sequence(:nonce) { |n| n.to_s }
end
end
Loading
Loading
@@ -34,6 +34,7 @@ describe Gitlab::DataBuilder::Pipeline do
expect(build_data).to be_a(Hash)
expect(build_data[:id]).to eq(build.id)
expect(build_data[:status]).to eq(build.status)
expect(build_data[:allow_failure]).to eq(build.allow_failure)
expect(project_data).to eq(project.hook_attrs(backward: false))
expect(data[:merge_request]).to be_nil
end
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GrafanaEmbedUsageData do
describe '#issue_count' do
subject { described_class.issue_count }
let(:project) { create(:project) }
let(:description_with_embed) { "Some comment\n\nhttps://grafana.example.com/d/xvAk4q0Wk/go-processes?orgId=1&from=1573238522762&to=1573240322762&var-job=prometheus&var-interval=10m&panelId=1&fullscreen" }
let(:description_with_unintegrated_embed) { "Some comment\n\nhttps://grafana.exp.com/d/xvAk4q0Wk/go-processes?orgId=1&from=1573238522762&to=1573240322762&var-job=prometheus&var-interval=10m&panelId=1&fullscreen" }
let(:description_with_non_grafana_inline_metric) { "Some comment\n\n#{Gitlab::Routing.url_helpers.metrics_namespace_project_environment_url(*['foo', 'bar', 12])}" }
shared_examples "zero count" do
it "does not count the issue" do
expect(subject).to eq(0)
end
end
context 'with project grafana integration enabled' do
before do
create(:grafana_integration, project: project, enabled: true)
end
context 'with valid and invalid embeds' do
before do
# Valid
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project, description: description_with_embed)
# In-Valid
create(:issue, project: project, description: description_with_unintegrated_embed)
create(:issue, project: project, description: description_with_non_grafana_inline_metric)
create(:issue, project: project, description: nil)
create(:issue, project: project, description: '')
create(:issue, project: project)
end
it 'counts only the issues with embeds' do
expect(subject).to eq(2)
end
end
end
context 'with project grafana integration disabled' do
before do
create(:grafana_integration, project: project, enabled: false)
end
context 'with one issue having a grafana link in the description and one without' do
before do
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project)
end
it_behaves_like('zero count')
end
end
context 'with an un-integrated project' do
context 'with one issue having a grafana link in the description and one without' do
before do
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project)
end
it_behaves_like('zero count')
end
end
end
end
Loading
Loading
@@ -53,6 +53,8 @@ describe Gitlab::UsageData do
create(:grafana_integration, project: projects[1], enabled: true)
create(:grafana_integration, project: projects[2], enabled: false)
 
allow(Gitlab::GrafanaEmbedUsageData).to receive(:issue_count).and_return(2)
ProjectFeature.first.update_attribute('repository_access_level', 0)
end
 
Loading
Loading
@@ -152,6 +154,7 @@ describe Gitlab::UsageData do
issues
issues_with_associated_zoom_link
issues_using_zoom_quick_actions
issues_with_embedded_grafana_charts_approx
keys
label_lists
labels
Loading
Loading
@@ -211,6 +214,7 @@ describe Gitlab::UsageData do
expect(count_data[:projects_with_error_tracking_enabled]).to eq(1)
expect(count_data[:issues_with_associated_zoom_link]).to eq(2)
expect(count_data[:issues_using_zoom_quick_actions]).to eq(3)
expect(count_data[:issues_with_embedded_grafana_charts_approx]).to eq(2)
 
expect(count_data[:clusters_enabled]).to eq(4)
expect(count_data[:project_clusters_enabled]).to eq(3)
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe OauthAccessGrant do
let(:user) { create(:user) }
let(:application) { create(:oauth_application, owner: user) }
describe '#delete' do
it 'cascades to oauth_openid_requests' do
access_grant = create(:oauth_access_grant, application: application)
create(:oauth_openid_request, access_grant: access_grant)
expect { access_grant.delete }.to change(Doorkeeper::OpenidConnect::Request, :count).by(-1)
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