Commit 5c2348e4 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'winh-rubocop-capybara-featuremethods' into 'master'

Enable Capybara/FeatureMethods cop

See merge request gitlab-org/gitlab-ce!20383
parents baab4cdd 3db2f327
...@@ -10,10 +10,6 @@ ...@@ -10,10 +10,6 @@
Capybara/CurrentPathExpectation: Capybara/CurrentPathExpectation:
Enabled: false Enabled: false
# Offense count: 956
Capybara/FeatureMethods:
Enabled: false
# Offense count: 23 # Offense count: 23
FactoryBot/DynamicAttributeDefinedStatically: FactoryBot/DynamicAttributeDefinedStatically:
Exclude: Exclude:
......
require 'securerandom' require 'securerandom'
module QA module QA
feature 'API basics', :core do describe 'API basics', :core do
before(:context) do before(:context) do
@api_client = Runtime::API::Client.new(:gitlab) @api_client = Runtime::API::Client.new(:gitlab)
end end
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" } let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" }
let(:sanitized_project_path) { CGI.escape("#{Runtime::User.name}/#{project_name}") } let(:sanitized_project_path) { CGI.escape("#{Runtime::User.name}/#{project_name}") }
scenario 'user creates a project with a file and deletes them afterwards' do it 'user creates a project with a file and deletes them afterwards' do
create_project_request = Runtime::API::Request.new(@api_client, '/projects') create_project_request = Runtime::API::Request.new(@api_client, '/projects')
post create_project_request.url, path: project_name, name: project_name post create_project_request.url, path: project_name, name: project_name
......
module QA module QA
feature 'API users', :core do describe 'API users', :core do
before(:context) do before(:context) do
@api_client = Runtime::API::Client.new(:gitlab) @api_client = Runtime::API::Client.new(:gitlab)
end end
...@@ -7,13 +7,13 @@ module QA ...@@ -7,13 +7,13 @@ module QA
context 'when authenticated' do context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') } let(:request) { Runtime::API::Request.new(@api_client, '/users') }
scenario 'get list of users' do it 'get list of users' do
get request.url get request.url
expect_status(200) expect_status(200)
end end
scenario 'submit request with a valid user name' do it 'submit request with a valid user name' do
get request.url, { params: { username: Runtime::User.name } } get request.url, { params: { username: Runtime::User.name } }
expect_status(200) expect_status(200)
...@@ -22,7 +22,7 @@ module QA ...@@ -22,7 +22,7 @@ module QA
) )
end end
scenario 'submit request with an invalid user name' do it 'submit request with an invalid user name' do
get request.url, { params: { username: SecureRandom.hex(10) } } get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200) expect_status(200)
...@@ -30,7 +30,7 @@ module QA ...@@ -30,7 +30,7 @@ module QA
end end
end end
scenario 'submit request with an invalid token' do it 'submit request with an invalid token' do
request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid') request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid')
get request.url get request.url
......
module QA module QA
feature 'LDAP user login', :ldap do describe 'LDAP user login', :ldap do
before do before do
Runtime::Env.user_type = 'ldap' Runtime::Env.user_type = 'ldap'
end end
scenario 'user logs in using LDAP credentials' do it 'user logs in using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'standard user login', :core do describe 'standard user login', :core do
scenario 'user logs in using credentials' do it 'user logs in using credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'create a new group', :mattermost do describe 'create a new group', :mattermost do
scenario 'creating a group with a mattermost team' do it 'creating a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_groups } Page::Menu::Main.act { go_to_groups }
......
module QA module QA
feature 'logging in to Mattermost', :mattermost do describe 'logging in to Mattermost', :mattermost do
scenario 'can use gitlab oauth' do it 'can use gitlab oauth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) do Runtime::Browser.visit(:gitlab, Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'creates a merge request', :core do describe 'creates a merge request', :core do
scenario 'user creates a new merge request' do it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'merge request rebase', :core do describe 'merge request rebase', :core do
scenario 'rebases source branch of merge request' do it 'rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'merge request squash commits', :core do describe 'merge request squash commits', :core do
scenario 'when squash commits is marked before merge' do it 'when squash commits is marked before merge' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'activity page', :core do describe 'activity page', :core do
scenario 'push creates an event in the activity page' do it 'push creates an event in the activity page' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'deploy keys support', :core do describe 'deploy keys support', :core do
scenario 'user adds a deploy key' do it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'secret variables support', :core do describe 'secret variables support', :core do
scenario 'user adds a secret variable' do it 'user adds a secret variable' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
require 'pathname' require 'pathname'
module QA module QA
feature 'Auto Devops', :kubernetes do describe 'Auto Devops', :kubernetes do
after do after do
@cluster&.remove! @cluster&.remove!
end end
scenario 'user creates a new project and runs auto devops' do it 'user creates a new project and runs auto devops' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'creates issue', :core do describe 'creates issue', :core do
let(:issue_title) { 'issue title' } let(:issue_title) { 'issue title' }
scenario 'user creates issue' do it 'user creates issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'create a new project', :core do describe 'create a new project', :core do
scenario 'user creates a new project' do it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
require 'digest/sha1' require 'digest/sha1'
module QA module QA
feature 'cloning code using a deploy key', :core, :docker do describe 'cloning code using a deploy key', :core, :docker do
def login def login
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -39,7 +39,7 @@ module QA ...@@ -39,7 +39,7 @@ module QA
] ]
keys.each do |(key_class, bits)| keys.each do |(key_class, bits)|
scenario "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
key = key_class.new(*bits) key = key_class.new(*bits)
login login
......
module QA module QA
feature 'CI/CD Pipelines', :core, :docker do describe 'CI/CD Pipelines', :core, :docker do
let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do after do
Service::Runner.new(executor).remove! Service::Runner.new(executor).remove!
end end
scenario 'user registers a new specific runner' do it 'user registers a new specific runner' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -25,7 +25,7 @@ module QA ...@@ -25,7 +25,7 @@ module QA
end end
end end
scenario 'users creates a new pipeline' do it 'users creates a new pipeline' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
module QA module QA
feature 'Wiki Functionality', :core do describe 'Wiki Functionality', :core do
def login def login
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
...@@ -14,7 +14,7 @@ module QA ...@@ -14,7 +14,7 @@ module QA
login login
end end
scenario 'User creates, edits, clones, and pushes to the wiki' do it 'User creates, edits, clones, and pushes to the wiki' do
wiki = Factory::Resource::Wiki.fabricate! do |resource| wiki = Factory::Resource::Wiki.fabricate! do |resource|
resource.title = 'Home' resource.title = 'Home'
resource.content = '# My First Wiki Content' resource.content = '# My First Wiki Content'
......
module QA module QA
feature 'clone code from the repository', :core do describe 'clone code from the repository', :core do
context 'with regular account over http' do context 'with regular account over http' do
given(:location) do let(:location) do
Page::Project::Show.act do Page::Project::Show.act do
choose_repository_clone_http choose_repository_clone_http
repository_location repository_location
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
end end
end end
scenario 'user performs a deep clone' do it 'user performs a deep clone' do
Git::Repository.perform do |repository| Git::Repository.perform do |repository|
repository.uri = location.uri repository.uri = location.uri
repository.use_default_credentials repository.use_default_credentials
...@@ -42,7 +42,7 @@ module QA ...@@ -42,7 +42,7 @@ module QA
end end
end end
scenario 'user performs a shallow clone' do it 'user performs a shallow clone' do
Git::Repository.perform do |repository| Git::Repository.perform do |repository|
repository.uri = location.uri repository.uri = location.uri
repository.use_default_credentials repository.use_default_credentials
......
module QA module QA
feature 'branch protection support', :core do describe 'branch protection support', :core do
given(:branch_name) { 'protected-branch' } let(:branch_name) { 'protected-branch' }
given(:commit_message) { 'Protected push commit message' } let(:commit_message) { 'Protected push commit message' }
given(:project) do let(:project) do
Factory::Resource::Project.fabricate! do |resource| Factory::Resource::Project.fabricate! do |resource|
resource.name = 'protected-branch-project' resource.name = 'protected-branch-project'
end end
...@@ -27,7 +27,7 @@ module QA ...@@ -27,7 +27,7 @@ module QA
context 'when developers and maintainers are allowed to push to a protected branch' do context 'when developers and maintainers are allowed to push to a protected branch' do
let!(:protected_branch) { create_protected_branch(allow_to_push: true) } let!(:protected_branch) { create_protected_branch(allow_to_push: true) }
scenario 'user with push rights successfully pushes to the protected branch' do it 'user with push rights successfully pushes to the protected branch' do
expect(protected_branch.name).to have_content(branch_name) expect(protected_branch.name).to have_content(branch_name)
expect(protected_branch.push_allowance).to have_content('Developers + Maintainers') expect(protected_branch.push_allowance).to have_content('Developers + Maintainers')
...@@ -38,7 +38,7 @@ module QA ...@@ -38,7 +38,7 @@ module QA
end end
context 'when developers and maintainers are not allowed to push to a protected branch' do context 'when developers and maintainers are not allowed to push to a protected branch' do
scenario 'user without push rights fails to push to the protected branch' do it 'user without push rights fails to push to the protected branch' do
create_protected_branch(allow_to_push: false) create_protected_branch(allow_to_push: false)
@push = push_new_file(branch_name) @push = push_new_file(branch_name)
......
module QA module QA
feature 'push code to repository', :core do describe 'push code to repository', :core do
context 'with regular account over http' do context 'with regular account over http' do
scenario 'user pushes code to the repository' do it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
......
require 'spec_helper' require 'spec_helper'
feature 'Abuse reports' do describe 'Abuse reports' do
let(:another_user) { create(:user) } let(:another_user) { create(:user) }
before do before do
sign_in(create(:user)) sign_in(create(:user))
end end
scenario 'Report abuse' do it 'Report abuse' do
visit user_path(another_user) visit user_path(another_user)
click_link 'Report abuse' click_link 'Report abuse'
......
require 'spec_helper' require 'spec_helper'
feature 'Admin Appearance' do describe 'Admin Appearance' do
let!(:appearance) { create(:appearance) } let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do it 'Create new appearance' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
...@@ -21,7 +21,7 @@ feature 'Admin Appearance' do ...@@ -21,7 +21,7 @@ feature 'Admin Appearance' do
expect(page).to have_content 'Last edit' expect(page).to have_content 'Last edit'
end end
scenario 'Preview sign-in page appearance' do it 'Preview sign-in page appearance' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
...@@ -30,7 +30,7 @@ feature 'Admin Appearance' do ...@@ -30,7 +30,7 @@ feature 'Admin Appearance' do
expect_custom_sign_in_appearance(appearance) expect_custom_sign_in_appearance(appearance)
end end
scenario 'Preview new project page appearance' do it 'Preview new project page appearance' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
...@@ -39,20 +39,20 @@ feature 'Admin Appearance' do ...@@ -39,20 +39,20 @@ feature 'Admin Appearance' do
expect_custom_new_project_appearance(appearance) expect_custom_new_project_appearance(appearance)
end end
scenario 'Custom sign-in page' do it 'Custom sign-in page' do
visit new_user_session_path visit new_user_session_path
expect_custom_sign_in_appearance(appearance) expect_custom_sign_in_appearance(appearance)
end end
scenario 'Custom new project page' do it 'Custom new project page' do
sign_in create(:user) sign_in create(:user)
visit new_project_path visit new_project_path
expect_custom_new_project_appearance(appearance) expect_custom_new_project_appearance(appearance)
end end
scenario 'Appearance logo' do it 'Appearance logo' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
...@@ -64,7 +64,7 @@ feature 'Admin Appearance' do ...@@ -64,7 +64,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(logo_selector) expect(page).not_to have_css(logo_selector)
end end
scenario 'Header logos' do it 'Header logos' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
...@@ -76,7 +76,7 @@ feature 'Admin Appearance' do ...@@ -76,7 +76,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(header_logo_selector) expect(page).not_to have_css(header_logo_selector)
end end
scenario 'Favicon' do it 'Favicon' do
sign_in(create(:admin)) sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
......
require 'spec_helper' require 'spec_helper'
feature 'Admin Broadcast Messages' do describe 'Admin Broadcast Messages' do
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
create(:broadcast_message, :expired, message: 'Migration to new server') create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path visit admin_broadcast_messages_path
end end
scenario 'See broadcast messages list' do it 'See broadcast messages list' do
expect(page).to have_content 'Migration to new server' expect(page).to have_content 'Migration to new server'
end end
scenario 'Create a customized broadcast message' do it 'Create a customized broadcast message' do
fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**' fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**'
fill_in 'broadcast_message_color', with: '#f2dede' fill_in 'broadcast_message_color', with: '#f2dede'
fill_in 'broadcast_message_font', with: '#b94a48' fill_in 'broadcast_message_font', with: '#b94a48'
...@@ -24,7 +24,7 @@ feature 'Admin Broadcast Messages' do ...@@ -24,7 +24,7 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"]) expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"])
end end
scenario 'Edit an existing broadcast message' do it 'Edit an existing broadcast message' do
click_link 'Edit' click_link 'Edit'
fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW'
click_button 'Update broadcast message' click_button 'Update broadcast message'
...@@ -33,14 +33,14 @@ feature 'Admin Broadcast Messages' do ...@@ -33,14 +33,14 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_content 'Application update RIGHT NOW' expect(page).to have_content 'Application update RIGHT NOW'
end end
scenario 'Remove an existing broadcast message' do it 'Remove an existing broadcast message' do
click_link 'Remove' click_link 'Remove'
expect(current_path).to eq admin_broadcast_messages_path expect(current_path).to eq admin_broadcast_messages_path
expect(page).not_to have_content 'Migration to new server' expect(page).not_to have_content 'Migration to new server'
end end
scenario 'Live preview a customized broadcast message', :js do it 'Live preview a customized broadcast message', :js do
fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:" fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:"
page.within('.broadcast-message-preview') do page.within('.broadcast-message-preview') do
......
...@@ -7,7 +7,7 @@ describe 'Admin browse spam logs' do ...@@ -7,7 +7,7 @@ describe 'Admin browse spam logs' do
sign_in(create(:admin)) sign_in(create(:admin))
end end
scenario 'Browse spam logs' do it 'Browse spam logs' do
visit admin_spam_logs_path visit admin_spam_logs_path
expect(page).to have_content('Spam Logs') expect(page).to have_content('Spam Logs')
......
require 'rails_helper' require 'rails_helper'
feature 'Admin cohorts page' do describe 'Admin cohorts page' do
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
end end
scenario 'See users count per month' do it 'See users count per month' do
2.times { create(:user) } 2.times { create(:user) }
visit admin_cohorts_path visit admin_cohorts_path
......
require 'rails_helper' require 'rails_helper'
feature 'Admin disables Git access protocol' do describe 'Admin disables Git access protocol' do
include StubENV include StubENV
let(:project) { create(:project, :empty_repo) } let(:project) { create(:project, :empty_repo) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
background do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
sign_in(admin) sign_in(admin)
end end
context 'with HTTP disabled' do context 'with HTTP disabled' do
background do before do
disable_http_protocol disable_http_protocol
end end
scenario 'shows only SSH url' do it 'shows only SSH url' do
visit_project visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}") expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
...@@ -25,11 +25,11 @@ feature 'Admin disables Git access protocol' do ...@@ -25,11 +25,11 @@ feature 'Admin disables Git access protocol' do
end end
context 'with SSH disabled' do context 'with SSH disabled' do
background do before do
disable_ssh_protocol disable_ssh_protocol
end end
scenario 'shows only HTTP url' do it 'shows only HTTP url' do
visit_project visit_project
expect(page).to have_content("git clone #{project.http_url_to_repo}") expect(page).to have_content("git clone #{project.http_url_to_repo}")
...@@ -38,11 +38,11 @@ feature 'Admin disables Git access protocol' do ...@@ -38,11 +38,11 @@ feature 'Admin disables Git access protocol' do
end end
context 'with nothing disabled' do context 'with nothing disabled' do
background do before do
create(:personal_key, user: admin) create(:personal_key, user: admin)
end end
scenario 'shows default SSH url and protocol selection dropdown' do it 'shows default SSH url and protocol selection dropdown' do
visit_project visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}") expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
......
require 'rails_helper' require 'rails_helper'
feature 'Admin disables 2FA for a user' do describe 'Admin disables 2FA for a user' do
scenario 'successfully', :js do it 'successfully', :js do
sign_in(create(:admin)) sign_in(create(:admin))
user = create(:user, :two_factor) user = create(:user, :two_factor)
...@@ -16,7 +16,7 @@ feature 'Admin disables 2FA for a user' do ...@@ -16,7 +16,7 @@ feature 'Admin disables 2FA for a user' do
end end
end end
scenario 'for a user without 2FA enabled' do it 'for a user without 2FA enabled' do
sign_in(create(:admin)) sign_in(create(:admin))
user = create(:user) user = create(:user)
......
require 'spec_helper' require 'spec_helper'
feature 'Admin Groups' do describe 'Admin Groups' do
include Select2Helper include Select2Helper
let(:internal) { Gitlab::VisibilityLevel::INTERNAL } let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
...@@ -47,13 +47,13 @@ feature 'Admin Groups' do ...@@ -47,13 +47,13 @@ feature 'Admin Groups' do
expect(li_texts).to match group_description expect(li_texts).to match group_description
end end
scenario 'shows the visibility level radio populated with the default value' do it 'shows the visibility level radio populated with the default value' do
visit new_admin_group_path visit new_admin_group_path
expect_selected_visibility(internal) expect_selected_visibility(internal)
end end
scenario 'when entered in group path, it auto filled the group name', :js do it 'when entered in group path, it auto filled the group name', :js do
visit admin_groups_path visit admin_groups_path
click_link "New group" click_link "New group"
group_path = 'gitlab' group_path = 'gitlab'
...@@ -64,7 +64,7 @@ feature 'Admin Groups' do ...@@ -64,7 +64,7 @@ feature 'Admin Groups' do
end end
describe 'show a group' do describe 'show a group' do
scenario 'shows the group' do it 'shows the group' do
group = create(:group, :private) group = create(:group, :private)
visit admin_group_path(group) visit admin_group_path(group)
...@@ -74,7 +74,7 @@ feature 'Admin Groups' do ...@@ -74,7 +74,7 @@ feature 'Admin Groups' do
end end
describe 'group edit' do describe 'group edit' do
scenario 'shows the visibility level radio populated with the group visibility_level value' do it 'shows the visibility level radio populated with the group visibility_level value' do
group = create(:group, :private) group = create(:group, :private)
visit admin_group_edit_path(group) visit admin_group_edit_path(group)
...@@ -82,7 +82,7 @@ feature 'Admin Groups' do ...@@ -82,7 +82,7 @@ feature 'Admin Groups' do
expect_selected_visibility(group.visibility_level) expect_selected_visibility(group.visibility_level)
end end
scenario 'edit group path does not change group name', :js do it 'edit group path does not change group name', :js do
group = create(:group, :private) group = create(:group, :private)
visit admin_group_edit_path(group) visit admin_group_edit_path(group)
......
require 'spec_helper' require 'spec_helper'
feature "Admin Health Check", :feature do describe "Admin Health Check", :feature do
include StubENV include StubENV
before do before do
......
require 'spec_helper' require 'spec_helper'
feature 'Admin::HookLogs' do describe 'Admin::HookLogs' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:system_hook) { create(:system_hook) } let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
...@@ -9,7 +9,7 @@ feature 'Admin::HookLogs' do ...@@ -9,7 +9,7 @@ feature 'Admin::HookLogs' do
sign_in(create(:admin)) sign_in(create(:admin))
end end
scenario 'show list of hook logs' do it 'show list of hook logs' do
hook_log hook_log
visit edit_admin_hook_path(system_hook) visit edit_admin_hook_path(system_hook)
...@@ -17,7 +17,7 @@ feature 'Admin::HookLogs' do ...@@ -17,7 +17,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content(hook_log.url) expect(page).to have_content(hook_log.url)
end end
scenario 'show hook log details' do it 'show hook log details' do
hook_log hook_log
visit edit_admin_hook_path(system_hook) visit edit_admin_hook_path(system_hook)
click_link 'View details' click_link 'View details'
...@@ -27,7 +27,7 @@ feature 'Admin::HookLogs' do ...@@ -27,7 +27,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content('Resend Request') expect(page).to have_content('Resend Request')
end end
scenario 'retry hook log' do it 'retry hook log' do
WebMock.stub_request(:post, system_hook.url) WebMock.stub_request(:post, system_hook.url)
hook_log hook_log
......
require 'spec_helper' require 'spec_helper'
feature 'Admin updates settings' do describe 'Admin updates settings' do
include StubENV include StubENV
include TermsHelper include TermsHelper
...@@ -12,7 +12,7 @@ feature 'Admin updates settings' do ...@@ -12,7 +12,7 @@ feature 'Admin updates settings' do
visit admin_application_settings_path visit admin_application_settings_path
end end
scenario 'Change visibility settings' do it 'Change visibility settings' do
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
choose "application_setting_default_project_visibility_20" choose "application_setting_default_project_visibility_20"
click_button 'Save changes' click_button 'Save changes'
...@@ -21,7 +21,7 @@ feature 'Admin updates settings' do ...@@ -21,7 +21,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Uncheck all restricted visibility levels' do it 'Uncheck all restricted visibility levels' do
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
find('#application_setting_visibility_level_0').set(false) find('#application_setting_visibility_level_0').set(false)
find('#application_setting_visibility_level_10').set(false) find('#application_setting_visibility_level_10').set(false)
...@@ -35,7 +35,7 @@ feature 'Admin updates settings' do ...@@ -35,7 +35,7 @@ feature 'Admin updates settings' do
expect(find('#application_setting_visibility_level_20')).not_to be_checked expect(find('#application_setting_visibility_level_20')).not_to be_checked
end end
scenario 'Modify import sources' do it 'Modify import sources' do
expect(Gitlab::CurrentSettings.import_sources).not_to be_empty expect(Gitlab::CurrentSettings.import_sources).not_to be_empty
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
...@@ -58,7 +58,7 @@ feature 'Admin updates settings' do ...@@ -58,7 +58,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.import_sources).to eq(['git']) expect(Gitlab::CurrentSettings.import_sources).to eq(['git'])
end end
scenario 'Change Visibility and Access Controls' do it 'Change Visibility and Access Controls' do
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
uncheck 'Project export enabled' uncheck 'Project export enabled'
click_button 'Save changes' click_button 'Save changes'
...@@ -68,7 +68,7 @@ feature 'Admin updates settings' do ...@@ -68,7 +68,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Account and Limit Settings' do it 'Change Account and Limit Settings' do
page.within('.as-account-limit') do page.within('.as-account-limit') do
uncheck 'Gravatar enabled' uncheck 'Gravatar enabled'
click_button 'Save changes' click_button 'Save changes'
...@@ -78,7 +78,7 @@ feature 'Admin updates settings' do ...@@ -78,7 +78,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Sign-in restrictions' do it 'Change Sign-in restrictions' do
page.within('.as-signin') do page.within('.as-signin') do
fill_in 'Home page URL', with: 'https://about.gitlab.com/' fill_in 'Home page URL', with: 'https://about.gitlab.com/'
click_button 'Save changes' click_button 'Save changes'
...@@ -88,7 +88,7 @@ feature 'Admin updates settings' do ...@@ -88,7 +88,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Terms of Service' do it 'Terms of Service' do
# Already have the admin accept terms, so they don't need to accept in this spec. # Already have the admin accept terms, so they don't need to accept in this spec.
_existing_terms = create(:term) _existing_terms = create(:term)
accept_terms(admin) accept_terms(admin)
...@@ -104,7 +104,7 @@ feature 'Admin updates settings' do ...@@ -104,7 +104,7 @@ feature 'Admin updates settings' do
expect(page).to have_content 'Application settings saved successfully' expect(page).to have_content 'Application settings saved successfully'
end end
scenario 'Modify oauth providers' do it 'Modify oauth providers' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
page.within('.as-signin') do page.within('.as-signin') do
...@@ -124,7 +124,7 @@ feature 'Admin updates settings' do ...@@ -124,7 +124,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).not_to include('google_oauth2') expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).not_to include('google_oauth2')
end end
scenario 'Oauth providers do not raise validation errors when saving unrelated changes' do it 'Oauth providers do not raise validation errors when saving unrelated changes' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
page.within('.as-signin') do page.within('.as-signin') do
...@@ -147,7 +147,7 @@ feature 'Admin updates settings' do ...@@ -147,7 +147,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to include('google_oauth2') expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to include('google_oauth2')
end end
scenario 'Change Help page' do it 'Change Help page' do
page.within('.as-help-page') do page.within('.as-help-page') do
fill_in 'Help page text', with: 'Example text' fill_in 'Help page text', with: 'Example text'
check 'Hide marketing-related entries from help' check 'Hide marketing-related entries from help'
...@@ -161,7 +161,7 @@ feature 'Admin updates settings' do ...@@ -161,7 +161,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Pages settings' do it 'Change Pages settings' do
page.within('.as-pages') do page.within('.as-pages') do
fill_in 'Maximum size of pages (MB)', with: 15 fill_in 'Maximum size of pages (MB)', with: 15
check 'Require users to prove ownership of custom domains' check 'Require users to prove ownership of custom domains'
...@@ -173,7 +173,7 @@ feature 'Admin updates settings' do ...@@ -173,7 +173,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change CI/CD settings' do it 'Change CI/CD settings' do
page.within('.as-ci-cd') do page.within('.as-ci-cd') do
check 'Enabled Auto DevOps for projects by default' check 'Enabled Auto DevOps for projects by default'
fill_in 'Auto devops domain', with: 'domain.com' fill_in 'Auto devops domain', with: 'domain.com'
...@@ -185,7 +185,7 @@ feature 'Admin updates settings' do ...@@ -185,7 +185,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Influx settings' do it 'Change Influx settings' do
page.within('.as-influx') do page.within('.as-influx') do
check 'Enable InfluxDB Metrics' check 'Enable InfluxDB Metrics'
click_button 'Save changes' click_button 'Save changes'
...@@ -195,7 +195,7 @@ feature 'Admin updates settings' do ...@@ -195,7 +195,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Prometheus settings' do it 'Change Prometheus settings' do
page.within('.as-prometheus') do page.within('.as-prometheus') do
check 'Enable Prometheus Metrics' check 'Enable Prometheus Metrics'
click_button 'Save changes' click_button 'Save changes'
...@@ -205,7 +205,7 @@ feature 'Admin updates settings' do ...@@ -205,7 +205,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Performance bar settings' do it 'Change Performance bar settings' do
group = create(:group) group = create(:group)
page.within('.as-performance-bar') do page.within('.as-performance-bar') do
...@@ -228,7 +228,7 @@ feature 'Admin updates settings' do ...@@ -228,7 +228,7 @@ feature 'Admin updates settings' do
expect(find_field('Allowed group').value).to be_nil expect(find_field('Allowed group').value).to be_nil
end end
scenario 'Change Background jobs settings' do it 'Change Background jobs settings' do
page.within('.as-background') do page.within('.as-background') do
fill_in 'Throttling Factor', with: 1 fill_in 'Throttling Factor', with: 1
click_button 'Save changes' click_button 'Save changes'
...@@ -238,7 +238,7 @@ feature 'Admin updates settings' do ...@@ -238,7 +238,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
scenario 'Change Spam settings' do it 'Change Spam settings' do
page.within('.as-spam') do page.within('.as-spam') do
check 'Enable reCAPTCHA' check 'Enable reCAPTCHA'
fill_in 'reCAPTCHA Site Key', with: 'key' fill_in 'reCAPTCHA Site Key', with: 'key'
...@@ -252,7 +252,7 @@ feature 'Admin updates settings' do ...@@ -252,7 +252,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15) expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15)
end end
scenario 'Configure web terminal' do it 'Configure web terminal' do
page.within('.as-terminal') do page.within('.as-terminal') do
fill_in 'Max session time', with: 15 fill_in 'Max session time', with: 15
click_button 'Save changes' click_button 'Save changes'
...@@ -262,7 +262,7 @@ feature 'Admin updates settings' do ...@@ -262,7 +262,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.terminal_max_session_time).to eq(15) expect(Gitlab::CurrentSettings.terminal_max_session_time).to eq(15)
end end
scenario 'Enable outbound requests' do it 'Enable outbound requests' do
page.within('.as-outbound') do page.within('.as-outbound') do
check 'Allow requests to the local network from hooks and services' check 'Allow requests to the local network from hooks and services'
click_button 'Save changes' click_button 'Save changes'
...@@ -272,7 +272,7 @@ feature 'Admin updates settings' do ...@@ -272,7 +272,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.allow_local_requests_from_hooks_and_services).to be true expect(Gitlab::CurrentSettings.allow_local_requests_from_hooks_and_services).to be true
end end
scenario 'Change Slack Notifications Service template settings' do it 'Change Slack Notifications Service template settings' do
first(:link, 'Service Templates').click first(:link, 'Service Templates').click
click_link 'Slack notifications' click_link 'Slack notifications'
fill_in 'Webhook', with: 'http://localhost' fill_in 'Webhook', with: 'http://localhost'
...@@ -296,7 +296,7 @@ feature 'Admin updates settings' do ...@@ -296,7 +296,7 @@ feature 'Admin updates settings' do
expect(find('#service_push_channel').value).to eq '#test_channel' expect(find('#service_push_channel').value).to eq '#test_channel'
end end
scenario 'Change Keys settings' do it 'Change Keys settings' do
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
select 'Are forbidden', from: 'RSA SSH keys' select 'Are forbidden', from: 'RSA SSH keys'
select 'Are allowed', from: 'DSA SSH keys' select 'Are allowed', from: 'DSA SSH keys'
......
require 'rails_helper' require 'rails_helper'
feature 'Admin uses repository checks' do describe 'Admin uses repository checks' do
include StubENV include StubENV
before do before do
...@@ -8,7 +8,7 @@ feature 'Admin uses repository checks' do ...@@ -8,7 +8,7 @@ feature 'Admin uses repository checks' do
sign_in(create(:admin)) sign_in(create(:admin))
end end
scenario 'to trigger a single check' do it 'to trigger a single check' do
project = create(:project) project = create(:project)
visit_admin_project_page(project) visit_admin_project_page(project)
...@@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do ...@@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do
expect(page).to have_content('Repository check was triggered') expect(page).to have_content('Repository check was triggered')
end end
scenario 'to see a single failed repository check', :js do it 'to see a single failed repository check', :js do
project = create(:project) project = create(:project)
project.update_columns( project.update_columns(
last_repository_check_failed: true, last_repository_check_failed: true,
...@@ -32,7 +32,7 @@ feature 'Admin uses repository checks' do ...@@ -32,7 +32,7 @@ feature 'Admin uses repository checks' do
end end
end end
scenario 'to clear all repository checks', :js do it 'to clear all repository checks', :js do
visit admin_application_settings_path visit admin_application_settings_path
expect(RepositoryCheck::ClearWorker).to receive(:perform_async) expect(RepositoryCheck::ClearWorker).to receive(:perform_async)
......
require 'spec_helper' require 'spec_helper'
feature 'Contributions Calendar', :js do describe 'Contributions Calendar', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:contributed_project) { create(:project, :public, :repository) } let(:contributed_project) { create(:project, :public, :repository) }
let(:issue_note) { create(:note, project: contributed_project) } let(:issue_note) { create(:note, project: contributed_project) }
......
...@@ -16,7 +16,7 @@ describe "Container Registry", :js do ...@@ -16,7 +16,7 @@ describe "Container Registry", :js do
end end
context 'when there are no image repositories' do context 'when there are no image repositories' do
scenario 'user visits container registry main page' do it 'user visits container registry main page' do
visit_container_registry visit_container_registry
expect(page).to have_content 'No container images' expect(page).to have_content 'No container images'
...@@ -29,13 +29,13 @@ describe "Container Registry", :js do ...@@ -29,13 +29,13 @@ describe "Container Registry", :js do
project.container_repositories << container_repository project.container_repositories << container_repository
end end
scenario 'user wants to see multi-level container repository' do it 'user wants to see multi-level container repository' do
visit_container_registry visit_container_registry
expect(page).to have_content('my/image') expect(page).to have_content('my/image')
end end
scenario 'user removes entire container repository' do it 'user removes entire container repository' do
visit_container_registry visit_container_registry
expect_any_instance_of(ContainerRepository) expect_any_instance_of(ContainerRepository)
...@@ -44,7 +44,7 @@ describe "Container Registry", :js do ...@@ -44,7 +44,7 @@ describe "Container Registry", :js do
click_on(class: 'js-remove-repo') click_on(class: 'js-remove-repo')
end end
scenario 'user removes a specific tag from container repository' do it 'user removes a specific tag from container repository' do
visit_container_registry visit_container_registry
find('.js-toggle-repo').click find('.js-toggle-repo').click
......
require 'spec_helper' require 'spec_helper'
feature 'Cycle Analytics', :js do describe 'Cycle Analytics', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:guest) { create(:user) } let(:guest) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard > Activity' do describe 'Dashboard > Activity' do
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
...@@ -66,7 +66,7 @@ feature 'Dashboard > Activity' do ...@@ -66,7 +66,7 @@ feature 'Dashboard > Activity' do
wait_for_requests wait_for_requests
end end
scenario 'user should see all events' do it 'user should see all events' do
within '.content_list' do within '.content_list' do
expect(page).to have_content('pushed new branch') expect(page).to have_content('pushed new branch')
expect(page).to have_content('joined') expect(page).to have_content('joined')
...@@ -77,7 +77,7 @@ feature 'Dashboard > Activity' do ...@@ -77,7 +77,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user should see only pushed events' do it 'user should see only pushed events' do
click_link('Push events') click_link('Push events')
wait_for_requests wait_for_requests
...@@ -90,7 +90,7 @@ feature 'Dashboard > Activity' do ...@@ -90,7 +90,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user should see only merged events' do it 'user should see only merged events' do
click_link('Merge events') click_link('Merge events')
wait_for_requests wait_for_requests
...@@ -103,7 +103,7 @@ feature 'Dashboard > Activity' do ...@@ -103,7 +103,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user should see only issues events' do it 'user should see only issues events' do
click_link('Issue events') click_link('Issue events')
wait_for_requests wait_for_requests
...@@ -117,7 +117,7 @@ feature 'Dashboard > Activity' do ...@@ -117,7 +117,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user should see only comments events' do it 'user should see only comments events' do
click_link('Comments') click_link('Comments')
wait_for_requests wait_for_requests
...@@ -130,7 +130,7 @@ feature 'Dashboard > Activity' do ...@@ -130,7 +130,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user should see only joined events' do it 'user should see only joined events' do
click_link('Team') click_link('Team')
wait_for_requests wait_for_requests
...@@ -143,7 +143,7 @@ feature 'Dashboard > Activity' do ...@@ -143,7 +143,7 @@ feature 'Dashboard > Activity' do
end end
end end
scenario 'user see selected event after page reloading' do it 'user see selected event after page reloading' do
click_link('Push events') click_link('Push events')
wait_for_requests wait_for_requests
visit activity_dashboard_path visit activity_dashboard_path
......
require 'spec_helper' require 'spec_helper'
feature 'Tooltips on .timeago dates', :js do describe 'Tooltips on .timeago dates', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time } let(:created_date) { Date.yesterday.to_time }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard Groups page', :js do describe 'Dashboard Groups page', :js do
let(:user) { create :user } let(:user) { create :user }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:nested_group) { create(:group, :nested) } let(:nested_group) { create(:group, :nested) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard Issues filtering', :js do describe 'Dashboard Issues filtering', :js do
include Spec::Support::Helpers::Features::SortingHelpers include Spec::Support::Helpers::Features::SortingHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard Merge Requests' do describe 'Dashboard Merge Requests' do
include Spec::Support::Helpers::Features::SortingHelpers include Spec::Support::Helpers::Features::SortingHelpers
include FilterItemSelectHelper include FilterItemSelectHelper
include ProjectForksHelper include ProjectForksHelper
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard > milestone filter', :js do describe 'Dashboard > milestone filter', :js do
include FilterItemSelectHelper include FilterItemSelectHelper
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard > Milestones' do describe 'Dashboard > Milestones' do
describe 'as anonymous user' do describe 'as anonymous user' do
before do before do
visit dashboard_milestones_path visit dashboard_milestones_path
......
require 'spec_helper' require 'spec_helper'
feature 'Project member activity', :js do describe 'Project member activity', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) } let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard Projects' do describe 'Dashboard Projects' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository, name: 'awesome stuff') } let(:project) { create(:project, :repository, name: 'awesome stuff') }
let(:project2) { create(:project, :public, name: 'Community project') } let(:project2) { create(:project, :public, name: 'Community project') }
...@@ -121,7 +121,7 @@ feature 'Dashboard Projects' do ...@@ -121,7 +121,7 @@ feature 'Dashboard Projects' do
visit dashboard_projects_path visit dashboard_projects_path
end end
scenario 'shows "Create merge request" button' do it 'shows "Create merge request" button' do
expect(page).to have_content 'You pushed to feature' expect(page).to have_content 'You pushed to feature'
within('#content-body') do within('#content-body') do
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard shortcuts', :js do describe 'Dashboard shortcuts', :js do
context 'logged in' do context 'logged in' do
before do before do
sign_in(create(:user)) sign_in(create(:user))
visit root_dashboard_path visit root_dashboard_path
end end
scenario 'Navigate to tabs' do it 'Navigate to tabs' do
find('body').send_keys([:shift, 'I']) find('body').send_keys([:shift, 'I'])
check_page_title('Issues') check_page_title('Issues')
...@@ -31,7 +31,7 @@ feature 'Dashboard shortcuts', :js do ...@@ -31,7 +31,7 @@ feature 'Dashboard shortcuts', :js do
visit explore_root_path visit explore_root_path
end end
scenario 'Navigate to tabs' do it 'Navigate to tabs' do
find('body').send_keys([:shift, 'G']) find('body').send_keys([:shift, 'G'])
find('.nothing-here-block') find('.nothing-here-block')
......
require 'rails_helper' require 'rails_helper'
feature 'Dashboard > Todo target states' do describe 'Dashboard > Todo target states' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
...@@ -9,7 +9,7 @@ feature 'Dashboard > Todo target states' do ...@@ -9,7 +9,7 @@ feature 'Dashboard > Todo target states' do
sign_in(user) sign_in(user)
end end
scenario 'on a closed issue todo has closed label' do it 'on a closed issue todo has closed label' do
issue_closed = create(:issue, state: 'closed') issue_closed = create(:issue, state: 'closed')
create_todo issue_closed create_todo issue_closed
visit dashboard_todos_path visit dashboard_todos_path
...@@ -19,7 +19,7 @@ feature 'Dashboard > Todo target states' do ...@@ -19,7 +19,7 @@ feature 'Dashboard > Todo target states' do
end end
end end
scenario 'on an open issue todo does not have an open label' do it 'on an open issue todo does not have an open label' do
issue_open = create(:issue) issue_open = create(:issue)
create_todo issue_open create_todo issue_open
visit dashboard_todos_path visit dashboard_todos_path
...@@ -29,7 +29,7 @@ feature 'Dashboard > Todo target states' do ...@@ -29,7 +29,7 @@ feature 'Dashboard > Todo target states' do
end end
end end
scenario 'on a merged merge request todo has merged label' do it 'on a merged merge request todo has merged label' do
mr_merged = create(:merge_request, :simple, :merged, author: user) mr_merged = create(:merge_request, :simple, :merged, author: user)
create_todo mr_merged create_todo mr_merged
visit dashboard_todos_path visit dashboard_todos_path
...@@ -39,7 +39,7 @@ feature 'Dashboard > Todo target states' do ...@@ -39,7 +39,7 @@ feature 'Dashboard > Todo target states' do
end end
end end
scenario 'on a closed merge request todo has closed label' do it 'on a closed merge request todo has closed label' do
mr_closed = create(:merge_request, :simple, :closed, author: user) mr_closed = create(:merge_request, :simple, :closed, author: user)
create_todo mr_closed create_todo mr_closed
visit dashboard_todos_path visit dashboard_todos_path
...@@ -49,7 +49,7 @@ feature 'Dashboard > Todo target states' do ...@@ -49,7 +49,7 @@ feature 'Dashboard > Todo target states' do
end end
end end
scenario 'on an open merge request todo does not have an open label' do it 'on an open merge request todo does not have an open label' do
mr_open = create(:merge_request, :simple, author: user) mr_open = create(:merge_request, :simple, author: user)
create_todo mr_open create_todo mr_open
visit dashboard_todos_path visit dashboard_todos_path
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard > User filters todos', :js do describe 'Dashboard > User filters todos', :js do
let(:user_1) { create(:user, username: 'user_1', name: 'user_1') } let(:user_1) { create(:user, username: 'user_1', name: 'user_1') }
let(:user_2) { create(:user, username: 'user_2', name: 'user_2') } let(:user_2) { create(:user, username: 'user_2', name: 'user_2') }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard > User sorts todos' do describe 'Dashboard > User sorts todos' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard Todos' do describe 'Dashboard Todos' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'Expand and collapse diffs', :js do describe 'Expand and collapse diffs', :js do
let(:branch) { 'expand-collapse-diffs' } let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'spec_helper' require 'spec_helper'
feature 'Top Plus Menu', :js do describe 'Top Plus Menu', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) }
...@@ -15,7 +15,7 @@ feature 'Top Plus Menu', :js do ...@@ -15,7 +15,7 @@ feature 'Top Plus Menu', :js do
sign_in(user) sign_in(user)
end end
scenario 'click on New project shows new project page' do it 'click on New project shows new project page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New project") click_topmenuitem("New project")
...@@ -24,7 +24,7 @@ feature 'Top Plus Menu', :js do ...@@ -24,7 +24,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Project name') expect(page).to have_content('Project name')
end end
scenario 'click on New group shows new group page' do it 'click on New group shows new group page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New group") click_topmenuitem("New group")
...@@ -33,7 +33,7 @@ feature 'Top Plus Menu', :js do ...@@ -33,7 +33,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Group name') expect(page).to have_content('Group name')
end end
scenario 'click on New snippet shows new snippet page' do it 'click on New snippet shows new snippet page' do
visit root_dashboard_path visit root_dashboard_path
click_topmenuitem("New snippet") click_topmenuitem("New snippet")
...@@ -42,7 +42,7 @@ feature 'Top Plus Menu', :js do ...@@ -42,7 +42,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title') expect(page).to have_content('Title')
end end
scenario 'click on New issue shows new issue page' do it 'click on New issue shows new issue page' do
visit project_path(project) visit project_path(project)
click_topmenuitem("New issue") click_topmenuitem("New issue")
...@@ -51,7 +51,7 @@ feature 'Top Plus Menu', :js do ...@@ -51,7 +51,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title') expect(page).to have_content('Title')
end end
scenario 'click on New merge request shows new merge request page' do it 'click on New merge request shows new merge request page' do
visit project_path(project) visit project_path(project)
click_topmenuitem("New merge request") click_topmenuitem("New merge request")
...@@ -61,7 +61,7 @@ feature 'Top Plus Menu', :js do ...@@ -61,7 +61,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Target branch') expect(page).to have_content('Target branch')
end end
scenario 'click on New project snippet shows new snippet page' do it 'click on New project snippet shows new snippet page' do
visit project_path(project) visit project_path(project)
page.within '.header-content' do page.within '.header-content' do
...@@ -74,7 +74,7 @@ feature 'Top Plus Menu', :js do ...@@ -74,7 +74,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title') expect(page).to have_content('Title')
end end
scenario 'Click on New subgroup shows new group page', :nested_groups do it 'Click on New subgroup shows new group page', :nested_groups do
visit group_path(group) visit group_path(group)
click_topmenuitem("New subgroup") click_topmenuitem("New subgroup")
...@@ -83,7 +83,7 @@ feature 'Top Plus Menu', :js do ...@@ -83,7 +83,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Group name') expect(page).to have_content('Group name')
end end
scenario 'Click on New project in group shows new project page' do it 'Click on New project in group shows new project page' do
visit group_path(group) visit group_path(group)
page.within '.header-content' do page.within '.header-content' do
...@@ -107,7 +107,7 @@ feature 'Top Plus Menu', :js do ...@@ -107,7 +107,7 @@ feature 'Top Plus Menu', :js do
sign_in(guest_user) sign_in(guest_user)
end end
scenario 'click on New issue shows new issue page' do it 'click on New issue shows new issue page' do
visit project_path(project) visit project_path(project)
click_topmenuitem("New issue") click_topmenuitem("New issue")
...@@ -116,37 +116,37 @@ feature 'Top Plus Menu', :js do ...@@ -116,37 +116,37 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title') expect(page).to have_content('Title')
end end
scenario 'has no New merge request menu item' do it 'has no New merge request menu item' do
visit project_path(project) visit project_path(project)
hasnot_topmenuitem("New merge request") hasnot_topmenuitem("New merge request")
end end
scenario 'has no New project snippet menu item' do it 'has no New project snippet menu item' do
visit project_path(project) visit project_path(project)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet') expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
end end
scenario 'public project has no New merge request menu item' do it 'public project has no New merge request menu item' do
visit project_path(public_project) visit project_path(public_project)
hasnot_topmenuitem("New merge request") hasnot_topmenuitem("New merge request")
end end
scenario 'public project has no New project snippet menu item' do it 'public project has no New project snippet menu item' do
visit project_path(public_project) visit project_path(public_project)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet') expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
end end
scenario 'has no New subgroup menu item' do it 'has no New subgroup menu item' do
visit group_path(group) visit group_path(group)
hasnot_topmenuitem("New subgroup") hasnot_topmenuitem("New subgroup")
end end
scenario 'has no New project for group menu item' do it 'has no New project for group menu item' do
visit group_path(group) visit group_path(group)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-group-project') expect(find('.header-new.dropdown')).not_to have_selector('.header-new-group-project')
......
require 'spec_helper' require 'spec_helper'
feature 'Global search' do describe 'Global search' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
feature 'Group variables', :js do describe 'Group variables', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:variable) { create(:ci_group_variable, key: 'test_key', value: 'test value', group: group) } let!(:variable) { create(:ci_group_variable, key: 'test_key', value: 'test value', group: group) }
let(:page_path) { group_settings_ci_cd_path(group) } let(:page_path) { group_settings_ci_cd_path(group) }
background do before do
group.add_master(user) group.add_master(user)
gitlab_sign_in(user) gitlab_sign_in(user)
......
require 'spec_helper' require 'spec_helper'
feature 'Group activity page' do describe 'Group activity page' do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:path) { activity_group_path(group) } let(:path) { activity_group_path(group) }
......
require 'spec_helper' require 'spec_helper'
feature 'Group empty states' do describe 'Group empty states' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
......
require 'spec_helper' require 'spec_helper'
feature 'Edit group settings' do describe 'Edit group settings' do
given(:user) { create(:user) } let(:user) { create(:user) }
given(:group) { create(:group, path: 'foo') } let(:group) { create(:group, path: 'foo') }
background do before do
group.add_owner(user) group.add_owner(user)
sign_in(user) sign_in(user)
end end
...@@ -14,14 +14,14 @@ feature 'Edit group settings' do ...@@ -14,14 +14,14 @@ feature 'Edit group settings' do
let(:old_group_full_path) { "/#{group.path}" } let(:old_group_full_path) { "/#{group.path}" }
let(:new_group_full_path) { "/#{new_group_path}" } let(:new_group_full_path) { "/#{new_group_path}" }
scenario 'the group is accessible via the new path' do it 'the group is accessible via the new path' do
update_path(new_group_path) update_path(new_group_path)
visit new_group_full_path visit new_group_full_path
expect(current_path).to eq(new_group_full_path) expect(current_path).to eq(new_group_full_path)
expect(find('h1.group-title')).to have_content(group.name) expect(find('h1.group-title')).to have_content(group.name)
end end
scenario 'the old group path redirects to the new path' do it 'the old group path redirects to the new path' do
update_path(new_group_path) update_path(new_group_path)
visit old_group_full_path visit old_group_full_path
expect(current_path).to eq(new_group_full_path) expect(current_path).to eq(new_group_full_path)
...@@ -29,18 +29,18 @@ feature 'Edit group settings' do ...@@ -29,18 +29,18 @@ feature 'Edit group settings' do
end end
context 'with a subgroup' do context 'with a subgroup' do
given!(:subgroup) { create(:group, parent: group, path: 'subgroup') } let!(:subgroup) { create(:group, parent: group, path: 'subgroup') }
given(:old_subgroup_full_path) { "/#{group.path}/#{subgroup.path}" } let(:old_subgroup_full_path) { "/#{group.path}/#{subgroup.path}" }
given(:new_subgroup_full_path) { "/#{new_group_path}/#{subgroup.path}" } let(:new_subgroup_full_path) { "/#{new_group_path}/#{subgroup.path}" }
scenario 'the subgroup is accessible via the new path' do it 'the subgroup is accessible via the new path' do
update_path(new_group_path) update_path(new_group_path)
visit new_subgroup_full_path visit new_subgroup_full_path
expect(current_path).to eq(new_subgroup_full_path) expect(current_path).to eq(new_subgroup_full_path)
expect(find('h1.group-title')).to have_content(subgroup.name) expect(find('h1.group-title')).to have_content(subgroup.name)
end end
scenario 'the old subgroup path redirects to the new path' do it 'the old subgroup path redirects to the new path' do
update_path(new_group_path) update_path(new_group_path)
visit old_subgroup_full_path visit old_subgroup_full_path
expect(current_path).to eq(new_subgroup_full_path) expect(current_path).to eq(new_subgroup_full_path)
...@@ -49,9 +49,9 @@ feature 'Edit group settings' do ...@@ -49,9 +49,9 @@ feature 'Edit group settings' do
end end
context 'with a project' do context 'with a project' do
given!(:project) { create(:project, group: group) } let!(:project) { create(:project, group: group) }
given(:old_project_full_path) { "/#{group.path}/#{project.path}" } let(:old_project_full_path) { "/#{group.path}/#{project.path}" }
given(:new_project_full_path) { "/#{new_group_path}/#{project.path}" } let(:new_project_full_path) { "/#{new_group_path}/#{project.path}" }
before(:context) do before(:context) do
TestEnv.clean_test_path TestEnv.clean_test_path
...@@ -61,14 +61,14 @@ feature 'Edit group settings' do ...@@ -61,14 +61,14 @@ feature 'Edit group settings' do
TestEnv.clean_test_path TestEnv.clean_test_path
end end
scenario 'the project is accessible via the new path' do it 'the project is accessible via the new path' do
update_path(new_group_path) update_path(new_group_path)
visit new_project_full_path visit new_project_full_path
expect(current_path).to eq(new_project_full_path) expect(current_path).to eq(new_project_full_path)
expect(find('.breadcrumbs')).to have_content(project.path) expect(find('.breadcrumbs')).to have_content(project.path)
end end
scenario 'the old project path redirects to the new path' do it 'the old project path redirects to the new path' do
update_path(new_group_path) update_path(new_group_path)
visit old_project_full_path visit old_project_full_path
expect(current_path).to eq(new_project_full_path) expect(current_path).to eq(new_project_full_path)
......
require 'spec_helper' require 'spec_helper'
feature 'Group issues page' do describe 'Group issues page' do
include FilteredSearchHelpers include FilteredSearchHelpers
let(:group) { create(:group) } let(:group) { create(:group) }
......
require 'spec_helper' require 'spec_helper'
feature 'Edit group label' do describe 'Edit group label' do
given(:user) { create(:user) } let(:user) { create(:user) }
given(:group) { create(:group) } let(:group) { create(:group) }
given(:label) { create(:group_label, group: group) } let(:label) { create(:group_label, group: group) }
background do before do
group.add_owner(user) group.add_owner(user)
sign_in(user) sign_in(user)
visit edit_group_label_path(group, label) visit edit_group_label_path(group, label)
end end
scenario 'update label with new title' do it 'update label with new title' do
fill_in 'label_title', with: 'new label name' fill_in 'label_title', with: 'new label name'
click_button 'Save changes' click_button 'Save changes'
......
require 'spec_helper' require 'spec_helper'
feature 'Group labels' do describe 'Group labels' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:label) { create(:group_label, group: group) } let!(:label) { create(:group_label, group: group) }
background do before do
group.add_owner(user) group.add_owner(user)
sign_in(user) sign_in(user)
visit group_labels_path(group) visit group_labels_path(group)
end end
scenario 'label has edit button', :js do it 'label has edit button', :js do
expect(page).to have_selector('.label-action.edit') expect(page).to have_selector('.label-action.edit')
end end
end end
require 'spec_helper' require 'spec_helper'
feature 'Labels subscription' do describe 'Labels subscription' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:feature) { create(:group_label, group: group, title: 'feature') } let!(:feature) { create(:group_label, group: group, title: 'feature') }
...@@ -11,7 +11,7 @@ feature 'Labels subscription' do ...@@ -11,7 +11,7 @@ feature 'Labels subscription' do
gitlab_sign_in user gitlab_sign_in user
end end
scenario 'users can subscribe/unsubscribe to group labels', :js do it 'users can subscribe/unsubscribe to group labels', :js do
visit group_labels_path(group) visit group_labels_path(group)
expect(page).to have_content('feature') expect(page).to have_content('feature')
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Labels > User sees links to issuables' do describe 'Groups > Labels > User sees links to issuables' do
set(:group) { create(:group, :public) } set(:group) { create(:group, :public) }
before do before do
...@@ -8,7 +8,7 @@ feature 'Groups > Labels > User sees links to issuables' do ...@@ -8,7 +8,7 @@ feature 'Groups > Labels > User sees links to issuables' do
visit group_labels_path(group) visit group_labels_path(group)
end end
scenario 'shows links to MRs and issues' do it 'shows links to MRs and issues' do
expect(page).to have_link('view merge requests') expect(page).to have_link('view merge requests')
expect(page).to have_link('view open issues') expect(page).to have_link('view open issues')
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Filter members' do describe 'Groups > Members > Filter members' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user_with_2fa) { create(:user, :two_factor_via_otp) } let(:user_with_2fa) { create(:user, :two_factor_via_otp) }
let(:group) { create(:group) } let(:group) { create(:group) }
background do before do
group.add_owner(user) group.add_owner(user)
group.add_master(user_with_2fa) group.add_master(user_with_2fa)
sign_in(user) sign_in(user)
end end
scenario 'shows all members' do it 'shows all members' do
visit_members_list visit_members_list
expect(first_member).to include(user.name) expect(first_member).to include(user.name)
...@@ -20,7 +20,7 @@ feature 'Groups > Members > Filter members' do ...@@ -20,7 +20,7 @@ feature 'Groups > Members > Filter members' do
expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: '2FA: Everyone') expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: '2FA: Everyone')
end end
scenario 'shows only 2FA members' do it 'shows only 2FA members' do
visit_members_list(two_factor: 'enabled') visit_members_list(two_factor: 'enabled')
expect(first_member).to include(user_with_2fa.name) expect(first_member).to include(user_with_2fa.name)
...@@ -28,7 +28,7 @@ feature 'Groups > Members > Filter members' do ...@@ -28,7 +28,7 @@ feature 'Groups > Members > Filter members' do
expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: '2FA: Enabled') expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: '2FA: Enabled')
end end
scenario 'shows only non 2FA members' do it 'shows only non 2FA members' do
visit_members_list(two_factor: 'disabled') visit_members_list(two_factor: 'disabled')
expect(first_member).to include(user.name) expect(first_member).to include(user.name)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Leave group' do describe 'Groups > Members > Leave group' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:other_user) { create(:user) } let(:other_user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
background do before do
gitlab_sign_in(user) gitlab_sign_in(user)
end end
scenario 'guest leaves the group' do it 'guest leaves the group' do
group.add_guest(user) group.add_guest(user)
group.add_owner(other_user) group.add_owner(other_user)
...@@ -21,7 +21,7 @@ feature 'Groups > Members > Leave group' do ...@@ -21,7 +21,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user) expect(group.users).not_to include(user)
end end
scenario 'guest leaves the group as last member' do it 'guest leaves the group as last member' do
group.add_guest(user) group.add_guest(user)
visit group_path(group) visit group_path(group)
...@@ -32,7 +32,7 @@ feature 'Groups > Members > Leave group' do ...@@ -32,7 +32,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user) expect(group.users).not_to include(user)
end end
scenario 'owner leaves the group if they is not the last owner' do it 'owner leaves the group if they is not the last owner' do
group.add_owner(user) group.add_owner(user)
group.add_owner(other_user) group.add_owner(other_user)
...@@ -44,7 +44,7 @@ feature 'Groups > Members > Leave group' do ...@@ -44,7 +44,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user) expect(group.users).not_to include(user)
end end
scenario 'owner can not leave the group if they is a last owner' do it 'owner can not leave the group if they is a last owner' do
group.add_owner(user) group.add_owner(user)
visit group_path(group) visit group_path(group)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > List members' do describe 'Groups > Members > List members' do
include Select2Helper include Select2Helper
let(:user1) { create(:user, name: 'John Doe') } let(:user1) { create(:user, name: 'John Doe') }
...@@ -8,11 +8,11 @@ feature 'Groups > Members > List members' do ...@@ -8,11 +8,11 @@ feature 'Groups > Members > List members' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:nested_group) { create(:group, parent: group) } let(:nested_group) { create(:group, parent: group) }
background do before do
gitlab_sign_in(user1) gitlab_sign_in(user1)
end end
scenario 'show members from current group and parent', :nested_groups do it 'show members from current group and parent', :nested_groups do
group.add_developer(user1) group.add_developer(user1)
nested_group.add_developer(user2) nested_group.add_developer(user2)
...@@ -22,7 +22,7 @@ feature 'Groups > Members > List members' do ...@@ -22,7 +22,7 @@ feature 'Groups > Members > List members' do
expect(second_row.text).to include(user2.name) expect(second_row.text).to include(user2.name)
end end
scenario 'show user once if member of both current group and parent', :nested_groups do it 'show user once if member of both current group and parent', :nested_groups do
group.add_developer(user1) group.add_developer(user1)
nested_group.add_developer(user1) nested_group.add_developer(user1)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Manage members' do describe 'Groups > Members > Manage members' do
include Select2Helper include Select2Helper
let(:user1) { create(:user, name: 'John Doe') } let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') } let(:user2) { create(:user, name: 'Mary Jane') }
let(:group) { create(:group) } let(:group) { create(:group) }
background do before do
sign_in(user1) sign_in(user1)
end end
scenario 'update user to owner level', :js do it 'update user to owner level', :js do
group.add_owner(user1) group.add_owner(user1)
group.add_developer(user2) group.add_developer(user2)
...@@ -25,7 +25,7 @@ feature 'Groups > Members > Manage members' do ...@@ -25,7 +25,7 @@ feature 'Groups > Members > Manage members' do
end end
end end
scenario 'add user to group', :js do it 'add user to group', :js do
group.add_owner(user1) group.add_owner(user1)
visit group_group_members_path(group) visit group_group_members_path(group)
...@@ -38,7 +38,7 @@ feature 'Groups > Members > Manage members' do ...@@ -38,7 +38,7 @@ feature 'Groups > Members > Manage members' do
end end
end end
scenario 'do not disclose email addresses', :js do it 'do not disclose email addresses', :js do
group.add_owner(user1) group.add_owner(user1)
create(:user, email: 'undisclosed_email@gitlab.com', name: "Jane 'invisible' Doe") create(:user, email: 'undisclosed_email@gitlab.com', name: "Jane 'invisible' Doe")
...@@ -59,7 +59,7 @@ feature 'Groups > Members > Manage members' do ...@@ -59,7 +59,7 @@ feature 'Groups > Members > Manage members' do
expect(page).to have_content("Jane 'invisible' Doe") expect(page).to have_content("Jane 'invisible' Doe")
end end
scenario 'remove user from group', :js do it 'remove user from group', :js do
group.add_owner(user1) group.add_owner(user1)
group.add_developer(user2) group.add_developer(user2)
...@@ -75,7 +75,7 @@ feature 'Groups > Members > Manage members' do ...@@ -75,7 +75,7 @@ feature 'Groups > Members > Manage members' do
expect(group.users).not_to include(user2) expect(group.users).not_to include(user2)
end end
scenario 'add yourself to group when already an owner', :js do it 'add yourself to group when already an owner', :js do
group.add_owner(user1) group.add_owner(user1)
visit group_group_members_path(group) visit group_group_members_path(group)
...@@ -88,7 +88,7 @@ feature 'Groups > Members > Manage members' do ...@@ -88,7 +88,7 @@ feature 'Groups > Members > Manage members' do
end end
end end
scenario 'invite user to group', :js do it 'invite user to group', :js do
group.add_owner(user1) group.add_owner(user1)
visit group_group_members_path(group) visit group_group_members_path(group)
...@@ -102,7 +102,7 @@ feature 'Groups > Members > Manage members' do ...@@ -102,7 +102,7 @@ feature 'Groups > Members > Manage members' do
end end
end end
scenario 'guest can not manage other users' do it 'guest can not manage other users' do
group.add_guest(user1) group.add_guest(user1)
group.add_developer(user2) group.add_developer(user2)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Master manages access requests' do describe 'Groups > Members > Master manages access requests' do
it_behaves_like 'Master manages access requests' do it_behaves_like 'Master manages access requests' do
let(:entity) { create(:group, :public, :access_requestable) } let(:entity) { create(:group, :public, :access_requestable) }
let(:members_page_path) { group_group_members_path(entity) } let(:members_page_path) { group_group_members_path(entity) }
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Request access' do describe 'Groups > Members > Request access' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:owner) { create(:user) } let(:owner) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) } let(:group) { create(:group, :public, :access_requestable) }
let!(:project) { create(:project, :private, namespace: group) } let!(:project) { create(:project, :private, namespace: group) }
background do before do
group.add_owner(owner) group.add_owner(owner)
sign_in(user) sign_in(user)
visit group_path(group) visit group_path(group)
end end
scenario 'request access feature is disabled' do it 'request access feature is disabled' do
group.update_attributes(request_access_enabled: false) group.update_attributes(request_access_enabled: false)
visit group_path(group) visit group_path(group)
expect(page).not_to have_content 'Request Access' expect(page).not_to have_content 'Request Access'
end end
scenario 'user can request access to a group' do it 'user can request access to a group' do
perform_enqueued_jobs { click_link 'Request Access' } perform_enqueued_jobs { click_link 'Request Access' }
expect(ActionMailer::Base.deliveries.last.to).to eq [owner.notification_email] expect(ActionMailer::Base.deliveries.last.to).to eq [owner.notification_email]
...@@ -32,13 +32,13 @@ feature 'Groups > Members > Request access' do ...@@ -32,13 +32,13 @@ feature 'Groups > Members > Request access' do
expect(page).not_to have_content 'Leave group' expect(page).not_to have_content 'Leave group'
end end
scenario 'user does not see private projects' do it 'user does not see private projects' do
perform_enqueued_jobs { click_link 'Request Access' } perform_enqueued_jobs { click_link 'Request Access' }
expect(page).not_to have_content project.name expect(page).not_to have_content project.name
end end
scenario 'user does not see group in the Dashboard > Groups page' do it 'user does not see group in the Dashboard > Groups page' do
perform_enqueued_jobs { click_link 'Request Access' } perform_enqueued_jobs { click_link 'Request Access' }
visit dashboard_groups_path visit dashboard_groups_path
...@@ -46,7 +46,7 @@ feature 'Groups > Members > Request access' do ...@@ -46,7 +46,7 @@ feature 'Groups > Members > Request access' do
expect(page).not_to have_content group.name expect(page).not_to have_content group.name
end end
scenario 'user is not listed in the group members page' do it 'user is not listed in the group members page' do
click_link 'Request Access' click_link 'Request Access'
expect(group.requesters.exists?(user_id: user)).to be_truthy expect(group.requesters.exists?(user_id: user)).to be_truthy
...@@ -58,7 +58,7 @@ feature 'Groups > Members > Request access' do ...@@ -58,7 +58,7 @@ feature 'Groups > Members > Request access' do
end end
end end
scenario 'user can withdraw its request for access' do it 'user can withdraw its request for access' do
click_link 'Request Access' click_link 'Request Access'
expect(group.requesters.exists?(user_id: user)).to be_truthy expect(group.requesters.exists?(user_id: user)).to be_truthy
...@@ -69,7 +69,7 @@ feature 'Groups > Members > Request access' do ...@@ -69,7 +69,7 @@ feature 'Groups > Members > Request access' do
expect(page).to have_content 'Your access request to the group has been withdrawn.' expect(page).to have_content 'Your access request to the group has been withdrawn.'
end end
scenario 'member does not see the request access button' do it 'member does not see the request access button' do
group.add_owner(user) group.add_owner(user)
visit group_path(group) visit group_path(group)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Sort members' do describe 'Groups > Members > Sort members' do
let(:owner) { create(:user, name: 'John Doe') } let(:owner) { create(:user, name: 'John Doe') }
let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) } let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) }
let(:group) { create(:group) } let(:group) { create(:group) }
background do before do
create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago) create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago)
create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago) create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago)
sign_in(owner) sign_in(owner)
end end
scenario 'sorts alphabetically by default' do it 'sorts alphabetically by default' do
visit_members_list(sort: nil) visit_members_list(sort: nil)
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
...@@ -20,7 +20,7 @@ feature 'Groups > Members > Sort members' do ...@@ -20,7 +20,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by access level ascending' do it 'sorts by access level ascending' do
visit_members_list(sort: :access_level_asc) visit_members_list(sort: :access_level_asc)
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
...@@ -28,7 +28,7 @@ feature 'Groups > Members > Sort members' do ...@@ -28,7 +28,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, ascending') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, ascending')
end end
scenario 'sorts by access level descending' do it 'sorts by access level descending' do
visit_members_list(sort: :access_level_desc) visit_members_list(sort: :access_level_desc)
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
...@@ -36,7 +36,7 @@ feature 'Groups > Members > Sort members' do ...@@ -36,7 +36,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, descending') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, descending')
end end
scenario 'sorts by last joined' do it 'sorts by last joined' do
visit_members_list(sort: :last_joined) visit_members_list(sort: :last_joined)
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
...@@ -44,7 +44,7 @@ feature 'Groups > Members > Sort members' do ...@@ -44,7 +44,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined')
end end
scenario 'sorts by oldest joined' do it 'sorts by oldest joined' do
visit_members_list(sort: :oldest_joined) visit_members_list(sort: :oldest_joined)
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
...@@ -52,7 +52,7 @@ feature 'Groups > Members > Sort members' do ...@@ -52,7 +52,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined')
end end
scenario 'sorts by name ascending' do it 'sorts by name ascending' do
visit_members_list(sort: :name_asc) visit_members_list(sort: :name_asc)
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
...@@ -60,7 +60,7 @@ feature 'Groups > Members > Sort members' do ...@@ -60,7 +60,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by name descending' do it 'sorts by name descending' do
visit_members_list(sort: :name_desc) visit_members_list(sort: :name_desc)
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
...@@ -68,7 +68,7 @@ feature 'Groups > Members > Sort members' do ...@@ -68,7 +68,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
end end
scenario 'sorts by recent sign in', :clean_gitlab_redis_shared_state do it 'sorts by recent sign in', :clean_gitlab_redis_shared_state do
visit_members_list(sort: :recent_sign_in) visit_members_list(sort: :recent_sign_in)
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
...@@ -76,7 +76,7 @@ feature 'Groups > Members > Sort members' do ...@@ -76,7 +76,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in') expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in')
end end
scenario 'sorts by oldest sign in', :clean_gitlab_redis_shared_state do it 'sorts by oldest sign in', :clean_gitlab_redis_shared_state do
visit_members_list(sort: :oldest_sign_in) visit_members_list(sort: :oldest_sign_in)
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
......
require 'spec_helper' require 'spec_helper'
feature 'Group merge requests page' do describe 'Group merge requests page' do
include FilteredSearchHelpers include FilteredSearchHelpers
let(:path) { merge_requests_group_path(group) } let(:path) { merge_requests_group_path(group) }
......
require 'rails_helper' require 'rails_helper'
feature 'Group milestones' do describe 'Group milestones' do
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:project) { create(:project_empty_repo, group: group) } let!(:project) { create(:project_empty_repo, group: group) }
let(:user) { create(:group_member, :master, user: create(:user), group: group ).user } let(:user) { create(:group_member, :master, user: create(:user), group: group ).user }
......
require 'spec_helper' require 'spec_helper'
feature 'Milestones sorting', :js do describe 'Milestones sorting', :js do
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:project) { create(:project_empty_repo, group: group) } let!(:project) { create(:project_empty_repo, group: group) }
let!(:other_project) { create(:project_empty_repo, group: group) } let!(:other_project) { create(:project_empty_repo, group: group) }
...@@ -15,7 +15,7 @@ feature 'Milestones sorting', :js do ...@@ -15,7 +15,7 @@ feature 'Milestones sorting', :js do
sign_in(user) sign_in(user)
end end
scenario 'visit group milestones and sort by due_date_asc' do it 'visit group milestones and sort by due_date_asc' do
visit group_milestones_path(group) visit group_milestones_path(group)
expect(page).to have_button('Due soon') expect(page).to have_button('Due soon')
......
require 'spec_helper' require 'spec_helper'
feature 'Group Badges' do describe 'Group Badges' do
include WaitForRequests include WaitForRequests
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Group share with group lock' do describe 'Group share with group lock' do
given(:root_owner) { create(:user) } let(:root_owner) { create(:user) }
given(:root_group) { create(:group) } let(:root_group) { create(:group) }
background do before do
root_group.add_owner(root_owner) root_group.add_owner(root_owner)
sign_in(root_owner) sign_in(root_owner)
end end
context 'with a subgroup', :nested_groups do context 'with a subgroup', :nested_groups do
given!(:subgroup) { create(:group, parent: root_group) } let!(:subgroup) { create(:group, parent: root_group) }
context 'when enabling the parent group share with group lock' do context 'when enabling the parent group share with group lock' do
scenario 'the subgroup share with group lock becomes enabled' do it 'the subgroup share with group lock becomes enabled' do
visit edit_group_path(root_group) visit edit_group_path(root_group)
enable_group_lock enable_group_lock
...@@ -23,14 +23,14 @@ feature 'Group share with group lock' do ...@@ -23,14 +23,14 @@ feature 'Group share with group lock' do
end end
context 'when disabling the parent group share with group lock (which was already enabled)' do context 'when disabling the parent group share with group lock (which was already enabled)' do
background do before do
visit edit_group_path(root_group) visit edit_group_path(root_group)
enable_group_lock enable_group_lock
end end
context 'and the subgroup share with group lock is enabled' do context 'and the subgroup share with group lock is enabled' do
scenario 'the subgroup share with group lock does not change' do it 'the subgroup share with group lock does not change' do
visit edit_group_path(root_group) visit edit_group_path(root_group)
disable_group_lock disable_group_lock
...@@ -40,13 +40,13 @@ feature 'Group share with group lock' do ...@@ -40,13 +40,13 @@ feature 'Group share with group lock' do
end end
context 'but the subgroup share with group lock is disabled' do context 'but the subgroup share with group lock is disabled' do
background do before do
visit edit_group_path(subgroup) visit edit_group_path(subgroup)
disable_group_lock disable_group_lock
end end
scenario 'the subgroup share with group lock does not change' do it 'the subgroup share with group lock does not change' do
visit edit_group_path(root_group) visit edit_group_path(root_group)
disable_group_lock disable_group_lock
......
require 'spec_helper' require 'spec_helper'
feature 'Group show page' do describe 'Group show page' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:path) { group_path(group) } let(:path) { group_path(group) }
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > User sees users dropdowns in issuables list' do describe 'Groups > User sees users dropdowns in issuables list' do
let(:entity) { create(:group) } let(:entity) { create(:group) }
let(:user_in_dropdown) { create(:user) } let(:user_in_dropdown) { create(:user) }
let!(:user_not_in_dropdown) { create(:user) } let!(:user_not_in_dropdown) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Group' do describe 'Group' do
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Blob shortcuts', :js do describe 'Blob shortcuts', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
let(:issue) { create(:issue, project: project, author: user) } let(:issue) { create(:issue, project: project, author: user) }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue awards', :js do describe 'Issue awards', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
require 'rails_helper' require 'rails_helper'
feature 'Issues > Labels bulk assignment' do describe 'Issues > Labels bulk assignment' do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") } let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
......
require 'rails_helper' require 'rails_helper'
feature 'Resolving all open discussions in a merge request from an issue', :js do describe 'Resolving all open discussions in a merge request from an issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'rails_helper' require 'rails_helper'
feature 'Resolve an open discussion in a merge request by creating an issue', :js do describe 'Resolve an open discussion in a merge request by creating an issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) } let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'rails_helper' require 'rails_helper'
feature 'GFM autocomplete', :js do describe 'GFM autocomplete', :js do
let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:label) { create(:label, project: project, title: 'special+') } let(:label) { create(:label, project: project, title: 'special+') }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue Detail', :js do describe 'Issue Detail', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project, author: user) } let(:issue) { create(:issue, project: project, author: user) }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue Sidebar' do describe 'Issue Sidebar' do
include MobileHelpers include MobileHelpers
let(:group) { create(:group, :nested) } let(:group) { create(:group, :nested) }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue markdown toolbar', :js do describe 'Issue markdown toolbar', :js do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'rails_helper' require 'rails_helper'
feature 'issue move to another project' do describe 'issue move to another project' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:old_project) { create(:project, :repository) } let(:old_project) { create(:project, :repository) }
let(:text) { 'Some issue description' } let(:text) { 'Some issue description' }
...@@ -9,16 +9,18 @@ feature 'issue move to another project' do ...@@ -9,16 +9,18 @@ feature 'issue move to another project' do
create(:issue, description: text, project: old_project, author: user) create(:issue, description: text, project: old_project, author: user)
end end
background { sign_in(user) } before do
sign_in(user)
end
context 'user does not have permission to move issue' do context 'user does not have permission to move issue' do
background do before do
old_project.add_guest(user) old_project.add_guest(user)
visit issue_path(issue) visit issue_path(issue)
end end
scenario 'moving issue to another project not allowed' do it 'moving issue to another project not allowed' do
expect(page).to have_no_selector('.js-sidebar-move-issue-block') expect(page).to have_no_selector('.js-sidebar-move-issue-block')
end end
end end
...@@ -30,14 +32,14 @@ feature 'issue move to another project' do ...@@ -30,14 +32,14 @@ feature 'issue move to another project' do
let(:text) { "Text with #{mr.to_reference}" } let(:text) { "Text with #{mr.to_reference}" }
let(:cross_reference) { old_project.to_reference(new_project) } let(:cross_reference) { old_project.to_reference(new_project) }
background do before do
old_project.add_reporter(user) old_project.add_reporter(user)
new_project.add_reporter(user) new_project.add_reporter(user)
visit issue_path(issue) visit issue_path(issue)
end end
scenario 'moving issue to another project', :js do it 'moving issue to another project', :js do
find('.js-move-issue').click find('.js-move-issue').click
wait_for_requests wait_for_requests
all('.js-move-issue-dropdown-item')[0].click all('.js-move-issue-dropdown-item')[0].click
...@@ -49,7 +51,7 @@ feature 'issue move to another project' do ...@@ -49,7 +51,7 @@ feature 'issue move to another project' do
expect(page.current_path).to include project_path(new_project) expect(page.current_path).to include project_path(new_project)
end end
scenario 'searching project dropdown', :js do it 'searching project dropdown', :js do
new_project_search.add_reporter(user) new_project_search.add_reporter(user)
find('.js-move-issue').click find('.js-move-issue').click
...@@ -66,9 +68,11 @@ feature 'issue move to another project' do ...@@ -66,9 +68,11 @@ feature 'issue move to another project' do
context 'user does not have permission to move the issue to a project', :js do context 'user does not have permission to move the issue to a project', :js do
let!(:private_project) { create(:project, :private) } let!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) } let(:another_project) { create(:project) }
background { another_project.add_guest(user) } before do
another_project.add_guest(user)
end
scenario 'browsing projects in projects select' do it 'browsing projects in projects select' do
find('.js-move-issue').click find('.js-move-issue').click
wait_for_requests wait_for_requests
...@@ -84,7 +88,7 @@ feature 'issue move to another project' do ...@@ -84,7 +88,7 @@ feature 'issue move to another project' do
create(:issue, project: old_project, author: user, moved_to: new_issue) create(:issue, project: old_project, author: user, moved_to: new_issue)
end end
scenario 'user wants to move issue that has already been moved' do it 'user wants to move issue that has already been moved' do
expect(page).to have_no_selector('#move_to_project_id') expect(page).to have_no_selector('#move_to_project_id')
end end
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Issue notes polling', :js do describe 'Issue notes polling', :js do
include NoteInteractionHelpers include NoteInteractionHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'rails_helper' require 'rails_helper'
feature 'Manually create a todo item from issue', :js do describe 'Manually create a todo item from issue', :js do
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
......
require 'rails_helper' require 'rails_helper'
feature 'Multiple issue updating from issues#index', :js do describe 'Multiple issue updating from issues#index', :js do
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
......
require 'rails_helper' require 'rails_helper'
feature 'Issues > User uses quick actions', :js do describe 'Issues > User uses quick actions', :js do
include Spec::Support::Helpers::Features::NotesHelpers include Spec::Support::Helpers::Features::NotesHelpers
it_behaves_like 'issuable record that supports quick actions in its description and notes', :issue do it_behaves_like 'issuable record that supports quick actions in its description and notes', :issue do
......
require 'spec_helper' require 'spec_helper'
feature 'Labels Hierarchy', :js, :nested_groups do describe 'Labels Hierarchy', :js, :nested_groups do
include FilteredSearchHelpers include FilteredSearchHelpers
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Merge request > User creates image diff notes', :js do describe 'Merge request > User creates image diff notes', :js do
include NoteInteractionHelpers include NoteInteractionHelpers
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
......
require 'spec_helper' require 'spec_helper'
feature 'Merge request > User resolves outdated diff discussions', :js do describe 'Merge request > User resolves outdated diff discussions', :js do
let(:project) { create(:project, :repository, :public) } let(:project) { create(:project, :repository, :public) }
let(:merge_request) do let(:merge_request) do
......
require 'spec_helper' require 'spec_helper'
feature 'User squashes a merge request', :js do describe 'User squashes a merge request', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:source_branch) { 'csv' } let(:source_branch) { 'csv' }
......
require 'rails_helper' require 'rails_helper'
feature 'Milestone' do describe 'Milestone' do
let(:group) { create(:group, :public) } let(:group) { create(:group, :public) }
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -11,8 +11,8 @@ feature 'Milestone' do ...@@ -11,8 +11,8 @@ feature 'Milestone' do
sign_in(user) sign_in(user)
end end
feature 'Create a milestone' do describe 'Create a milestone' do
scenario 'shows an informative message for a new milestone' do it 'shows an informative message for a new milestone' do
visit new_project_milestone_path(project) visit new_project_milestone_path(project)
page.within '.milestone-form' do page.within '.milestone-form' do
...@@ -28,8 +28,8 @@ feature 'Milestone' do ...@@ -28,8 +28,8 @@ feature 'Milestone' do
end end
end end
feature 'Open a milestone with closed issues' do describe 'Open a milestone with closed issues' do
scenario 'shows an informative message' do it 'shows an informative message' do
milestone = create(:milestone, project: project, title: 8.7) milestone = create(:milestone, project: project, title: 8.7)
create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed") create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed")
...@@ -39,8 +39,8 @@ feature 'Milestone' do ...@@ -39,8 +39,8 @@ feature 'Milestone' do
end end
end end
feature 'Open a project milestone with an existing title' do describe 'Open a project milestone with an existing title' do
scenario 'displays validation message when there is a project milestone with same title' do it 'displays validation message when there is a project milestone with same title' do
milestone = create(:milestone, project: project, title: 8.7) milestone = create(:milestone, project: project, title: 8.7)
visit new_project_milestone_path(project) visit new_project_milestone_path(project)
...@@ -52,7 +52,7 @@ feature 'Milestone' do ...@@ -52,7 +52,7 @@ feature 'Milestone' do
expect(find('.alert-danger')).to have_content('already being used for another group or project milestone.') expect(find('.alert-danger')).to have_content('already being used for another group or project milestone.')
end end
scenario 'displays validation message when there is a group milestone with same title' do it 'displays validation message when there is a group milestone with same title' do
milestone = create(:milestone, project_id: nil, group: project.group, title: 8.7) milestone = create(:milestone, project_id: nil, group: project.group, title: 8.7)
visit new_group_milestone_path(project.group) visit new_group_milestone_path(project.group)
...@@ -66,8 +66,8 @@ feature 'Milestone' do ...@@ -66,8 +66,8 @@ feature 'Milestone' do
end end
end end
feature 'Open a milestone', :js do describe 'Open a milestone', :js do
scenario 'shows total issue time spent correctly when no time has been logged' do it 'shows total issue time spent correctly when no time has been logged' do
milestone = create(:milestone, project: project, title: 8.7) milestone = create(:milestone, project: project, title: 8.7)
visit project_milestone_path(project, milestone) visit project_milestone_path(project, milestone)
...@@ -79,7 +79,7 @@ feature 'Milestone' do ...@@ -79,7 +79,7 @@ feature 'Milestone' do
end end
end end
scenario 'shows total issue time spent' do it 'shows total issue time spent' do
milestone = create(:milestone, project: project, title: 8.7) milestone = create(:milestone, project: project, title: 8.7)
issue1 = create(:issue, project: project, milestone: milestone) issue1 = create(:issue, project: project, milestone: milestone)
issue2 = create(:issue, project: project, milestone: milestone) issue2 = create(:issue, project: project, milestone: milestone)
...@@ -98,8 +98,8 @@ feature 'Milestone' do ...@@ -98,8 +98,8 @@ feature 'Milestone' do
end end
end end
feature 'Deleting a milestone' do describe 'Deleting a milestone' do
scenario "The delete milestone button does not show for unauthorized users" do it "The delete milestone button does not show for unauthorized users" do
create(:milestone, project: project, title: 8.7) create(:milestone, project: project, title: 8.7)
sign_out(user) sign_out(user)
...@@ -109,7 +109,7 @@ feature 'Milestone' do ...@@ -109,7 +109,7 @@ feature 'Milestone' do
end end
end end
feature 'deprecation popover', :js do describe 'deprecation popover', :js do
it 'opens deprecation popover' do it 'opens deprecation popover' do
milestone = create(:milestone, project: project) milestone = create(:milestone, project: project)
......
require 'spec_helper' require 'spec_helper'
feature 'OAuth Login', :js, :allow_forgery_protection do describe 'OAuth Login', :js, :allow_forgery_protection do
include DeviseHelpers include DeviseHelpers
def enter_code(code) def enter_code(code)
......
require 'spec_helper' require 'spec_helper'
feature 'Member autocomplete', :js do describe 'Member autocomplete', :js do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Password reset' do describe 'Password reset' do
describe 'throttling' do describe 'throttling' do
it 'sends reset instructions when not previously sent' do it 'sends reset instructions when not previously sent' do
user = create(:user) user = create(:user)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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