Commit a2344dd1 authored by Alexander Turinske's avatar Alexander Turinske

Update policies_helper_spec variables to let_it_be

- this makes the test performance better by not creating a
  new variable every test
parent f98601f4
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Projects::Security::PoliciesHelper do RSpec.describe Projects::Security::PoliciesHelper do
let(:project) { create(:project, :repository, :public) } let_it_be_with_reload(:project) { create(:project, :repository, :public) }
describe '#assigned_policy_project' do describe '#assigned_policy_project' do
context 'when a project does have a security policy project' do context 'when a project does have a security policy project' do
let(:policy_management_project) { create(:project) } let_it_be(:policy_management_project) { create(:project) }
subject { helper.assigned_policy_project(project) } subject { helper.assigned_policy_project(project) }
...@@ -69,7 +69,8 @@ RSpec.describe Projects::Security::PoliciesHelper do ...@@ -69,7 +69,8 @@ RSpec.describe Projects::Security::PoliciesHelper do
end end
context 'when an existing policy is being edited' do context 'when an existing policy is being edited' do
let(:environment) { create(:environment, project: project) } let_it_be(:environment) { create(:environment, project: project) }
let(:policy_type) { 'container_policy' } let(:policy_type) { 'container_policy' }
let(:policy) do let(:policy) 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