summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-02-10 18:24:45 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-02-10 18:24:45 +0000
commit34c61c8c28001273667578cb7e624b270633f9c0 (patch)
treebc7f64c2feb783b94b975d8147c2c1d9eef7446f
parent1ce973b5a1309a1a307a417a1cdd0ecaf19575fe (diff)
parent6bf04498f252a7aa9789a2182f61a3ea92fe0b2a (diff)
downloadgitlab-ce-34c61c8c28001273667578cb7e624b270633f9c0.tar.gz
Merge branch '27336-add-environment-url-link-to-terminal-page' into 'master'
Resolve "Add environment URL link to terminal page" Closes #27336 See merge request !9107
-rw-r--r--app/views/projects/environments/terminal.html.haml2
-rw-r--r--changelogs/unreleased/27336-add-environment-url-link-to-terminal-page.yml4
-rw-r--r--spec/features/environment_spec.rb16
3 files changed, 22 insertions, 0 deletions
diff --git a/app/views/projects/environments/terminal.html.haml b/app/views/projects/environments/terminal.html.haml
index 1d49e9cbaf7..ef0dd0eda3c 100644
--- a/app/views/projects/environments/terminal.html.haml
+++ b/app/views/projects/environments/terminal.html.haml
@@ -16,6 +16,8 @@
.col-sm-6
.nav-controls
+ = link_to @environment.external_url, class: 'btn btn-default' do
+ = icon('external-link')
= render 'projects/deployments/actions', deployment: @environment.last_deployment
.terminal-container{ class: container_class }
diff --git a/changelogs/unreleased/27336-add-environment-url-link-to-terminal-page.yml b/changelogs/unreleased/27336-add-environment-url-link-to-terminal-page.yml
new file mode 100644
index 00000000000..dd4907166c4
--- /dev/null
+++ b/changelogs/unreleased/27336-add-environment-url-link-to-terminal-page.yml
@@ -0,0 +1,4 @@
+---
+title: Added external environment link to web terminal view
+merge_request: 8303
+author:
diff --git a/spec/features/environment_spec.rb b/spec/features/environment_spec.rb
index 2f49e89b4e4..c203e1f20c1 100644
--- a/spec/features/environment_spec.rb
+++ b/spec/features/environment_spec.rb
@@ -101,6 +101,22 @@ feature 'Environment', :feature do
scenario 'it shows the terminal button' do
expect(page).to have_terminal_button
end
+
+ context 'web terminal', :js do
+ before do
+ # Stub #terminals as it causes js-enabled feature specs to render the page incorrectly
+ allow_any_instance_of(Environment).to receive(:terminals) { nil }
+ visit terminal_namespace_project_environment_path(project.namespace, project, environment)
+ end
+
+ it 'displays a web terminal' do
+ expect(page).to have_selector('#terminal')
+ end
+
+ it 'displays a link to the environment external url' do
+ expect(page).to have_link(nil, href: environment.external_url)
+ end
+ end
end
context 'for developer' do