Commit 829a708a authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix remaining specs failures

parent e35af6e2
......@@ -412,11 +412,16 @@ class Projects::MergeRequestsController < Projects::ApplicationController
project = environment.project
deployment = environment.first_deployment_for(@merge_request.diff_head_commit)
stop_url =
if environment.stoppable? && can?(current_user, :create_deployment, environment)
stop_namespace_project_environment_path(project.namespace, project, environment)
end
{
id: environment.id,
name: environment.name,
url: namespace_project_environment_path(project.namespace, project, environment),
stop_url: (stop_namespace_project_environment_path(project.namespace, project, environment) if environment.stoppable?),
stop_url: stop_url,
external_url: environment.external_url,
external_url_formatted: environment.formatted_external_url,
deployed_at: deployment.try(:created_at),
......
......@@ -23,7 +23,7 @@
New environment
.environments-container
- if @environments.blank?
- if @all_environments.blank?
.blank-state.blank-state-no-icon
%h2.blank-state-title
You don't have any environments right now.
......
......@@ -3,7 +3,7 @@
= render "projects/pipelines/head"
%div{ class: container_class }
.top-area
.top-area.adjust
.col-md-9
%h3.page-title= @environment.name.capitalize
.col-md-3
......
......@@ -9,9 +9,8 @@ feature 'Widget Deployments Header', feature: true, js: true do
given(:merge_request) { create(:merge_request, :merged) }
given(:environment) { create(:environment, project: project) }
given(:role) { :developer }
given!(:deployment) do
create(:deployment, environment: environment, sha: project.commit('master').id)
end
given(:sha) { project.commit('master').id }
given!(:deployment) { create(:deployment, environment: environment, sha: sha) }
given!(:manual) { }
background do
......@@ -31,7 +30,10 @@ feature 'Widget Deployments Header', feature: true, js: true do
given(:pipeline) { create(:ci_pipeline, project: project) }
given(:build) { create(:ci_build, pipeline: pipeline) }
given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'close_app') }
given(:deployment) { create(:deployment, environment: environment, deployable: build, on_stop: 'close_app') }
given(:deployment) do
create(:deployment, environment: environment, ref: merge_request.target_branch,
sha: sha, deployable: build, on_stop: 'close_app')
end
background do
wait_for_ajax
......
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