Commit 100a3a63 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'fix-protected-environment-initialize' into 'master'

Fix protected environment initializer

Closes gitlab-ce#59007

See merge request gitlab-org/gitlab-ee!10150
parents 41acc8f8 9f19b649
......@@ -27,7 +27,7 @@ module EE
# rubocop: disable CodeReuse/ActiveRecord
def define_protected_env_variables
@protected_environments = @project.protected_environments.order(:name)
@protected_environment = @project.protected_environments.new
@protected_environment = ProtectedEnvironment.new(project: @project)
end
# rubocop: enable CodeReuse/ActiveRecord
......
---
title: Fix protected environment initializer
merge_request: 10150
author:
type: fixed
......@@ -86,6 +86,25 @@ describe 'Protected Environments' do
expect(page).not_to have_content('production')
end
end
context 'when projects_tokens_optional_encryption feature flag is false' do
before do
stub_feature_flags(projects_tokens_optional_encryption: false)
end
context 'when runners_token exists but runners_token_encrypted is empty' do
before do
project.update_column(:runners_token, 'abc')
project.update_column(:runners_token_encrypted, nil)
end
it 'shows setting page correctly' do
visit project_settings_ci_cd_path(project)
expect(page).to have_gitlab_http_status(200)
end
end
end
end
def set_protected_environment(environment_name)
......
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