Commit f9014f33 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'issue#325836-fix-empty-line-after-let-it-be-policies' into 'master'

Fix EmptyLineAfterFinalLetItBe offenses in spec/policies

See merge request gitlab-org/gitlab!58393
parents 8c080874 28ca908a
...@@ -896,13 +896,6 @@ RSpec/EmptyLineAfterFinalLetItBe: ...@@ -896,13 +896,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/models/user_spec.rb - spec/models/user_spec.rb
- spec/models/wiki_page/meta_spec.rb - spec/models/wiki_page/meta_spec.rb
- spec/models/wiki_page_spec.rb - spec/models/wiki_page_spec.rb
- spec/policies/application_setting/term_policy_spec.rb
- spec/policies/ci/build_policy_spec.rb
- spec/policies/design_management/design_policy_spec.rb
- spec/policies/group_deploy_keys_group_policy_spec.rb
- spec/policies/group_policy_spec.rb
- spec/policies/project_snippet_policy_spec.rb
- spec/policies/service_policy_spec.rb
- spec/presenters/alert_management/alert_presenter_spec.rb - spec/presenters/alert_management/alert_presenter_spec.rb
- spec/presenters/ci/pipeline_presenter_spec.rb - spec/presenters/ci/pipeline_presenter_spec.rb
- spec/presenters/label_presenter_spec.rb - spec/presenters/label_presenter_spec.rb
......
---
title: Fix EmptyLineAfterFinalLetItBe offenses in spec/policies
merge_request: 58393
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
...@@ -6,6 +6,7 @@ RSpec.describe ApplicationSetting::TermPolicy do ...@@ -6,6 +6,7 @@ RSpec.describe ApplicationSetting::TermPolicy do
include TermsHelper include TermsHelper
let_it_be(:term) { create(:term) } let_it_be(:term) { create(:term) }
let(:user) { create(:user) } let(:user) { create(:user) }
subject(:policy) { described_class.new(user, term) } subject(:policy) { described_class.new(user, term) }
......
...@@ -283,6 +283,7 @@ RSpec.describe Ci::BuildPolicy do ...@@ -283,6 +283,7 @@ RSpec.describe Ci::BuildPolicy do
describe 'manage a web ide terminal' do describe 'manage a web ide terminal' do
let(:build_permissions) { %i[read_web_ide_terminal create_build_terminal update_web_ide_terminal create_build_service_proxy] } let(:build_permissions) { %i[read_web_ide_terminal create_build_terminal update_web_ide_terminal create_build_service_proxy] }
let_it_be(:maintainer) { create(:user) } let_it_be(:maintainer) { create(:user) }
let(:owner) { create(:owner) } let(:owner) { create(:owner) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:maintainer) { create(:user) } let(:maintainer) { create(:user) }
......
...@@ -16,6 +16,7 @@ RSpec.describe DesignManagement::DesignPolicy do ...@@ -16,6 +16,7 @@ RSpec.describe DesignManagement::DesignPolicy do
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
let_it_be(:project) { create(:project, :public, namespace: owner.namespace) } let_it_be(:project) { create(:project, :public, namespace: owner.namespace) }
let_it_be(:issue) { create(:issue, project: project) } let_it_be(:issue) { create(:issue, project: project) }
let(:design) { create(:design, issue: issue) } let(:design) { create(:design, issue: issue) }
subject(:design_policy) { described_class.new(current_user, design) } subject(:design_policy) { described_class.new(current_user, design) }
...@@ -131,6 +132,7 @@ RSpec.describe DesignManagement::DesignPolicy do ...@@ -131,6 +132,7 @@ RSpec.describe DesignManagement::DesignPolicy do
context "for guests in private projects" do context "for guests in private projects" do
let_it_be(:project) { create(:project, :private) } let_it_be(:project) { create(:project, :private) }
let(:current_user) { guest } let(:current_user) { guest }
it_behaves_like "read-only design abilities" it_behaves_like "read-only design abilities"
...@@ -163,6 +165,7 @@ RSpec.describe DesignManagement::DesignPolicy do ...@@ -163,6 +165,7 @@ RSpec.describe DesignManagement::DesignPolicy do
context "when the project is archived" do context "when the project is archived" do
let_it_be(:project) { create(:project, :public, :archived) } let_it_be(:project) { create(:project, :public, :archived) }
let_it_be(:issue) { create(:issue, project: project) } let_it_be(:issue) { create(:issue, project: project) }
let(:current_user) { owner } let(:current_user) { owner }
it_behaves_like "read-only design abilities" it_behaves_like "read-only design abilities"
......
...@@ -8,6 +8,7 @@ RSpec.describe GroupDeployKeysGroupPolicy do ...@@ -8,6 +8,7 @@ RSpec.describe GroupDeployKeysGroupPolicy do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:group_deploy_key) { create(:group_deploy_key) } let_it_be(:group_deploy_key) { create(:group_deploy_key) }
let(:group_deploy_keys_group) { create(:group_deploy_keys_group, group: group, group_deploy_key: group_deploy_key) } let(:group_deploy_keys_group) { create(:group_deploy_keys_group, group: group, group_deploy_key: group_deploy_key) }
describe 'edit a group deploy key for a given group' do describe 'edit a group deploy key for a given group' do
......
...@@ -722,6 +722,7 @@ RSpec.describe GroupPolicy do ...@@ -722,6 +722,7 @@ RSpec.describe GroupPolicy do
describe 'design activity' do describe 'design activity' do
let_it_be(:group) { create(:group, :public) } let_it_be(:group) { create(:group, :public) }
let(:current_user) { nil } let(:current_user) { nil }
subject { described_class.new(current_user, group) } subject { described_class.new(current_user, group) }
......
...@@ -8,6 +8,7 @@ RSpec.describe ProjectSnippetPolicy do ...@@ -8,6 +8,7 @@ RSpec.describe ProjectSnippetPolicy do
let_it_be(:other_user) { create(:user) } let_it_be(:other_user) { create(:user) }
let_it_be(:external_user) { create(:user, :external) } let_it_be(:external_user) { create(:user, :external) }
let_it_be(:project) { create(:project, :public) } let_it_be(:project) { create(:project, :public) }
let(:snippet) { create(:project_snippet, snippet_visibility, project: project, author: author) } let(:snippet) { create(:project_snippet, snippet_visibility, project: project, author: author) }
let(:author) { other_user } let(:author) { other_user }
let(:author_permissions) do let(:author_permissions) do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe ServicePolicy, :models do RSpec.describe ServicePolicy, :models do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:project) { integration.project } let(:project) { integration.project }
subject(:policy) { Ability.policy_for(user, integration) } subject(:policy) { Ability.policy_for(user, integration) }
......
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