summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-23 23:46:35 -0800
committerStan Hu <stanhu@gmail.com>2018-12-24 00:12:36 -0800
commit29adade5939897b2792cd25948837fc89220179c (patch)
tree6e20d078c14b7c5b518383db192b5abfb9c40910 /spec
parent91b0754d8ea158813d28a8a146ffea9554567364 (diff)
downloadgitlab-ce-29adade5939897b2792cd25948837fc89220179c.tar.gz
Fix and move specs into admin_disables_git_access_protocol_spec.rb
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/admin_disables_git_access_protocol_spec.rb59
-rw-r--r--spec/features/projects_spec.rb69
2 files changed, 64 insertions, 64 deletions
diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb
index 91c22e7ad82..f066b088800 100644
--- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb
+++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb
@@ -1,7 +1,8 @@
require 'rails_helper'
-describe 'Admin disables Git access protocol' do
+describe 'Admin disables Git access protocol', :js do
include StubENV
+ include MobileHelpers
let(:project) { create(:project, :empty_repo) }
let(:admin) { create(:admin) }
@@ -20,7 +21,24 @@ describe 'Admin disables Git access protocol' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
- expect(page).not_to have_selector('#clone-dropdown')
+
+ find('.clone-dropdown-btn').click
+
+ within('.git-clone-holder') do
+ expect(page).to have_content('Clone with SSH')
+ expect(page).not_to have_content('Clone with HTTP')
+ end
+ end
+
+ context 'mobile component' do
+ it 'shows only the SSH clone information' do
+ resize_screen_xs
+ visit_project
+ find('.dropdown-toggle').click
+
+ expect(page).to have_content('Copy SSH clone URL')
+ expect(page).not_to have_content('Copy HTTP clone URL')
+ end
end
end
@@ -31,9 +49,25 @@ describe 'Admin disables Git access protocol' do
it 'shows only HTTP url' do
visit_project
+ find('.clone-dropdown-btn').click
expect(page).to have_content("git clone #{project.http_url_to_repo}")
- expect(page).not_to have_selector('#clone-dropdown')
+
+ within('.git-clone-holder') do
+ expect(page).to have_content('Clone with HTTP')
+ expect(page).not_to have_content('Clone with SSH')
+ end
+ end
+
+ context 'mobile component' do
+ it 'shows only the HTTP clone information' do
+ resize_screen_xs
+ visit_project
+ find('.dropdown-toggle').click
+
+ expect(page).to have_content('Copy HTTP clone URL')
+ expect(page).not_to have_content('Copy SSH clone URL')
+ end
end
end
@@ -46,7 +80,24 @@ describe 'Admin disables Git access protocol' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
- expect(page).to have_selector('#clone-dropdown')
+
+ find('.clone-dropdown-btn').click
+
+ within('.git-clone-holder') do
+ expect(page).to have_content('Clone with SSH')
+ expect(page).to have_content('Clone with HTTP')
+ end
+ end
+
+ context 'mobile component' do
+ it 'shows both SSH and HTTP clone information' do
+ resize_screen_xs
+ visit_project
+ find('.dropdown-toggle').click
+
+ expect(page).to have_content('Copy HTTP clone URL')
+ expect(page).to have_content('Copy SSH clone URL')
+ end
end
end
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index c6ad4f5227b..b56bb272b46 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -104,73 +104,22 @@ describe 'Project' do
let(:path) { project_path(project) }
before do
- stub_application_setting(enabled_git_access_protocol: enabled_protocols)
sign_in(create(:admin))
visit path
end
- context 'with all protocols enabled' do
- let(:enabled_protocols) { nil }
-
- context 'desktop component' do
- it 'shows on md and larger breakpoints' do
- expect(find('.git-clone-holder')).to be_visible
- expect(find('.mobile-git-clone', visible: false)).not_to be_visible
- end
- end
-
- context 'mobile component' do
- it 'shows mobile component on sm and smaller breakpoints' do
- resize_screen_xs
- expect(find('.mobile-git-clone')).to be_visible
- expect(find('.git-clone-holder', visible: false)).not_to be_visible
- end
+ context 'desktop component' do
+ it 'shows on md and larger breakpoints' do
+ expect(find('.git-clone-holder')).to be_visible
+ expect(find('.mobile-git-clone', visible: false)).not_to be_visible
end
end
- context 'when only HTTP clones are allowed' do
- let(:enabled_protocols) { 'http' }
-
- it 'shows only the instructions for HTTP' do
- find('.clone-dropdown-btn').click
-
- within('.git-clone-holder') do
- expect(page).to have_content('Clone with HTTP')
- expect(page).not_to have_content('Clone with SSH')
- end
- end
-
- context 'mobile component' do
- it 'shows only the instructions for HTTP' do
- resize_screen_xs
- find('.dropdown-toggle').click
-
- expect(page).to have_content('Copy HTTP clone URL')
- expect(page).not_to have_content('Copy SSH clone URL')
- end
- end
- end
-
- context 'when only SSH clones are allowed' do
- let(:enabled_protocols) { 'ssh' }
-
- it 'shows only the instructions for SSH' do
- find('.clone-dropdown-btn').click
-
- within('.git-clone-holder') do
- expect(page).to have_content('Clone with SSH')
- expect(page).not_to have_content('Clone with HTTP')
- end
- end
-
- context 'mobile component' do
- it 'shows only the instructions for SSH' do
- resize_screen_xs
- find('.dropdown-toggle').click
-
- expect(page).to have_content('Copy SSH clone URL')
- expect(page).not_to have_content('Copy HTTP clone URL')
- end
+ context 'mobile component' do
+ it 'shows mobile component on sm and smaller breakpoints' do
+ resize_screen_xs
+ expect(find('.mobile-git-clone')).to be_visible
+ expect(find('.git-clone-holder', visible: false)).not_to be_visible
end
end
end