diff options
-rw-r--r-- | config/routes/project.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/environments/environment_spec.rb | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index 44b8ae7aedd..512984c6f48 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -164,7 +164,7 @@ constraints(ProjectUrlConstrainer.new) do end collection do - get :folder, path: 'folders/:id' + get :folder, path: 'folders/*id', constraints: { format: /(html|json)/ } end end diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index e2d16e0830a..acc3efe04e6 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -166,6 +166,25 @@ feature 'Environment', :feature do end end + feature 'environment folders', :js do + context 'when folder name contains special charaters' do + before do + create(:environment, project: project, + name: 'staging-1.0/review', + state: :available) + + visit folder_namespace_project_environments_path(project.namespace, + project, + id: 'staging-1.0') + end + + it 'renders a correct environment folder' do + expect(page).to have_http_status(:ok) + expect(page).to have_content('Environments / staging-1.0') + end + end + end + feature 'auto-close environment when branch is deleted' do given(:project) { create(:project) } |