Commit 391b1efc authored by James Fargher's avatar James Fargher

Automatically fixed EmptyLineAfterFinalLet in model and controller specs

Ran: bundle exec rubocop --only RSpec/EmptyLineAfterFinalLet -a \
       spec/models/ spec/controllers/
parent be09ae21
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Admin::UsersController do describe Admin::UsersController do
let(:user) { create(:user) } let(:user) { create(:user) }
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
before do before do
......
...@@ -12,6 +12,7 @@ describe ContinueParams do ...@@ -12,6 +12,7 @@ describe ContinueParams do
end end
end end
end end
subject(:controller) { controller_class.new } subject(:controller) { controller_class.new }
def strong_continue_params(params) def strong_continue_params(params)
......
...@@ -12,6 +12,7 @@ describe InternalRedirect do ...@@ -12,6 +12,7 @@ describe InternalRedirect do
end end
end end
end end
subject(:controller) { controller_class.new } subject(:controller) { controller_class.new }
describe '#safe_redirect_path' do describe '#safe_redirect_path' do
......
...@@ -35,6 +35,7 @@ describe Projects::BranchesController do ...@@ -35,6 +35,7 @@ describe Projects::BranchesController do
context "valid branch name, valid source" do context "valid branch name, valid source" do
let(:branch) { "merge_branch" } let(:branch) { "merge_branch" }
let(:ref) { "master" } let(:ref) { "master" }
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/merge_branch") .to redirect_to("/#{project.full_path}/tree/merge_branch")
...@@ -44,6 +45,7 @@ describe Projects::BranchesController do ...@@ -44,6 +45,7 @@ describe Projects::BranchesController do
context "invalid branch name, valid ref" do context "invalid branch name, valid ref" do
let(:branch) { "<script>alert('merge');</script>" } let(:branch) { "<script>alert('merge');</script>" }
let(:ref) { "master" } let(:ref) { "master" }
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/alert('merge');") .to redirect_to("/#{project.full_path}/tree/alert('merge');")
...@@ -53,18 +55,21 @@ describe Projects::BranchesController do ...@@ -53,18 +55,21 @@ describe Projects::BranchesController do
context "valid branch name, invalid ref" do context "valid branch name, invalid ref" do
let(:branch) { "merge_branch" } let(:branch) { "merge_branch" }
let(:ref) { "<script>alert('ref');</script>" } let(:ref) { "<script>alert('ref');</script>" }
it { is_expected.to render_template('new') } it { is_expected.to render_template('new') }
end end
context "invalid branch name, invalid ref" do context "invalid branch name, invalid ref" do
let(:branch) { "<script>alert('merge');</script>" } let(:branch) { "<script>alert('merge');</script>" }
let(:ref) { "<script>alert('ref');</script>" } let(:ref) { "<script>alert('ref');</script>" }
it { is_expected.to render_template('new') } it { is_expected.to render_template('new') }
end end
context "valid branch name with encoded slashes" do context "valid branch name with encoded slashes" do
let(:branch) { "feature%2Ftest" } let(:branch) { "feature%2Ftest" }
let(:ref) { "<script>alert('ref');</script>" } let(:ref) { "<script>alert('ref');</script>" }
it { is_expected.to render_template('new') } it { is_expected.to render_template('new') }
it { project.repository.branch_exists?('feature/test') } it { project.repository.branch_exists?('feature/test') }
end end
......
...@@ -26,6 +26,7 @@ describe Projects::ClustersController do ...@@ -26,6 +26,7 @@ describe Projects::ClustersController do
let(:project) { create(:project) } let(:project) { create(:project) }
let!(:enabled_cluster) { create(:cluster, :provided_by_gcp, projects: [project]) } let!(:enabled_cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
let!(:disabled_cluster) { create(:cluster, :disabled, :provided_by_gcp, :production_environment, projects: [project]) } let!(:disabled_cluster) { create(:cluster, :disabled, :provided_by_gcp, :production_environment, projects: [project]) }
it 'lists available clusters' do it 'lists available clusters' do
go go
......
...@@ -28,11 +28,13 @@ describe Projects::FindFileController do ...@@ -28,11 +28,13 @@ describe Projects::FindFileController do
context "valid branch" do context "valid branch" do
let(:id) { 'master' } let(:id) { 'master' }
it { is_expected.to respond_with(:success) } it { is_expected.to respond_with(:success) }
end end
context "invalid branch" do context "invalid branch" do
let(:id) { 'invalid-branch' } let(:id) { 'invalid-branch' }
it { is_expected.to respond_with(:not_found) } it { is_expected.to respond_with(:not_found) }
end end
end end
...@@ -50,6 +52,7 @@ describe Projects::FindFileController do ...@@ -50,6 +52,7 @@ describe Projects::FindFileController do
context "valid branch" do context "valid branch" do
let(:id) { 'master' } let(:id) { 'master' }
it 'returns an array of file path list' do it 'returns an array of file path list' do
go go
......
...@@ -1357,6 +1357,7 @@ describe Projects::IssuesController do ...@@ -1357,6 +1357,7 @@ describe Projects::IssuesController do
describe 'GET #discussions' do describe 'GET #discussions' do
let!(:discussion) { create(:discussion_note_on_issue, noteable: issue, project: issue.project) } let!(:discussion) { create(:discussion_note_on_issue, noteable: issue, project: issue.project) }
context 'when authenticated' do context 'when authenticated' do
before do before do
project.add_developer(user) project.add_developer(user)
......
...@@ -29,11 +29,13 @@ describe Projects::TagsController do ...@@ -29,11 +29,13 @@ describe Projects::TagsController do
context "valid tag" do context "valid tag" do
let(:id) { 'v1.0.0' } let(:id) { 'v1.0.0' }
it { is_expected.to respond_with(:success) } it { is_expected.to respond_with(:success) }
end end
context "invalid tag" do context "invalid tag" do
let(:id) { 'latest' } let(:id) { 'latest' }
it { is_expected.to respond_with(:not_found) } it { is_expected.to respond_with(:not_found) }
end end
end end
......
...@@ -213,6 +213,7 @@ describe Projects::WikisController do ...@@ -213,6 +213,7 @@ describe Projects::WikisController do
describe 'PATCH #update' do describe 'PATCH #update' do
let(:new_title) { 'New title' } let(:new_title) { 'New title' }
let(:new_content) { 'New content' } let(:new_content) { 'New content' }
subject do subject do
patch(:update, patch(:update,
params: { params: {
......
...@@ -81,6 +81,7 @@ describe UsersController do ...@@ -81,6 +81,7 @@ describe UsersController do
context 'json with events' do context 'json with events' do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
project.add_developer(user) project.add_developer(user)
Gitlab::DataBuilder::Push.build_sample(project, user) Gitlab::DataBuilder::Push.build_sample(project, user)
......
...@@ -7,6 +7,7 @@ describe BlobViewer::Changelog do ...@@ -7,6 +7,7 @@ describe BlobViewer::Changelog do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:blob) { fake_blob(path: 'CHANGELOG') } let(:blob) { fake_blob(path: 'CHANGELOG') }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#render_error' do describe '#render_error' do
......
...@@ -15,6 +15,7 @@ describe BlobViewer::ComposerJson do ...@@ -15,6 +15,7 @@ describe BlobViewer::ComposerJson do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'composer.json', data: data) } let(:blob) { fake_blob(path: 'composer.json', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_name' do describe '#package_name' do
......
...@@ -15,6 +15,7 @@ describe BlobViewer::Gemspec do ...@@ -15,6 +15,7 @@ describe BlobViewer::Gemspec do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'activerecord.gemspec', data: data) } let(:blob) { fake_blob(path: 'activerecord.gemspec', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_name' do describe '#package_name' do
......
...@@ -12,6 +12,7 @@ describe BlobViewer::GitlabCiYml do ...@@ -12,6 +12,7 @@ describe BlobViewer::GitlabCiYml do
let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) } let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) }
let(:sha) { sample_commit.id } let(:sha) { sample_commit.id }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#validation_message' do describe '#validation_message' do
......
...@@ -7,6 +7,7 @@ describe BlobViewer::License do ...@@ -7,6 +7,7 @@ describe BlobViewer::License do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:blob) { fake_blob(path: 'LICENSE') } let(:blob) { fake_blob(path: 'LICENSE') }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#license' do describe '#license' do
......
...@@ -15,6 +15,7 @@ describe BlobViewer::PackageJson do ...@@ -15,6 +15,7 @@ describe BlobViewer::PackageJson do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'package.json', data: data) } let(:blob) { fake_blob(path: 'package.json', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_name' do describe '#package_name' do
...@@ -54,6 +55,7 @@ describe BlobViewer::PackageJson do ...@@ -54,6 +55,7 @@ describe BlobViewer::PackageJson do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'package.json', data: data) } let(:blob) { fake_blob(path: 'package.json', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_url' do describe '#package_url' do
......
...@@ -15,6 +15,7 @@ describe BlobViewer::PodspecJson do ...@@ -15,6 +15,7 @@ describe BlobViewer::PodspecJson do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'AFNetworking.podspec.json', data: data) } let(:blob) { fake_blob(path: 'AFNetworking.podspec.json', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_name' do describe '#package_name' do
......
...@@ -15,6 +15,7 @@ describe BlobViewer::Podspec do ...@@ -15,6 +15,7 @@ describe BlobViewer::Podspec do
SPEC SPEC
end end
let(:blob) { fake_blob(path: 'Reachability.podspec', data: data) } let(:blob) { fake_blob(path: 'Reachability.podspec', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#package_name' do describe '#package_name' do
......
...@@ -7,6 +7,7 @@ describe BlobViewer::Readme do ...@@ -7,6 +7,7 @@ describe BlobViewer::Readme do
let(:project) { create(:project, :repository, :wiki_repo) } let(:project) { create(:project, :repository, :wiki_repo) }
let(:blob) { fake_blob(path: 'README.md') } let(:blob) { fake_blob(path: 'README.md') }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#render_error' do describe '#render_error' do
......
...@@ -14,6 +14,7 @@ describe BlobViewer::RouteMap do ...@@ -14,6 +14,7 @@ describe BlobViewer::RouteMap do
MAP MAP
end end
let(:blob) { fake_blob(path: '.gitlab/route-map.yml', data: data) } let(:blob) { fake_blob(path: '.gitlab/route-map.yml', data: data) }
subject { described_class.new(blob) } subject { described_class.new(blob) }
describe '#validation_message' do describe '#validation_message' do
......
...@@ -610,6 +610,7 @@ describe Ci::Build do ...@@ -610,6 +610,7 @@ describe Ci::Build do
context 'artifacts archive is a zip file and metadata exists' do context 'artifacts archive is a zip file and metadata exists' do
let(:build) { create(:ci_build, :artifacts) } let(:build) { create(:ci_build, :artifacts) }
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
end end
...@@ -1387,6 +1388,7 @@ describe Ci::Build do ...@@ -1387,6 +1388,7 @@ describe Ci::Build do
describe '#erased?' do describe '#erased?' do
let!(:build) { create(:ci_build, :trace_artifact, :success, :artifacts) } let!(:build) { create(:ci_build, :trace_artifact, :success, :artifacts) }
subject { build.erased? } subject { build.erased? }
context 'job has not been erased' do context 'job has not been erased' do
...@@ -1448,6 +1450,7 @@ describe Ci::Build do ...@@ -1448,6 +1450,7 @@ describe Ci::Build do
describe '#first_pending' do describe '#first_pending' do
let!(:first) { create(:ci_build, pipeline: pipeline, status: 'pending', created_at: Date.yesterday) } let!(:first) { create(:ci_build, pipeline: pipeline, status: 'pending', created_at: Date.yesterday) }
let!(:second) { create(:ci_build, pipeline: pipeline, status: 'pending') } let!(:second) { create(:ci_build, pipeline: pipeline, status: 'pending') }
subject { described_class.first_pending } subject { described_class.first_pending }
it { is_expected.to be_a(described_class) } it { is_expected.to be_a(described_class) }
......
...@@ -755,11 +755,13 @@ describe Ci::Runner do ...@@ -755,11 +755,13 @@ describe Ci::Runner do
context 'when group runner' do context 'when group runner' do
let(:runner) { create(:ci_runner, :group, description: 'Group runner', groups: [group]) } let(:runner) { create(:ci_runner, :group, description: 'Group runner', groups: [group]) }
let(:group) { create(:group) } let(:group) { create(:group) }
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end end
context 'when shared runner' do context 'when shared runner' do
let(:runner) { create(:ci_runner, :instance, description: 'Shared runner') } let(:runner) { create(:ci_runner, :instance, description: 'Shared runner') }
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end end
......
...@@ -146,6 +146,7 @@ describe Ci::Stage, :models do ...@@ -146,6 +146,7 @@ describe Ci::Stage, :models do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:stage) { create(:ci_stage_entity, status: :created) } let(:stage) { create(:ci_stage_entity, status: :created) }
subject { stage.detailed_status(user) } subject { stage.detailed_status(user) }
where(:statuses, :label) do where(:statuses, :label) do
......
...@@ -123,6 +123,7 @@ describe Clusters::Applications::ElasticStack do ...@@ -123,6 +123,7 @@ describe Clusters::Applications::ElasticStack do
context "cluster doesn't have kubeclient" do context "cluster doesn't have kubeclient" do
let(:cluster) { create(:cluster) } let(:cluster) { create(:cluster) }
subject { create(:clusters_applications_elastic_stack, cluster: cluster) } subject { create(:clusters_applications_elastic_stack, cluster: cluster) }
it 'returns nil' do it 'returns nil' do
......
...@@ -52,6 +52,7 @@ describe Clusters::Applications::Helm do ...@@ -52,6 +52,7 @@ describe Clusters::Applications::Helm do
describe '#issue_client_cert' do describe '#issue_client_cert' do
let(:application) { create(:clusters_applications_helm) } let(:application) { create(:clusters_applications_helm) }
subject { application.issue_client_cert } subject { application.issue_client_cert }
it 'returns a new cert' do it 'returns a new cert' do
......
...@@ -131,6 +131,7 @@ describe Clusters::Applications::Knative do ...@@ -131,6 +131,7 @@ describe Clusters::Applications::Knative do
describe '#update_command' do describe '#update_command' do
let!(:current_installed_version) { knative.version = '0.1.0' } let!(:current_installed_version) { knative.version = '0.1.0' }
subject { knative.update_command } subject { knative.update_command }
it 'is initialized with current version' do it 'is initialized with current version' do
......
...@@ -66,6 +66,7 @@ describe Clusters::Applications::Prometheus do ...@@ -66,6 +66,7 @@ describe Clusters::Applications::Prometheus do
context "cluster doesn't have kubeclient" do context "cluster doesn't have kubeclient" do
let(:cluster) { create(:cluster) } let(:cluster) { create(:cluster) }
subject { create(:clusters_applications_prometheus, cluster: cluster) } subject { create(:clusters_applications_prometheus, cluster: cluster) }
it 'returns nil' do it 'returns nil' do
......
...@@ -92,6 +92,7 @@ describe CacheMarkdownField, :clean_gitlab_redis_cache do ...@@ -92,6 +92,7 @@ describe CacheMarkdownField, :clean_gitlab_redis_cache do
describe '#latest_cached_markdown_version' do describe '#latest_cached_markdown_version' do
let(:thing) { klass.new } let(:thing) { klass.new }
subject { thing.latest_cached_markdown_version } subject { thing.latest_cached_markdown_version }
it 'returns default version' do it 'returns default version' do
...@@ -151,6 +152,7 @@ describe CacheMarkdownField, :clean_gitlab_redis_cache do ...@@ -151,6 +152,7 @@ describe CacheMarkdownField, :clean_gitlab_redis_cache do
describe '#banzai_render_context' do describe '#banzai_render_context' do
let(:thing) { klass.new(title: markdown, title_html: html, cached_markdown_version: cache_version) } let(:thing) { klass.new(title: markdown, title_html: html, cached_markdown_version: cache_version) }
subject(:context) { thing.banzai_render_context(:title) } subject(:context) { thing.banzai_render_context(:title) }
it 'sets project to nil if the object lacks a project' do it 'sets project to nil if the object lacks a project' do
......
...@@ -49,11 +49,13 @@ describe IgnorableColumns do ...@@ -49,11 +49,13 @@ describe IgnorableColumns do
context 'with single column' do context 'with single column' do
let(:columns) { :name } let(:columns) { :name }
it_behaves_like 'storing removal information' it_behaves_like 'storing removal information'
end end
context 'with array column' do context 'with array column' do
let(:columns) { %i[name created_at] } let(:columns) { %i[name created_at] }
it_behaves_like 'storing removal information' it_behaves_like 'storing removal information'
end end
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe LoadedInGroupList do describe LoadedInGroupList do
let(:parent) { create(:group) } let(:parent) { create(:group) }
subject(:found_group) { Group.with_selects_for_list.find_by(id: parent.id) } subject(:found_group) { Group.with_selects_for_list.find_by(id: parent.id) }
describe '.with_selects_for_list' do describe '.with_selects_for_list' do
......
...@@ -103,6 +103,7 @@ describe PrometheusAdapter, :use_clean_rails_memory_store_caching do ...@@ -103,6 +103,7 @@ describe PrometheusAdapter, :use_clean_rails_memory_store_caching do
describe '#calculate_reactive_cache' do describe '#calculate_reactive_cache' do
let(:environment) { create(:environment, slug: 'env-slug') } let(:environment) { create(:environment, slug: 'env-slug') }
before do before do
service.manual_configuration = true service.manual_configuration = true
service.active = true service.active = true
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Note, ResolvableNote do describe Note, ResolvableNote do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
subject { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) } subject { create(:discussion_note_on_merge_request, noteable: merge_request, project: project) }
context 'resolvability scopes' do context 'resolvability scopes' do
......
...@@ -13,6 +13,7 @@ end ...@@ -13,6 +13,7 @@ end
describe User, 'TokenAuthenticatable' do describe User, 'TokenAuthenticatable' do
let(:token_field) { :feed_token } let(:token_field) { :feed_token }
it_behaves_like 'TokenAuthenticatable' it_behaves_like 'TokenAuthenticatable'
describe 'ensures authentication token' do describe 'ensures authentication token' do
......
...@@ -8,6 +8,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -8,6 +8,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
include RepoHelpers include RepoHelpers
let(:project) { create(:project, :stubbed_repository) } let(:project) { create(:project, :stubbed_repository) }
subject(:environment) { create(:environment, project: project) } subject(:environment) { create(:environment, project: project) }
it { is_expected.to be_kind_of(ReactiveCaching) } it { is_expected.to be_kind_of(ReactiveCaching) }
...@@ -672,6 +673,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -672,6 +673,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
context 'with deployment' do context 'with deployment' do
let!(:deployment) { create(:deployment, :success, environment: environment) } let!(:deployment) { create(:deployment, :success, environment: environment) }
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
...@@ -828,6 +830,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -828,6 +830,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
context 'and a deployment' do context 'and a deployment' do
let!(:deployment) { create(:deployment, environment: environment) } let!(:deployment) { create(:deployment, environment: environment) }
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
...@@ -862,6 +865,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -862,6 +865,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
describe '#metrics' do describe '#metrics' do
let(:project) { create(:prometheus_project) } let(:project) { create(:prometheus_project) }
subject { environment.metrics } subject { environment.metrics }
context 'when the environment has metrics' do context 'when the environment has metrics' do
...@@ -943,6 +947,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -943,6 +947,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
describe '#additional_metrics' do describe '#additional_metrics' do
let(:project) { create(:prometheus_project) } let(:project) { create(:prometheus_project) }
let(:metric_params) { [] } let(:metric_params) { [] }
subject { environment.additional_metrics(*metric_params) } subject { environment.additional_metrics(*metric_params) }
context 'when the environment has additional metrics' do context 'when the environment has additional metrics' do
......
...@@ -33,6 +33,7 @@ describe ExternalIssue do ...@@ -33,6 +33,7 @@ describe ExternalIssue do
context 'if issue id is a number' do context 'if issue id is a number' do
let(:issue) { described_class.new('1234', project) } let(:issue) { described_class.new('1234', project) }
it 'returns the issue ID prefixed by #' do it 'returns the issue ID prefixed by #' do
expect(issue.reference_link_text).to eq '#1234' expect(issue.reference_link_text).to eq '#1234'
end end
......
...@@ -162,6 +162,7 @@ describe GlobalMilestone do ...@@ -162,6 +162,7 @@ describe GlobalMilestone do
describe '#initialize' do describe '#initialize' do
let(:milestone1_project1) { create(:milestone, title: "Milestone v1.2", project: project1) } let(:milestone1_project1) { create(:milestone, title: "Milestone v1.2", project: project1) }
subject(:global_milestone) { described_class.new(milestone1_project1) } subject(:global_milestone) { described_class.new(milestone1_project1) }
it 'has exactly one group milestone' do it 'has exactly one group milestone' do
......
...@@ -28,6 +28,7 @@ describe Group do ...@@ -28,6 +28,7 @@ describe Group do
describe '#members & #requesters' do describe '#members & #requesters' do
let(:requester) { create(:user) } let(:requester) { create(:user) }
let(:developer) { create(:user) } let(:developer) { create(:user) }
before do before do
group.request_access(requester) group.request_access(requester)
group.add_developer(developer) group.add_developer(developer)
......
...@@ -34,16 +34,19 @@ describe WebHookLog do ...@@ -34,16 +34,19 @@ describe WebHookLog do
describe '2xx' do describe '2xx' do
let(:status) { '200' } let(:status) { '200' }
it { expect(web_hook_log.success?).to be_truthy } it { expect(web_hook_log.success?).to be_truthy }
end end
describe 'not 2xx' do describe 'not 2xx' do
let(:status) { '500' } let(:status) { '500' }
it { expect(web_hook_log.success?).to be_falsey } it { expect(web_hook_log.success?).to be_falsey }
end end
describe 'internal erorr' do describe 'internal erorr' do
let(:status) { 'internal error' } let(:status) { 'internal error' }
it { expect(web_hook_log.success?).to be_falsey } it { expect(web_hook_log.success?).to be_falsey }
end end
end end
......
...@@ -48,6 +48,7 @@ describe InstanceConfiguration do ...@@ -48,6 +48,7 @@ describe InstanceConfiguration do
describe '#gitlab_pages' do describe '#gitlab_pages' do
let(:gitlab_pages) { subject.settings[:gitlab_pages] } let(:gitlab_pages) { subject.settings[:gitlab_pages] }
it 'returns Settings.pages' do it 'returns Settings.pages' do
gitlab_pages.delete(:ip_address) gitlab_pages.delete(:ip_address)
...@@ -73,6 +74,7 @@ describe InstanceConfiguration do ...@@ -73,6 +74,7 @@ describe InstanceConfiguration do
describe '#gitlab_ci' do describe '#gitlab_ci' do
let(:gitlab_ci) { subject.settings[:gitlab_ci] } let(:gitlab_ci) { subject.settings[:gitlab_ci] }
it 'returns Settings.gitalb_ci' do it 'returns Settings.gitalb_ci' do
gitlab_ci.delete(:artifacts_max_size) gitlab_ci.delete(:artifacts_max_size)
......
...@@ -170,6 +170,7 @@ describe InternalId do ...@@ -170,6 +170,7 @@ describe InternalId do
describe '.track_greatest' do describe '.track_greatest' do
let(:value) { 9001 } let(:value) { 9001 }
subject { described_class.track_greatest(issue, scope, usage, value, init) } subject { described_class.track_greatest(issue, scope, usage, value, init) }
context 'in the absence of a record' do context 'in the absence of a record' do
...@@ -210,6 +211,7 @@ describe InternalId do ...@@ -210,6 +211,7 @@ describe InternalId do
describe '#increment_and_save!' do describe '#increment_and_save!' do
let(:id) { create(:internal_id) } let(:id) { create(:internal_id) }
subject { id.increment_and_save! } subject { id.increment_and_save! }
it 'returns incremented iid' do it 'returns incremented iid' do
...@@ -236,6 +238,7 @@ describe InternalId do ...@@ -236,6 +238,7 @@ describe InternalId do
describe '#track_greatest_and_save!' do describe '#track_greatest_and_save!' do
let(:id) { create(:internal_id) } let(:id) { create(:internal_id) }
let(:new_last_value) { 9001 } let(:new_last_value) { 9001 }
subject { id.track_greatest_and_save!(new_last_value) } subject { id.track_greatest_and_save!(new_last_value) }
it 'returns new last value' do it 'returns new last value' do
......
...@@ -259,6 +259,7 @@ describe Issue do ...@@ -259,6 +259,7 @@ describe Issue do
describe '#can_move?' do describe '#can_move?' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
subject { issue.can_move?(user) } subject { issue.can_move?(user) }
context 'user is not a member of project issue belongs to' do context 'user is not a member of project issue belongs to' do
...@@ -277,6 +278,7 @@ describe Issue do ...@@ -277,6 +278,7 @@ describe Issue do
context 'issue not persisted' do context 'issue not persisted' do
let(:issue) { build(:issue, project: project) } let(:issue) { build(:issue, project: project) }
it { is_expected.to eq false } it { is_expected.to eq false }
end end
...@@ -306,6 +308,7 @@ describe Issue do ...@@ -306,6 +308,7 @@ describe Issue do
describe '#moved?' do describe '#moved?' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
subject { issue.moved? } subject { issue.moved? }
context 'issue not moved' do context 'issue not moved' do
...@@ -322,6 +325,7 @@ describe Issue do ...@@ -322,6 +325,7 @@ describe Issue do
describe '#duplicated?' do describe '#duplicated?' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
subject { issue.duplicated? } subject { issue.duplicated? }
context 'issue not duplicated' do context 'issue not duplicated' do
...@@ -380,6 +384,7 @@ describe Issue do ...@@ -380,6 +384,7 @@ describe Issue do
describe '#has_related_branch?' do describe '#has_related_branch?' do
let(:issue) { create(:issue, title: "Blue Bell Knoll") } let(:issue) { create(:issue, title: "Blue Bell Knoll") }
subject { issue.has_related_branch? } subject { issue.has_related_branch? }
context 'branch found' do context 'branch found' do
...@@ -442,6 +447,7 @@ describe Issue do ...@@ -442,6 +447,7 @@ describe Issue do
describe '#can_be_worked_on?' do describe '#can_be_worked_on?' do
let(:project) { build(:project) } let(:project) { build(:project) }
subject { build(:issue, :opened, project: project) } subject { build(:issue, :opened, project: project) }
context 'is closed' do context 'is closed' do
......
...@@ -25,6 +25,7 @@ describe Key, :mailer do ...@@ -25,6 +25,7 @@ describe Key, :mailer do
describe "Methods" do describe "Methods" do
let(:user) { create(:user) } let(:user) { create(:user) }
it { is_expected.to respond_to :projects } it { is_expected.to respond_to :projects }
it { is_expected.to respond_to :publishable_key } it { is_expected.to respond_to :publishable_key }
......
...@@ -110,6 +110,7 @@ describe MergeRequest do ...@@ -110,6 +110,7 @@ describe MergeRequest do
describe '#squash?' do describe '#squash?' do
let(:merge_request) { build(:merge_request, squash: squash) } let(:merge_request) { build(:merge_request, squash: squash) }
subject { merge_request.squash? } subject { merge_request.squash? }
context 'disabled in database' do context 'disabled in database' do
...@@ -851,6 +852,7 @@ describe MergeRequest do ...@@ -851,6 +852,7 @@ describe MergeRequest do
describe '#modified_paths' do describe '#modified_paths' do
let(:paths) { double(:paths) } let(:paths) { double(:paths) }
subject(:merge_request) { build(:merge_request) } subject(:merge_request) { build(:merge_request) }
before do before do
...@@ -879,6 +881,7 @@ describe MergeRequest do ...@@ -879,6 +881,7 @@ describe MergeRequest do
context 'when no arguments provided' do context 'when no arguments provided' do
let(:diff) { merge_request.merge_request_diff } let(:diff) { merge_request.merge_request_diff }
subject(:merge_request) { create(:merge_request, source_branch: 'feature', target_branch: 'master') } subject(:merge_request) { create(:merge_request, source_branch: 'feature', target_branch: 'master') }
it 'returns affected file paths for merge_request_diff' do it 'returns affected file paths for merge_request_diff' do
...@@ -1554,6 +1557,7 @@ describe MergeRequest do ...@@ -1554,6 +1557,7 @@ describe MergeRequest do
describe '#calculate_reactive_cache' do describe '#calculate_reactive_cache' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
subject { merge_request.calculate_reactive_cache(service_class_name) } subject { merge_request.calculate_reactive_cache(service_class_name) }
context 'when given an unknown service class name' do context 'when given an unknown service class name' do
...@@ -3032,6 +3036,7 @@ describe MergeRequest do ...@@ -3032,6 +3036,7 @@ describe MergeRequest do
describe 'transition to cannot_be_merged' do describe 'transition to cannot_be_merged' do
let(:notification_service) { double(:notification_service) } let(:notification_service) { double(:notification_service) }
let(:todo_service) { double(:todo_service) } let(:todo_service) { double(:todo_service) }
subject { create(:merge_request, state, merge_status: :unchecked) } subject { create(:merge_request, state, merge_status: :unchecked) }
before do before do
...@@ -3241,6 +3246,7 @@ describe MergeRequest do ...@@ -3241,6 +3246,7 @@ describe MergeRequest do
describe 'when merge_when_pipeline_succeeds? is true' do describe 'when merge_when_pipeline_succeeds? is true' do
describe 'when merge user is author' do describe 'when merge user is author' do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
create(:merge_request, create(:merge_request,
merge_when_pipeline_succeeds: true, merge_when_pipeline_succeeds: true,
...@@ -3255,6 +3261,7 @@ describe MergeRequest do ...@@ -3255,6 +3261,7 @@ describe MergeRequest do
describe 'when merge user and author are different users' do describe 'when merge user and author are different users' do
let(:merge_user) { create(:user) } let(:merge_user) { create(:user) }
subject do subject do
create(:merge_request, create(:merge_request,
merge_when_pipeline_succeeds: true, merge_when_pipeline_succeeds: true,
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe ProjectDeployToken, type: :model do RSpec.describe ProjectDeployToken, type: :model do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:deploy_token) { create(:deploy_token) } let(:deploy_token) { create(:deploy_token) }
subject(:project_deploy_token) { create(:project_deploy_token, project: project, deploy_token: deploy_token) } subject(:project_deploy_token) { create(:project_deploy_token, project: project, deploy_token: deploy_token) }
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
......
...@@ -38,6 +38,7 @@ describe MicrosoftTeamsService do ...@@ -38,6 +38,7 @@ describe MicrosoftTeamsService do
describe "#execute" do describe "#execute" do
let(:user) { create(:user) } let(:user) { create(:user) }
set(:project) { create(:project, :repository, :wiki_repo) } set(:project) { create(:project, :repository, :wiki_repo) }
before do before do
......
...@@ -165,6 +165,7 @@ describe Project do ...@@ -165,6 +165,7 @@ describe Project do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:requester) { create(:user) } let(:requester) { create(:user) }
let(:developer) { create(:user) } let(:developer) { create(:user) }
before do before do
project.request_access(requester) project.request_access(requester)
project.add_developer(developer) project.add_developer(developer)
...@@ -815,6 +816,7 @@ describe Project do ...@@ -815,6 +816,7 @@ describe Project do
context 'with external issues tracker' do context 'with external issues tracker' do
let!(:internal_issue) { create(:issue, project: project) } let!(:internal_issue) { create(:issue, project: project) }
before do before do
allow(project).to receive(:external_issue_tracker).and_return(true) allow(project).to receive(:external_issue_tracker).and_return(true)
end end
...@@ -2334,6 +2336,7 @@ describe Project do ...@@ -2334,6 +2336,7 @@ describe Project do
describe '#has_remote_mirror?' do describe '#has_remote_mirror?' do
let(:project) { create(:project, :remote_mirror, :import_started) } let(:project) { create(:project, :remote_mirror, :import_started) }
subject { project.has_remote_mirror? } subject { project.has_remote_mirror? }
before do before do
...@@ -2353,6 +2356,7 @@ describe Project do ...@@ -2353,6 +2356,7 @@ describe Project do
describe '#update_remote_mirrors' do describe '#update_remote_mirrors' do
let(:project) { create(:project, :remote_mirror, :import_started) } let(:project) { create(:project, :remote_mirror, :import_started) }
delegate :update_remote_mirrors, to: :project delegate :update_remote_mirrors, to: :project
before do before do
...@@ -3460,6 +3464,7 @@ describe Project do ...@@ -3460,6 +3464,7 @@ describe Project do
describe '#pipeline_status' do describe '#pipeline_status' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
it 'builds a pipeline status' do it 'builds a pipeline status' do
expect(project.pipeline_status).to be_a(Gitlab::Cache::Ci::ProjectPipelineStatus) expect(project.pipeline_status).to be_a(Gitlab::Cache::Ci::ProjectPipelineStatus)
end end
...@@ -4638,6 +4643,7 @@ describe Project do ...@@ -4638,6 +4643,7 @@ describe Project do
describe '#execute_hooks' do describe '#execute_hooks' do
let(:data) { { ref: 'refs/heads/master', data: 'data' } } let(:data) { { ref: 'refs/heads/master', data: 'data' } }
it 'executes active projects hooks with the specified scope' do it 'executes active projects hooks with the specified scope' do
hook = create(:project_hook, merge_requests_events: false, push_events: true) hook = create(:project_hook, merge_requests_events: false, push_events: true)
expect(ProjectHook).to receive(:select_active) expect(ProjectHook).to receive(:select_active)
...@@ -4968,6 +4974,7 @@ describe Project do ...@@ -4968,6 +4974,7 @@ describe Project do
context 'when there is a gitlab deploy token associated but is has been revoked' do context 'when there is a gitlab deploy token associated but is has been revoked' do
let!(:deploy_token) { create(:deploy_token, :gitlab_deploy_token, :revoked, projects: [project]) } let!(:deploy_token) { create(:deploy_token, :gitlab_deploy_token, :revoked, projects: [project]) }
it { is_expected.to be_nil } it { is_expected.to be_nil }
end end
...@@ -5011,6 +5018,7 @@ describe Project do ...@@ -5011,6 +5018,7 @@ describe Project do
context '#members_among' do context '#members_among' do
let(:users) { create_list(:user, 3) } let(:users) { create_list(:user, 3) }
set(:group) { create(:group) } set(:group) { create(:group) }
set(:project) { create(:project, namespace: group) } set(:project) { create(:project, namespace: group) }
......
...@@ -717,6 +717,7 @@ describe Repository do ...@@ -717,6 +717,7 @@ describe Repository do
describe "search_files_by_content" do describe "search_files_by_content" do
let(:results) { repository.search_files_by_content('feature', 'master') } let(:results) { repository.search_files_by_content('feature', 'master') }
subject { results } subject { results }
it { is_expected.to be_an Array } it { is_expected.to be_an Array }
......
...@@ -18,6 +18,7 @@ describe SentNotification do ...@@ -18,6 +18,7 @@ describe SentNotification do
context "when the project doesn't match the discussion project" do context "when the project doesn't match the discussion project" do
let(:discussion_id) { create(:note).discussion_id } let(:discussion_id) { create(:note).discussion_id }
subject { build(:sent_notification, in_reply_to_discussion_id: discussion_id) } subject { build(:sent_notification, in_reply_to_discussion_id: discussion_id) }
it "is invalid" do it "is invalid" do
...@@ -29,6 +30,7 @@ describe SentNotification do ...@@ -29,6 +30,7 @@ describe SentNotification do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:discussion_id) { create(:note, project: project, noteable: issue).discussion_id } let(:discussion_id) { create(:note, project: project, noteable: issue).discussion_id }
subject { build(:sent_notification, project: project, noteable: issue, in_reply_to_discussion_id: discussion_id) } subject { build(:sent_notification, project: project, noteable: issue, in_reply_to_discussion_id: discussion_id) }
it "is valid" do it "is valid" do
...@@ -196,6 +198,7 @@ describe SentNotification do ...@@ -196,6 +198,7 @@ describe SentNotification do
describe '#create_reply' do describe '#create_reply' do
context 'for issue' do context 'for issue' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
subject { described_class.record(issue, issue.author.id) } subject { described_class.record(issue, issue.author.id) }
it 'creates a comment on the issue' do it 'creates a comment on the issue' do
...@@ -206,6 +209,7 @@ describe SentNotification do ...@@ -206,6 +209,7 @@ describe SentNotification do
context 'for issue comment' do context 'for issue comment' do
let(:note) { create(:note_on_issue) } let(:note) { create(:note_on_issue) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a comment on the issue' do it 'creates a comment on the issue' do
...@@ -217,6 +221,7 @@ describe SentNotification do ...@@ -217,6 +221,7 @@ describe SentNotification do
context 'for issue discussion' do context 'for issue discussion' do
let(:note) { create(:discussion_note_on_issue) } let(:note) { create(:discussion_note_on_issue) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a reply on the discussion' do it 'creates a reply on the discussion' do
...@@ -228,6 +233,7 @@ describe SentNotification do ...@@ -228,6 +233,7 @@ describe SentNotification do
context 'for merge request' do context 'for merge request' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
subject { described_class.record(merge_request, merge_request.author.id) } subject { described_class.record(merge_request, merge_request.author.id) }
it 'creates a comment on the merge_request' do it 'creates a comment on the merge_request' do
...@@ -238,6 +244,7 @@ describe SentNotification do ...@@ -238,6 +244,7 @@ describe SentNotification do
context 'for merge request comment' do context 'for merge request comment' do
let(:note) { create(:note_on_merge_request) } let(:note) { create(:note_on_merge_request) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a comment on the merge request' do it 'creates a comment on the merge request' do
...@@ -249,6 +256,7 @@ describe SentNotification do ...@@ -249,6 +256,7 @@ describe SentNotification do
context 'for merge request diff discussion' do context 'for merge request diff discussion' do
let(:note) { create(:diff_note_on_merge_request) } let(:note) { create(:diff_note_on_merge_request) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a reply on the discussion' do it 'creates a reply on the discussion' do
...@@ -260,6 +268,7 @@ describe SentNotification do ...@@ -260,6 +268,7 @@ describe SentNotification do
context 'for merge request non-diff discussion' do context 'for merge request non-diff discussion' do
let(:note) { create(:discussion_note_on_merge_request) } let(:note) { create(:discussion_note_on_merge_request) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a reply on the discussion' do it 'creates a reply on the discussion' do
...@@ -272,6 +281,7 @@ describe SentNotification do ...@@ -272,6 +281,7 @@ describe SentNotification do
context 'for commit' do context 'for commit' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:commit) { project.commit } let(:commit) { project.commit }
subject { described_class.record(commit, project.creator.id) } subject { described_class.record(commit, project.creator.id) }
it 'creates a comment on the commit' do it 'creates a comment on the commit' do
...@@ -282,6 +292,7 @@ describe SentNotification do ...@@ -282,6 +292,7 @@ describe SentNotification do
context 'for commit comment' do context 'for commit comment' do
let(:note) { create(:note_on_commit) } let(:note) { create(:note_on_commit) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a comment on the commit' do it 'creates a comment on the commit' do
...@@ -293,6 +304,7 @@ describe SentNotification do ...@@ -293,6 +304,7 @@ describe SentNotification do
context 'for commit diff discussion' do context 'for commit diff discussion' do
let(:note) { create(:diff_note_on_commit) } let(:note) { create(:diff_note_on_commit) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a reply on the discussion' do it 'creates a reply on the discussion' do
...@@ -304,6 +316,7 @@ describe SentNotification do ...@@ -304,6 +316,7 @@ describe SentNotification do
context 'for commit non-diff discussion' do context 'for commit non-diff discussion' do
let(:note) { create(:discussion_note_on_commit) } let(:note) { create(:discussion_note_on_commit) }
subject { described_class.record_note(note, note.author.id) } subject { described_class.record_note(note, note.author.id) }
it 'creates a reply on the discussion' do it 'creates a reply on the discussion' do
......
...@@ -141,6 +141,7 @@ describe Snippet do ...@@ -141,6 +141,7 @@ describe Snippet do
describe "#content_html_invalidated?" do describe "#content_html_invalidated?" do
let(:snippet) { create(:snippet, content: "md", content_html: "html", file_name: "foo.md") } let(:snippet) { create(:snippet, content: "md", content_html: "html", file_name: "foo.md") }
it "invalidates the HTML cache of content when the filename changes" do it "invalidates the HTML cache of content when the filename changes" do
expect { snippet.file_name = "foo.rb" }.to change { snippet.content_html_invalidated? }.from(false).to(true) expect { snippet.file_name = "foo.rb" }.to change { snippet.content_html_invalidated? }.from(false).to(true)
end end
......
...@@ -31,6 +31,7 @@ describe Uploads::Fog do ...@@ -31,6 +31,7 @@ describe Uploads::Fog do
describe '#keys' do describe '#keys' do
let!(:uploads) { create_list(:upload, 2, :object_storage, uploader: FileUploader, model: project) } let!(:uploads) { create_list(:upload, 2, :object_storage, uploader: FileUploader, model: project) }
subject { data_store.keys(relation) } subject { data_store.keys(relation) }
it 'returns keys' do it 'returns keys' do
...@@ -41,6 +42,7 @@ describe Uploads::Fog do ...@@ -41,6 +42,7 @@ describe Uploads::Fog do
describe '#delete_keys' do describe '#delete_keys' do
let(:keys) { data_store.keys(relation) } let(:keys) { data_store.keys(relation) }
let!(:uploads) { create_list(:upload, 2, :with_file, :issuable_upload, model: project) } let!(:uploads) { create_list(:upload, 2, :with_file, :issuable_upload, model: project) }
subject { data_store.delete_keys(keys) } subject { data_store.delete_keys(keys) }
before do before do
......
...@@ -15,6 +15,7 @@ describe Uploads::Local do ...@@ -15,6 +15,7 @@ describe Uploads::Local do
describe '#keys' do describe '#keys' do
let!(:uploads) { create_list(:upload, 2, uploader: FileUploader, model: project) } let!(:uploads) { create_list(:upload, 2, uploader: FileUploader, model: project) }
subject { data_store.keys(relation) } subject { data_store.keys(relation) }
it 'returns keys' do it 'returns keys' do
...@@ -25,6 +26,7 @@ describe Uploads::Local do ...@@ -25,6 +26,7 @@ describe Uploads::Local do
describe '#delete_keys' do describe '#delete_keys' do
let(:keys) { data_store.keys(relation) } let(:keys) { data_store.keys(relation) }
let!(:uploads) { create_list(:upload, 2, :with_file, :issuable_upload, model: project) } let!(:uploads) { create_list(:upload, 2, :with_file, :issuable_upload, model: project) }
subject { data_store.delete_keys(keys) } subject { data_store.delete_keys(keys) }
it 'deletes multiple data' do it 'deletes multiple data' do
......
...@@ -11,6 +11,7 @@ describe UserInteractedProject do ...@@ -11,6 +11,7 @@ describe UserInteractedProject do
Event::ACTIONS.each do |action| Event::ACTIONS.each do |action|
context "for all actions (event types)" do context "for all actions (event types)" do
let(:event) { build(:event, action: action) } let(:event) { build(:event, action: action) }
it 'creates a record' do it 'creates a record' do
expect { subject }.to change { described_class.count }.from(0).to(1) expect { subject }.to change { described_class.count }.from(0).to(1)
end end
......
...@@ -2390,6 +2390,7 @@ describe User, :do_not_mock_admin_mode do ...@@ -2390,6 +2390,7 @@ describe User, :do_not_mock_admin_mode do
describe '#authorizations_for_projects' do describe '#authorizations_for_projects' do
let!(:user) { create(:user) } let!(:user) { create(:user) }
subject { Project.where("EXISTS (?)", user.authorizations_for_projects) } subject { Project.where("EXISTS (?)", user.authorizations_for_projects) }
it 'includes projects that belong to a user, but no other projects' do it 'includes projects that belong to a user, but no other projects' do
...@@ -3686,6 +3687,7 @@ describe User, :do_not_mock_admin_mode do ...@@ -3686,6 +3687,7 @@ describe User, :do_not_mock_admin_mode do
describe '#required_terms_not_accepted?' do describe '#required_terms_not_accepted?' do
let(:user) { build(:user) } let(:user) { build(:user) }
subject { user.required_terms_not_accepted? } subject { user.required_terms_not_accepted? }
context "when terms are not enforced" do context "when terms are not enforced" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment