Commit 3db2f327 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Rémy Coutable

Enable Capybara/FeatureMethods cop

parent baab4cdd
......@@ -10,10 +10,6 @@
Capybara/CurrentPathExpectation:
Enabled: false
# Offense count: 956
Capybara/FeatureMethods:
Enabled: false
# Offense count: 23
FactoryBot/DynamicAttributeDefinedStatically:
Exclude:
......
require 'securerandom'
module QA
feature 'API basics', :core do
describe 'API basics', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -9,7 +9,7 @@ module QA
let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" }
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')
post create_project_request.url, path: project_name, name: project_name
......
module QA
feature 'API users', :core do
describe 'API users', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -7,13 +7,13 @@ module QA
context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') }
scenario 'get list of users' do
it 'get list of users' do
get request.url
expect_status(200)
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 } }
expect_status(200)
......@@ -22,7 +22,7 @@ module QA
)
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) } }
expect_status(200)
......@@ -30,7 +30,7 @@ module QA
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')
get request.url
......
module QA
feature 'LDAP user login', :ldap do
describe 'LDAP user login', :ldap do
before do
Runtime::Env.user_type = 'ldap'
end
scenario 'user logs in using LDAP credentials' do
it 'user logs in using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'standard user login', :core do
scenario 'user logs in using credentials' do
describe 'standard user login', :core do
it 'user logs in using credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new group', :mattermost do
scenario 'creating a group with a mattermost team' do
describe 'create a new group', :mattermost do
it 'creating a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_groups }
......
module QA
feature 'logging in to Mattermost', :mattermost do
scenario 'can use gitlab oauth' do
describe 'logging in to Mattermost', :mattermost do
it 'can use gitlab oauth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates a merge request', :core do
scenario 'user creates a new merge request' do
describe 'creates a merge request', :core do
it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request rebase', :core do
scenario 'rebases source branch of merge request' do
describe 'merge request rebase', :core do
it 'rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request squash commits', :core do
scenario 'when squash commits is marked before merge' do
describe 'merge request squash commits', :core do
it 'when squash commits is marked before merge' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'activity page', :core do
scenario 'push creates an event in the activity page' do
describe 'activity page', :core do
it 'push creates an event in the activity page' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'deploy keys support', :core do
scenario 'user adds a deploy key' do
describe 'deploy keys support', :core do
it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'secret variables support', :core do
scenario 'user adds a secret variable' do
describe 'secret variables support', :core do
it 'user adds a secret variable' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'pathname'
module QA
feature 'Auto Devops', :kubernetes do
describe 'Auto Devops', :kubernetes do
after do
@cluster&.remove!
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)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates issue', :core do
describe 'creates issue', :core do
let(:issue_title) { 'issue title' }
scenario 'user creates issue' do
it 'user creates issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new project', :core do
scenario 'user creates a new project' do
describe 'create a new project', :core do
it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'digest/sha1'
module QA
feature 'cloning code using a deploy key', :core, :docker do
describe 'cloning code using a deploy key', :core, :docker do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -39,7 +39,7 @@ module QA
]
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)
login
......
module QA
feature 'CI/CD Pipelines', :core, :docker do
describe 'CI/CD Pipelines', :core, :docker do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do
Service::Runner.new(executor).remove!
end
scenario 'user registers a new specific runner' do
it 'user registers a new specific runner' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -25,7 +25,7 @@ module QA
end
end
scenario 'users creates a new pipeline' do
it 'users creates a new pipeline' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'Wiki Functionality', :core do
describe 'Wiki Functionality', :core do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -14,7 +14,7 @@ module QA
login
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|
resource.title = 'Home'
resource.content = '# My First Wiki Content'
......
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
given(:location) do
let(:location) do
Page::Project::Show.act do
choose_repository_clone_http
repository_location
......@@ -31,7 +31,7 @@ module QA
end
end
scenario 'user performs a deep clone' do
it 'user performs a deep clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......@@ -42,7 +42,7 @@ module QA
end
end
scenario 'user performs a shallow clone' do
it 'user performs a shallow clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......
module QA
feature 'branch protection support', :core do
given(:branch_name) { 'protected-branch' }
given(:commit_message) { 'Protected push commit message' }
given(:project) do
describe 'branch protection support', :core do
let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' }
let(:project) do
Factory::Resource::Project.fabricate! do |resource|
resource.name = 'protected-branch-project'
end
......@@ -27,7 +27,7 @@ module QA
context 'when developers and maintainers are allowed to push to a protected branch' do
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.push_allowance).to have_content('Developers + Maintainers')
......@@ -38,7 +38,7 @@ module QA
end
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)
@push = push_new_file(branch_name)
......
module QA
feature 'push code to repository', :core do
describe 'push code to repository', :core 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)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'spec_helper'
feature 'Abuse reports' do
describe 'Abuse reports' do
let(:another_user) { create(:user) }
before do
sign_in(create(:user))
end
scenario 'Report abuse' do
it 'Report abuse' do
visit user_path(another_user)
click_link 'Report abuse'
......
require 'spec_helper'
feature 'Admin Appearance' do
describe 'Admin Appearance' do
let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do
it 'Create new appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -21,7 +21,7 @@ feature 'Admin Appearance' do
expect(page).to have_content 'Last edit'
end
scenario 'Preview sign-in page appearance' do
it 'Preview sign-in page appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -30,7 +30,7 @@ feature 'Admin Appearance' do
expect_custom_sign_in_appearance(appearance)
end
scenario 'Preview new project page appearance' do
it 'Preview new project page appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -39,20 +39,20 @@ feature 'Admin Appearance' do
expect_custom_new_project_appearance(appearance)
end
scenario 'Custom sign-in page' do
it 'Custom sign-in page' do
visit new_user_session_path
expect_custom_sign_in_appearance(appearance)
end
scenario 'Custom new project page' do
it 'Custom new project page' do
sign_in create(:user)
visit new_project_path
expect_custom_new_project_appearance(appearance)
end
scenario 'Appearance logo' do
it 'Appearance logo' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -64,7 +64,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(logo_selector)
end
scenario 'Header logos' do
it 'Header logos' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -76,7 +76,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(header_logo_selector)
end
scenario 'Favicon' do
it 'Favicon' do
sign_in(create(:admin))
visit admin_appearances_path
......
require 'spec_helper'
feature 'Admin Broadcast Messages' do
describe 'Admin Broadcast Messages' do
before do
sign_in(create(:admin))
create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path
end
scenario 'See broadcast messages list' do
it 'See broadcast messages list' do
expect(page).to have_content 'Migration to new server'
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_color', with: '#f2dede'
fill_in 'broadcast_message_font', with: '#b94a48'
......@@ -24,7 +24,7 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"])
end
scenario 'Edit an existing broadcast message' do
it 'Edit an existing broadcast message' do
click_link 'Edit'
fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW'
click_button 'Update broadcast message'
......@@ -33,14 +33,14 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_content 'Application update RIGHT NOW'
end
scenario 'Remove an existing broadcast message' do
it 'Remove an existing broadcast message' do
click_link 'Remove'
expect(current_path).to eq admin_broadcast_messages_path
expect(page).not_to have_content 'Migration to new server'
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:"
page.within('.broadcast-message-preview') do
......
......@@ -7,7 +7,7 @@ describe 'Admin browse spam logs' do
sign_in(create(:admin))
end
scenario 'Browse spam logs' do
it 'Browse spam logs' do
visit admin_spam_logs_path
expect(page).to have_content('Spam Logs')
......
require 'rails_helper'
feature 'Admin cohorts page' do
describe 'Admin cohorts page' do
before do
sign_in(create(:admin))
end
scenario 'See users count per month' do
it 'See users count per month' do
2.times { create(:user) }
visit admin_cohorts_path
......
require 'rails_helper'
feature 'Admin disables Git access protocol' do
describe 'Admin disables Git access protocol' do
include StubENV
let(:project) { create(:project, :empty_repo) }
let(:admin) { create(:admin) }
background do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
sign_in(admin)
end
context 'with HTTP disabled' do
background do
before do
disable_http_protocol
end
scenario 'shows only SSH url' do
it 'shows only SSH url' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
......@@ -25,11 +25,11 @@ feature 'Admin disables Git access protocol' do
end
context 'with SSH disabled' do
background do
before do
disable_ssh_protocol
end
scenario 'shows only HTTP url' do
it 'shows only HTTP url' do
visit_project
expect(page).to have_content("git clone #{project.http_url_to_repo}")
......@@ -38,11 +38,11 @@ feature 'Admin disables Git access protocol' do
end
context 'with nothing disabled' do
background do
before do
create(:personal_key, user: admin)
end
scenario 'shows default SSH url and protocol selection dropdown' do
it 'shows default SSH url and protocol selection dropdown' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
......
require 'rails_helper'
feature 'Admin disables 2FA for a user' do
scenario 'successfully', :js do
describe 'Admin disables 2FA for a user' do
it 'successfully', :js do
sign_in(create(:admin))
user = create(:user, :two_factor)
......@@ -16,7 +16,7 @@ feature 'Admin disables 2FA for a user' do
end
end
scenario 'for a user without 2FA enabled' do
it 'for a user without 2FA enabled' do
sign_in(create(:admin))
user = create(:user)
......
require 'spec_helper'
feature 'Admin Groups' do
describe 'Admin Groups' do
include Select2Helper
let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
......@@ -47,13 +47,13 @@ feature 'Admin Groups' do
expect(li_texts).to match group_description
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
expect_selected_visibility(internal)
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
click_link "New group"
group_path = 'gitlab'
......@@ -64,7 +64,7 @@ feature 'Admin Groups' do
end
describe 'show a group' do
scenario 'shows the group' do
it 'shows the group' do
group = create(:group, :private)
visit admin_group_path(group)
......@@ -74,7 +74,7 @@ feature 'Admin Groups' do
end
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)
visit admin_group_edit_path(group)
......@@ -82,7 +82,7 @@ feature 'Admin Groups' do
expect_selected_visibility(group.visibility_level)
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)
visit admin_group_edit_path(group)
......
require 'spec_helper'
feature "Admin Health Check", :feature do
describe "Admin Health Check", :feature do
include StubENV
before do
......
require 'spec_helper'
feature 'Admin::HookLogs' do
describe 'Admin::HookLogs' do
let(:project) { create(:project) }
let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
......@@ -9,7 +9,7 @@ feature 'Admin::HookLogs' do
sign_in(create(:admin))
end
scenario 'show list of hook logs' do
it 'show list of hook logs' do
hook_log
visit edit_admin_hook_path(system_hook)
......@@ -17,7 +17,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content(hook_log.url)
end
scenario 'show hook log details' do
it 'show hook log details' do
hook_log
visit edit_admin_hook_path(system_hook)
click_link 'View details'
......@@ -27,7 +27,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content('Resend Request')
end
scenario 'retry hook log' do
it 'retry hook log' do
WebMock.stub_request(:post, system_hook.url)
hook_log
......
require 'spec_helper'
feature 'Admin updates settings' do
describe 'Admin updates settings' do
include StubENV
include TermsHelper
......@@ -12,7 +12,7 @@ feature 'Admin updates settings' do
visit admin_application_settings_path
end
scenario 'Change visibility settings' do
it 'Change visibility settings' do
page.within('.as-visibility-access') do
choose "application_setting_default_project_visibility_20"
click_button 'Save changes'
......@@ -21,7 +21,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Uncheck all restricted visibility levels' do
it 'Uncheck all restricted visibility levels' do
page.within('.as-visibility-access') do
find('#application_setting_visibility_level_0').set(false)
find('#application_setting_visibility_level_10').set(false)
......@@ -35,7 +35,7 @@ feature 'Admin updates settings' do
expect(find('#application_setting_visibility_level_20')).not_to be_checked
end
scenario 'Modify import sources' do
it 'Modify import sources' do
expect(Gitlab::CurrentSettings.import_sources).not_to be_empty
page.within('.as-visibility-access') do
......@@ -58,7 +58,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.import_sources).to eq(['git'])
end
scenario 'Change Visibility and Access Controls' do
it 'Change Visibility and Access Controls' do
page.within('.as-visibility-access') do
uncheck 'Project export enabled'
click_button 'Save changes'
......@@ -68,7 +68,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Account and Limit Settings' do
it 'Change Account and Limit Settings' do
page.within('.as-account-limit') do
uncheck 'Gravatar enabled'
click_button 'Save changes'
......@@ -78,7 +78,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Sign-in restrictions' do
it 'Change Sign-in restrictions' do
page.within('.as-signin') do
fill_in 'Home page URL', with: 'https://about.gitlab.com/'
click_button 'Save changes'
......@@ -88,7 +88,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
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.
_existing_terms = create(:term)
accept_terms(admin)
......@@ -104,7 +104,7 @@ feature 'Admin updates settings' do
expect(page).to have_content 'Application settings saved successfully'
end
scenario 'Modify oauth providers' do
it 'Modify oauth providers' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
page.within('.as-signin') do
......@@ -124,7 +124,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).not_to include('google_oauth2')
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
page.within('.as-signin') do
......@@ -147,7 +147,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to include('google_oauth2')
end
scenario 'Change Help page' do
it 'Change Help page' do
page.within('.as-help-page') do
fill_in 'Help page text', with: 'Example text'
check 'Hide marketing-related entries from help'
......@@ -161,7 +161,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Pages settings' do
it 'Change Pages settings' do
page.within('.as-pages') do
fill_in 'Maximum size of pages (MB)', with: 15
check 'Require users to prove ownership of custom domains'
......@@ -173,7 +173,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change CI/CD settings' do
it 'Change CI/CD settings' do
page.within('.as-ci-cd') do
check 'Enabled Auto DevOps for projects by default'
fill_in 'Auto devops domain', with: 'domain.com'
......@@ -185,7 +185,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Influx settings' do
it 'Change Influx settings' do
page.within('.as-influx') do
check 'Enable InfluxDB Metrics'
click_button 'Save changes'
......@@ -195,7 +195,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Prometheus settings' do
it 'Change Prometheus settings' do
page.within('.as-prometheus') do
check 'Enable Prometheus Metrics'
click_button 'Save changes'
......@@ -205,7 +205,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Performance bar settings' do
it 'Change Performance bar settings' do
group = create(:group)
page.within('.as-performance-bar') do
......@@ -228,7 +228,7 @@ feature 'Admin updates settings' do
expect(find_field('Allowed group').value).to be_nil
end
scenario 'Change Background jobs settings' do
it 'Change Background jobs settings' do
page.within('.as-background') do
fill_in 'Throttling Factor', with: 1
click_button 'Save changes'
......@@ -238,7 +238,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Spam settings' do
it 'Change Spam settings' do
page.within('.as-spam') do
check 'Enable reCAPTCHA'
fill_in 'reCAPTCHA Site Key', with: 'key'
......@@ -252,7 +252,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15)
end
scenario 'Configure web terminal' do
it 'Configure web terminal' do
page.within('.as-terminal') do
fill_in 'Max session time', with: 15
click_button 'Save changes'
......@@ -262,7 +262,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.terminal_max_session_time).to eq(15)
end
scenario 'Enable outbound requests' do
it 'Enable outbound requests' do
page.within('.as-outbound') do
check 'Allow requests to the local network from hooks and services'
click_button 'Save changes'
......@@ -272,7 +272,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.allow_local_requests_from_hooks_and_services).to be true
end
scenario 'Change Slack Notifications Service template settings' do
it 'Change Slack Notifications Service template settings' do
first(:link, 'Service Templates').click
click_link 'Slack notifications'
fill_in 'Webhook', with: 'http://localhost'
......@@ -296,7 +296,7 @@ feature 'Admin updates settings' do
expect(find('#service_push_channel').value).to eq '#test_channel'
end
scenario 'Change Keys settings' do
it 'Change Keys settings' do
page.within('.as-visibility-access') do
select 'Are forbidden', from: 'RSA SSH keys'
select 'Are allowed', from: 'DSA SSH keys'
......
require 'rails_helper'
feature 'Admin uses repository checks' do
describe 'Admin uses repository checks' do
include StubENV
before do
......@@ -8,7 +8,7 @@ feature 'Admin uses repository checks' do
sign_in(create(:admin))
end
scenario 'to trigger a single check' do
it 'to trigger a single check' do
project = create(:project)
visit_admin_project_page(project)
......@@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do
expect(page).to have_content('Repository check was triggered')
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.update_columns(
last_repository_check_failed: true,
......@@ -32,7 +32,7 @@ feature 'Admin uses repository checks' do
end
end
scenario 'to clear all repository checks', :js do
it 'to clear all repository checks', :js do
visit admin_application_settings_path
expect(RepositoryCheck::ClearWorker).to receive(:perform_async)
......
require 'spec_helper'
feature 'Contributions Calendar', :js do
describe 'Contributions Calendar', :js do
let(:user) { create(:user) }
let(:contributed_project) { create(:project, :public, :repository) }
let(:issue_note) { create(:note, project: contributed_project) }
......
......@@ -16,7 +16,7 @@ describe "Container Registry", :js do
end
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
expect(page).to have_content 'No container images'
......@@ -29,13 +29,13 @@ describe "Container Registry", :js do
project.container_repositories << container_repository
end
scenario 'user wants to see multi-level container repository' do
it 'user wants to see multi-level container repository' do
visit_container_registry
expect(page).to have_content('my/image')
end
scenario 'user removes entire container repository' do
it 'user removes entire container repository' do
visit_container_registry
expect_any_instance_of(ContainerRepository)
......@@ -44,7 +44,7 @@ describe "Container Registry", :js do
click_on(class: 'js-remove-repo')
end
scenario 'user removes a specific tag from container repository' do
it 'user removes a specific tag from container repository' do
visit_container_registry
find('.js-toggle-repo').click
......
require 'spec_helper'
feature 'Cycle Analytics', :js do
describe 'Cycle Analytics', :js do
let(:user) { create(:user) }
let(:guest) { create(:user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Dashboard > Activity' do
describe 'Dashboard > Activity' do
let(:user) { create(:user) }
before do
......@@ -66,7 +66,7 @@ feature 'Dashboard > Activity' do
wait_for_requests
end
scenario 'user should see all events' do
it 'user should see all events' do
within '.content_list' do
expect(page).to have_content('pushed new branch')
expect(page).to have_content('joined')
......@@ -77,7 +77,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only pushed events' do
it 'user should see only pushed events' do
click_link('Push events')
wait_for_requests
......@@ -90,7 +90,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only merged events' do
it 'user should see only merged events' do
click_link('Merge events')
wait_for_requests
......@@ -103,7 +103,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only issues events' do
it 'user should see only issues events' do
click_link('Issue events')
wait_for_requests
......@@ -117,7 +117,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only comments events' do
it 'user should see only comments events' do
click_link('Comments')
wait_for_requests
......@@ -130,7 +130,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only joined events' do
it 'user should see only joined events' do
click_link('Team')
wait_for_requests
......@@ -143,7 +143,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user see selected event after page reloading' do
it 'user see selected event after page reloading' do
click_link('Push events')
wait_for_requests
visit activity_dashboard_path
......
require 'spec_helper'
feature 'Tooltips on .timeago dates', :js do
describe 'Tooltips on .timeago dates', :js do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time }
......
require 'spec_helper'
feature 'Dashboard Groups page', :js do
describe 'Dashboard Groups page', :js do
let(:user) { create :user }
let(:group) { create(:group) }
let(:nested_group) { create(:group, :nested) }
......
require 'spec_helper'
feature 'Dashboard Issues filtering', :js do
describe 'Dashboard Issues filtering', :js do
include Spec::Support::Helpers::Features::SortingHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Dashboard Merge Requests' do
describe 'Dashboard Merge Requests' do
include Spec::Support::Helpers::Features::SortingHelpers
include FilterItemSelectHelper
include ProjectForksHelper
......
require 'spec_helper'
feature 'Dashboard > milestone filter', :js do
describe 'Dashboard > milestone filter', :js do
include FilterItemSelectHelper
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Dashboard > Milestones' do
describe 'Dashboard > Milestones' do
describe 'as anonymous user' do
before do
visit dashboard_milestones_path
......
require 'spec_helper'
feature 'Project member activity', :js do
describe 'Project member activity', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) }
......
require 'spec_helper'
feature 'Dashboard Projects' do
describe 'Dashboard Projects' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, name: 'awesome stuff') }
let(:project2) { create(:project, :public, name: 'Community project') }
......@@ -121,7 +121,7 @@ feature 'Dashboard Projects' do
visit dashboard_projects_path
end
scenario 'shows "Create merge request" button' do
it 'shows "Create merge request" button' do
expect(page).to have_content 'You pushed to feature'
within('#content-body') do
......
require 'spec_helper'
feature 'Dashboard shortcuts', :js do
describe 'Dashboard shortcuts', :js do
context 'logged in' do
before do
sign_in(create(:user))
visit root_dashboard_path
end
scenario 'Navigate to tabs' do
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'I'])
check_page_title('Issues')
......@@ -31,7 +31,7 @@ feature 'Dashboard shortcuts', :js do
visit explore_root_path
end
scenario 'Navigate to tabs' do
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'G'])
find('.nothing-here-block')
......
require 'rails_helper'
feature 'Dashboard > Todo target states' do
describe 'Dashboard > Todo target states' do
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, :public) }
......@@ -9,7 +9,7 @@ feature 'Dashboard > Todo target states' do
sign_in(user)
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')
create_todo issue_closed
visit dashboard_todos_path
......@@ -19,7 +19,7 @@ feature 'Dashboard > Todo target states' do
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)
create_todo issue_open
visit dashboard_todos_path
......@@ -29,7 +29,7 @@ feature 'Dashboard > Todo target states' do
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)
create_todo mr_merged
visit dashboard_todos_path
......@@ -39,7 +39,7 @@ feature 'Dashboard > Todo target states' do
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)
create_todo mr_closed
visit dashboard_todos_path
......@@ -49,7 +49,7 @@ feature 'Dashboard > Todo target states' do
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)
create_todo mr_open
visit dashboard_todos_path
......
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_2) { create(:user, username: 'user_2', name: 'user_2') }
......
require 'spec_helper'
feature 'Dashboard > User sorts todos' do
describe 'Dashboard > User sorts todos' do
let(:user) { create(:user) }
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Dashboard Todos' do
describe 'Dashboard Todos' do
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'Expand and collapse diffs', :js do
describe 'Expand and collapse diffs', :js do
let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Top Plus Menu', :js do
describe 'Top Plus Menu', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) }
......@@ -15,7 +15,7 @@ feature 'Top Plus Menu', :js do
sign_in(user)
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
click_topmenuitem("New project")
......@@ -24,7 +24,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Project name')
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
click_topmenuitem("New group")
......@@ -33,7 +33,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Group name')
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
click_topmenuitem("New snippet")
......@@ -42,7 +42,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title')
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)
click_topmenuitem("New issue")
......@@ -51,7 +51,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title')
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)
click_topmenuitem("New merge request")
......@@ -61,7 +61,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Target branch')
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)
page.within '.header-content' do
......@@ -74,7 +74,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title')
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)
click_topmenuitem("New subgroup")
......@@ -83,7 +83,7 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Group name')
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)
page.within '.header-content' do
......@@ -107,7 +107,7 @@ feature 'Top Plus Menu', :js do
sign_in(guest_user)
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)
click_topmenuitem("New issue")
......@@ -116,37 +116,37 @@ feature 'Top Plus Menu', :js do
expect(page).to have_content('Title')
end
scenario 'has no New merge request menu item' do
it 'has no New merge request menu item' do
visit project_path(project)
hasnot_topmenuitem("New merge request")
end
scenario 'has no New project snippet menu item' do
it 'has no New project snippet menu item' do
visit project_path(project)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
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)
hasnot_topmenuitem("New merge request")
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)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-project-snippet')
end
scenario 'has no New subgroup menu item' do
it 'has no New subgroup menu item' do
visit group_path(group)
hasnot_topmenuitem("New subgroup")
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)
expect(find('.header-new.dropdown')).not_to have_selector('.header-new-group-project')
......
require 'spec_helper'
feature 'Global search' do
describe 'Global search' do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
......
require 'spec_helper'
feature 'Group variables', :js do
describe 'Group variables', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:variable) { create(:ci_group_variable, key: 'test_key', value: 'test value', group: group) }
let(:page_path) { group_settings_ci_cd_path(group) }
background do
before do
group.add_master(user)
gitlab_sign_in(user)
......
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(:group) { create(:group) }
let(:path) { activity_group_path(group) }
......
require 'spec_helper'
feature 'Group empty states' do
describe 'Group empty states' do
let(:group) { create(:group) }
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
......
require 'spec_helper'
feature 'Edit group settings' do
given(:user) { create(:user) }
given(:group) { create(:group, path: 'foo') }
describe 'Edit group settings' do
let(:user) { create(:user) }
let(:group) { create(:group, path: 'foo') }
background do
before do
group.add_owner(user)
sign_in(user)
end
......@@ -14,14 +14,14 @@ feature 'Edit group settings' do
let(:old_group_full_path) { "/#{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)
visit new_group_full_path
expect(current_path).to eq(new_group_full_path)
expect(find('h1.group-title')).to have_content(group.name)
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)
visit old_group_full_path
expect(current_path).to eq(new_group_full_path)
......@@ -29,18 +29,18 @@ feature 'Edit group settings' do
end
context 'with a subgroup' do
given!(:subgroup) { create(:group, parent: group, path: 'subgroup') }
given(:old_subgroup_full_path) { "/#{group.path}/#{subgroup.path}" }
given(:new_subgroup_full_path) { "/#{new_group_path}/#{subgroup.path}" }
let!(:subgroup) { create(:group, parent: group, path: 'subgroup') }
let(:old_subgroup_full_path) { "/#{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)
visit new_subgroup_full_path
expect(current_path).to eq(new_subgroup_full_path)
expect(find('h1.group-title')).to have_content(subgroup.name)
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)
visit old_subgroup_full_path
expect(current_path).to eq(new_subgroup_full_path)
......@@ -49,9 +49,9 @@ feature 'Edit group settings' do
end
context 'with a project' do
given!(:project) { create(:project, group: group) }
given(:old_project_full_path) { "/#{group.path}/#{project.path}" }
given(:new_project_full_path) { "/#{new_group_path}/#{project.path}" }
let!(:project) { create(:project, group: group) }
let(:old_project_full_path) { "/#{group.path}/#{project.path}" }
let(:new_project_full_path) { "/#{new_group_path}/#{project.path}" }
before(:context) do
TestEnv.clean_test_path
......@@ -61,14 +61,14 @@ feature 'Edit group settings' do
TestEnv.clean_test_path
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)
visit new_project_full_path
expect(current_path).to eq(new_project_full_path)
expect(find('.breadcrumbs')).to have_content(project.path)
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)
visit old_project_full_path
expect(current_path).to eq(new_project_full_path)
......
require 'spec_helper'
feature 'Group issues page' do
describe 'Group issues page' do
include FilteredSearchHelpers
let(:group) { create(:group) }
......
require 'spec_helper'
feature 'Edit group label' do
given(:user) { create(:user) }
given(:group) { create(:group) }
given(:label) { create(:group_label, group: group) }
describe 'Edit group label' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:label) { create(:group_label, group: group) }
background do
before do
group.add_owner(user)
sign_in(user)
visit edit_group_label_path(group, label)
end
scenario 'update label with new title' do
it 'update label with new title' do
fill_in 'label_title', with: 'new label name'
click_button 'Save changes'
......
require 'spec_helper'
feature 'Group labels' do
describe 'Group labels' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label) { create(:group_label, group: group) }
background do
before do
group.add_owner(user)
sign_in(user)
visit group_labels_path(group)
end
scenario 'label has edit button', :js do
it 'label has edit button', :js do
expect(page).to have_selector('.label-action.edit')
end
end
require 'spec_helper'
feature 'Labels subscription' do
describe 'Labels subscription' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:feature) { create(:group_label, group: group, title: 'feature') }
......@@ -11,7 +11,7 @@ feature 'Labels subscription' do
gitlab_sign_in user
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)
expect(page).to have_content('feature')
......
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) }
before do
......@@ -8,7 +8,7 @@ feature 'Groups > Labels > User sees links to issuables' do
visit group_labels_path(group)
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 open issues')
end
......
require 'spec_helper'
feature 'Groups > Members > Filter members' do
describe 'Groups > Members > Filter members' do
let(:user) { create(:user) }
let(:user_with_2fa) { create(:user, :two_factor_via_otp) }
let(:group) { create(:group) }
background do
before do
group.add_owner(user)
group.add_master(user_with_2fa)
sign_in(user)
end
scenario 'shows all members' do
it 'shows all members' do
visit_members_list
expect(first_member).to include(user.name)
......@@ -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')
end
scenario 'shows only 2FA members' do
it 'shows only 2FA members' do
visit_members_list(two_factor: 'enabled')
expect(first_member).to include(user_with_2fa.name)
......@@ -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')
end
scenario 'shows only non 2FA members' do
it 'shows only non 2FA members' do
visit_members_list(two_factor: 'disabled')
expect(first_member).to include(user.name)
......
require 'spec_helper'
feature 'Groups > Members > Leave group' do
describe 'Groups > Members > Leave group' do
let(:user) { create(:user) }
let(:other_user) { create(:user) }
let(:group) { create(:group) }
background do
before do
gitlab_sign_in(user)
end
scenario 'guest leaves the group' do
it 'guest leaves the group' do
group.add_guest(user)
group.add_owner(other_user)
......@@ -21,7 +21,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user)
end
scenario 'guest leaves the group as last member' do
it 'guest leaves the group as last member' do
group.add_guest(user)
visit group_path(group)
......@@ -32,7 +32,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user)
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(other_user)
......@@ -44,7 +44,7 @@ feature 'Groups > Members > Leave group' do
expect(group.users).not_to include(user)
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)
visit group_path(group)
......
require 'spec_helper'
feature 'Groups > Members > List members' do
describe 'Groups > Members > List members' do
include Select2Helper
let(:user1) { create(:user, name: 'John Doe') }
......@@ -8,11 +8,11 @@ feature 'Groups > Members > List members' do
let(:group) { create(:group) }
let(:nested_group) { create(:group, parent: group) }
background do
before do
gitlab_sign_in(user1)
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)
nested_group.add_developer(user2)
......@@ -22,7 +22,7 @@ feature 'Groups > Members > List members' do
expect(second_row.text).to include(user2.name)
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)
nested_group.add_developer(user1)
......
require 'spec_helper'
feature 'Groups > Members > Manage members' do
describe 'Groups > Members > Manage members' do
include Select2Helper
let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') }
let(:group) { create(:group) }
background do
before do
sign_in(user1)
end
scenario 'update user to owner level', :js do
it 'update user to owner level', :js do
group.add_owner(user1)
group.add_developer(user2)
......@@ -25,7 +25,7 @@ feature 'Groups > Members > Manage members' do
end
end
scenario 'add user to group', :js do
it 'add user to group', :js do
group.add_owner(user1)
visit group_group_members_path(group)
......@@ -38,7 +38,7 @@ feature 'Groups > Members > Manage members' do
end
end
scenario 'do not disclose email addresses', :js do
it 'do not disclose email addresses', :js do
group.add_owner(user1)
create(:user, email: 'undisclosed_email@gitlab.com', name: "Jane 'invisible' Doe")
......@@ -59,7 +59,7 @@ feature 'Groups > Members > Manage members' do
expect(page).to have_content("Jane 'invisible' Doe")
end
scenario 'remove user from group', :js do
it 'remove user from group', :js do
group.add_owner(user1)
group.add_developer(user2)
......@@ -75,7 +75,7 @@ feature 'Groups > Members > Manage members' do
expect(group.users).not_to include(user2)
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)
visit group_group_members_path(group)
......@@ -88,7 +88,7 @@ feature 'Groups > Members > Manage members' do
end
end
scenario 'invite user to group', :js do
it 'invite user to group', :js do
group.add_owner(user1)
visit group_group_members_path(group)
......@@ -102,7 +102,7 @@ feature 'Groups > Members > Manage members' do
end
end
scenario 'guest can not manage other users' do
it 'guest can not manage other users' do
group.add_guest(user1)
group.add_developer(user2)
......
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
let(:entity) { create(:group, :public, :access_requestable) }
let(:members_page_path) { group_group_members_path(entity) }
......
require 'spec_helper'
feature 'Groups > Members > Request access' do
describe 'Groups > Members > Request access' do
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) }
let!(:project) { create(:project, :private, namespace: group) }
background do
before do
group.add_owner(owner)
sign_in(user)
visit group_path(group)
end
scenario 'request access feature is disabled' do
it 'request access feature is disabled' do
group.update_attributes(request_access_enabled: false)
visit group_path(group)
expect(page).not_to have_content 'Request Access'
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' }
expect(ActionMailer::Base.deliveries.last.to).to eq [owner.notification_email]
......@@ -32,13 +32,13 @@ feature 'Groups > Members > Request access' do
expect(page).not_to have_content 'Leave group'
end
scenario 'user does not see private projects' do
it 'user does not see private projects' do
perform_enqueued_jobs { click_link 'Request Access' }
expect(page).not_to have_content project.name
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' }
visit dashboard_groups_path
......@@ -46,7 +46,7 @@ feature 'Groups > Members > Request access' do
expect(page).not_to have_content group.name
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'
expect(group.requesters.exists?(user_id: user)).to be_truthy
......@@ -58,7 +58,7 @@ feature 'Groups > Members > Request access' do
end
end
scenario 'user can withdraw its request for access' do
it 'user can withdraw its request for access' do
click_link 'Request Access'
expect(group.requesters.exists?(user_id: user)).to be_truthy
......@@ -69,7 +69,7 @@ feature 'Groups > Members > Request access' do
expect(page).to have_content 'Your access request to the group has been withdrawn.'
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)
visit group_path(group)
......
require 'spec_helper'
feature 'Groups > Members > Sort members' do
describe 'Groups > Members > Sort members' do
let(:owner) { create(:user, name: 'John Doe') }
let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) }
let(:group) { create(:group) }
background do
before do
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)
sign_in(owner)
end
scenario 'sorts alphabetically by default' do
it 'sorts alphabetically by default' do
visit_members_list(sort: nil)
expect(first_member).to include(owner.name)
......@@ -20,7 +20,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end
scenario 'sorts by access level ascending' do
it 'sorts by access level ascending' do
visit_members_list(sort: :access_level_asc)
expect(first_member).to include(developer.name)
......@@ -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')
end
scenario 'sorts by access level descending' do
it 'sorts by access level descending' do
visit_members_list(sort: :access_level_desc)
expect(first_member).to include(owner.name)
......@@ -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')
end
scenario 'sorts by last joined' do
it 'sorts by last joined' do
visit_members_list(sort: :last_joined)
expect(first_member).to include(developer.name)
......@@ -44,7 +44,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined')
end
scenario 'sorts by oldest joined' do
it 'sorts by oldest joined' do
visit_members_list(sort: :oldest_joined)
expect(first_member).to include(owner.name)
......@@ -52,7 +52,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined')
end
scenario 'sorts by name ascending' do
it 'sorts by name ascending' do
visit_members_list(sort: :name_asc)
expect(first_member).to include(owner.name)
......@@ -60,7 +60,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end
scenario 'sorts by name descending' do
it 'sorts by name descending' do
visit_members_list(sort: :name_desc)
expect(first_member).to include(developer.name)
......@@ -68,7 +68,7 @@ feature 'Groups > Members > Sort members' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
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)
expect(first_member).to include(owner.name)
......@@ -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')
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)
expect(first_member).to include(developer.name)
......
require 'spec_helper'
feature 'Group merge requests page' do
describe 'Group merge requests page' do
include FilteredSearchHelpers
let(:path) { merge_requests_group_path(group) }
......
require 'rails_helper'
feature 'Group milestones' do
describe 'Group milestones' do
let(:group) { create(:group) }
let!(:project) { create(:project_empty_repo, group: group) }
let(:user) { create(:group_member, :master, user: create(:user), group: group ).user }
......
require 'spec_helper'
feature 'Milestones sorting', :js do
describe 'Milestones sorting', :js do
let(:group) { create(:group) }
let!(: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
sign_in(user)
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)
expect(page).to have_button('Due soon')
......
require 'spec_helper'
feature 'Group Badges' do
describe 'Group Badges' do
include WaitForRequests
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Group share with group lock' do
given(:root_owner) { create(:user) }
given(:root_group) { create(:group) }
describe 'Group share with group lock' do
let(:root_owner) { create(:user) }
let(:root_group) { create(:group) }
background do
before do
root_group.add_owner(root_owner)
sign_in(root_owner)
end
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
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)
enable_group_lock
......@@ -23,14 +23,14 @@ feature 'Group share with group lock' do
end
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)
enable_group_lock
end
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)
disable_group_lock
......@@ -40,13 +40,13 @@ feature 'Group share with group lock' do
end
context 'but the subgroup share with group lock is disabled' do
background do
before do
visit edit_group_path(subgroup)
disable_group_lock
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)
disable_group_lock
......
require 'spec_helper'
feature 'Group show page' do
describe 'Group show page' do
let(:group) { create(:group) }
let(:path) { group_path(group) }
......
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(:user_in_dropdown) { create(:user) }
let!(:user_not_in_dropdown) { create(:user) }
......
require 'spec_helper'
feature 'Group' do
describe 'Group' do
before do
sign_in(create(:admin))
end
......
require 'spec_helper'
feature 'Blob shortcuts', :js do
describe 'Blob shortcuts', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) }
let(:issue) { create(:issue, project: project, author: user) }
......
require 'rails_helper'
feature 'Issue awards', :js do
describe 'Issue awards', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) }
......
require 'rails_helper'
feature 'Issues > Labels bulk assignment' do
describe 'Issues > Labels bulk assignment' do
let(:user) { create(:user) }
let!(:project) { create(:project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
......
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(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) }
......
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(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) }
let(:merge_request) { create(:merge_request, source_project: project) }
......
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(:project) { create(:project) }
let(:label) { create(:label, project: project, title: 'special+') }
......
require 'rails_helper'
feature 'Issue Detail', :js do
describe 'Issue Detail', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project, author: user) }
......
require 'rails_helper'
feature 'Issue Sidebar' do
describe 'Issue Sidebar' do
include MobileHelpers
let(:group) { create(:group, :nested) }
......
require 'rails_helper'
feature 'Issue markdown toolbar', :js do
describe 'Issue markdown toolbar', :js do
let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) }
......
require 'rails_helper'
feature 'issue move to another project' do
describe 'issue move to another project' do
let(:user) { create(:user) }
let(:old_project) { create(:project, :repository) }
let(:text) { 'Some issue description' }
......@@ -9,16 +9,18 @@ feature 'issue move to another project' do
create(:issue, description: text, project: old_project, author: user)
end
background { sign_in(user) }
before do
sign_in(user)
end
context 'user does not have permission to move issue' do
background do
before do
old_project.add_guest(user)
visit issue_path(issue)
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')
end
end
......@@ -30,14 +32,14 @@ feature 'issue move to another project' do
let(:text) { "Text with #{mr.to_reference}" }
let(:cross_reference) { old_project.to_reference(new_project) }
background do
before do
old_project.add_reporter(user)
new_project.add_reporter(user)
visit issue_path(issue)
end
scenario 'moving issue to another project', :js do
it 'moving issue to another project', :js do
find('.js-move-issue').click
wait_for_requests
all('.js-move-issue-dropdown-item')[0].click
......@@ -49,7 +51,7 @@ feature 'issue move to another project' do
expect(page.current_path).to include project_path(new_project)
end
scenario 'searching project dropdown', :js do
it 'searching project dropdown', :js do
new_project_search.add_reporter(user)
find('.js-move-issue').click
......@@ -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
let!(:private_project) { create(:project, :private) }
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
wait_for_requests
......@@ -84,7 +88,7 @@ feature 'issue move to another project' do
create(:issue, project: old_project, author: user, moved_to: new_issue)
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')
end
end
......
require 'spec_helper'
feature 'Issue notes polling', :js do
describe 'Issue notes polling', :js do
include NoteInteractionHelpers
let(:project) { create(:project, :public) }
......
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!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
......
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!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
......
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
it_behaves_like 'issuable record that supports quick actions in its description and notes', :issue do
......
require 'spec_helper'
feature 'Labels Hierarchy', :js, :nested_groups do
describe 'Labels Hierarchy', :js, :nested_groups do
include FilteredSearchHelpers
let!(:user) { create(:user) }
......
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
let(:project) { create(:project, :public, :repository) }
......
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(:merge_request) do
......
require 'spec_helper'
feature 'User squashes a merge request', :js do
describe 'User squashes a merge request', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:source_branch) { 'csv' }
......
require 'rails_helper'
feature 'Milestone' do
describe 'Milestone' do
let(:group) { create(:group, :public) }
let(:project) { create(:project, :public, namespace: group) }
let(:user) { create(:user) }
......@@ -11,8 +11,8 @@ feature 'Milestone' do
sign_in(user)
end
feature 'Create a milestone' do
scenario 'shows an informative message for a new milestone' do
describe 'Create a milestone' do
it 'shows an informative message for a new milestone' do
visit new_project_milestone_path(project)
page.within '.milestone-form' do
......@@ -28,8 +28,8 @@ feature 'Milestone' do
end
end
feature 'Open a milestone with closed issues' do
scenario 'shows an informative message' do
describe 'Open a milestone with closed issues' do
it 'shows an informative message' do
milestone = create(:milestone, project: project, title: 8.7)
create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed")
......@@ -39,8 +39,8 @@ feature 'Milestone' do
end
end
feature 'Open a project milestone with an existing title' do
scenario 'displays validation message when there is a project milestone with same title' do
describe 'Open a project milestone with an existing title' do
it 'displays validation message when there is a project milestone with same title' do
milestone = create(:milestone, project: project, title: 8.7)
visit new_project_milestone_path(project)
......@@ -52,7 +52,7 @@ feature 'Milestone' do
expect(find('.alert-danger')).to have_content('already being used for another group or project milestone.')
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)
visit new_group_milestone_path(project.group)
......@@ -66,8 +66,8 @@ feature 'Milestone' do
end
end
feature 'Open a milestone', :js do
scenario 'shows total issue time spent correctly when no time has been logged' do
describe 'Open a milestone', :js do
it 'shows total issue time spent correctly when no time has been logged' do
milestone = create(:milestone, project: project, title: 8.7)
visit project_milestone_path(project, milestone)
......@@ -79,7 +79,7 @@ feature 'Milestone' do
end
end
scenario 'shows total issue time spent' do
it 'shows total issue time spent' do
milestone = create(:milestone, project: project, title: 8.7)
issue1 = create(:issue, project: project, milestone: milestone)
issue2 = create(:issue, project: project, milestone: milestone)
......@@ -98,8 +98,8 @@ feature 'Milestone' do
end
end
feature 'Deleting a milestone' do
scenario "The delete milestone button does not show for unauthorized users" do
describe 'Deleting a milestone' do
it "The delete milestone button does not show for unauthorized users" do
create(:milestone, project: project, title: 8.7)
sign_out(user)
......@@ -109,7 +109,7 @@ feature 'Milestone' do
end
end
feature 'deprecation popover', :js do
describe 'deprecation popover', :js do
it 'opens deprecation popover' do
milestone = create(:milestone, project: project)
......
require 'spec_helper'
feature 'OAuth Login', :js, :allow_forgery_protection do
describe 'OAuth Login', :js, :allow_forgery_protection do
include DeviseHelpers
def enter_code(code)
......
require 'spec_helper'
feature 'Member autocomplete', :js do
describe 'Member autocomplete', :js do
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
let(:author) { create(:user) }
......
require 'spec_helper'
feature 'Password reset' do
describe 'Password reset' do
describe 'throttling' do
it 'sends reset instructions when not previously sent' do
user = create(:user)
......
require 'rails_helper'
feature 'Profile > Account', :js do
given(:user) { create(:user, username: 'foo') }
describe 'Profile > Account', :js do
let(:user) { create(:user, username: 'foo') }
before do
sign_in(user)
end
describe 'Change username' do
given(:new_username) { 'bar' }
given(:new_user_path) { "/#{new_username}" }
given(:old_user_path) { "/#{user.username}" }
let(:new_username) { 'bar' }
let(:new_user_path) { "/#{new_username}" }
let(:old_user_path) { "/#{user.username}" }
scenario 'the user is accessible via the new path' do
it 'the user is accessible via the new path' do
update_username(new_username)
visit new_user_path
expect(current_path).to eq(new_user_path)
expect(find('.user-info')).to have_content(new_username)
end
scenario 'the old user path redirects to the new path' do
it 'the old user path redirects to the new path' do
update_username(new_username)
visit old_user_path
expect(current_path).to eq(new_user_path)
......@@ -27,9 +27,9 @@ feature 'Profile > Account', :js do
end
context 'with a project' do
given!(:project) { create(:project, namespace: user.namespace) }
given(:new_project_path) { "/#{new_username}/#{project.path}" }
given(:old_project_path) { "/#{user.username}/#{project.path}" }
let!(:project) { create(:project, namespace: user.namespace) }
let(:new_project_path) { "/#{new_username}/#{project.path}" }
let(:old_project_path) { "/#{user.username}/#{project.path}" }
before(:context) do
TestEnv.clean_test_path
......@@ -39,14 +39,14 @@ feature 'Profile > Account', :js do
TestEnv.clean_test_path
end
scenario 'the project is accessible via the new path' do
it 'the project is accessible via the new path' do
update_username(new_username)
visit new_project_path
expect(current_path).to eq(new_project_path)
expect(find('.breadcrumbs-sub-title')).to have_content('Details')
end
scenario 'the old project path redirects to the new path' do
it 'the old project path redirects to the new path' do
update_username(new_username)
visit old_project_path
expect(current_path).to eq(new_project_path)
......
require 'rails_helper'
feature 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
let(:user) do
create(:user).tap do |user|
user.current_sign_in_at = Time.current
......@@ -13,7 +13,7 @@ feature 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
end
end
scenario 'User sees their active sessions' do
it 'User sees their active sessions' do
Capybara::Session.new(:session1)
Capybara::Session.new(:session2)
......@@ -60,7 +60,7 @@ feature 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
end
end
scenario 'User can revoke a session', :js, :redis_session_store do
it 'User can revoke a session', :js, :redis_session_store do
Capybara::Session.new(:session1)
Capybara::Session.new(:session2)
......
require 'rails_helper'
feature 'Profile > Chat' do
given(:user) { create(:user) }
given(:service) { create(:service) }
describe 'Profile > Chat' do
let(:user) { create(:user) }
let(:service) { create(:service) }
before do
sign_in(user)
end
describe 'uses authorization link' do
given(:params) do
let(:params) do
{ team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' }
end
given!(:authorize_url) { ChatNames::AuthorizeUserService.new(service, params).execute }
given(:authorize_path) { URI.parse(authorize_url).request_uri }
let!(:authorize_url) { ChatNames::AuthorizeUserService.new(service, params).execute }
let(:authorize_path) { URI.parse(authorize_url).request_uri }
before do
visit authorize_path
......@@ -24,13 +24,13 @@ feature 'Profile > Chat' do
click_button 'Authorize'
end
scenario 'goes to list of chat names and see chat account' do
it 'goes to list of chat names and see chat account' do
expect(page.current_path).to eq(profile_chat_names_path)
expect(page).to have_content('my_chat_team')
expect(page).to have_content('my_chat_user')
end
scenario 'second use of link is denied' do
it 'second use of link is denied' do
visit authorize_path
expect(page).to have_gitlab_http_status(:not_found)
......@@ -42,13 +42,13 @@ feature 'Profile > Chat' do
click_button 'Deny'
end
scenario 'goes to list of chat names and do not see chat account' do
it 'goes to list of chat names and do not see chat account' do
expect(page.current_path).to eq(profile_chat_names_path)
expect(page).not_to have_content('my_chat_team')
expect(page).not_to have_content('my_chat_user')
end
scenario 'second use of link is denied' do
it 'second use of link is denied' do
visit authorize_path
expect(page).to have_gitlab_http_status(:not_found)
......@@ -57,18 +57,18 @@ feature 'Profile > Chat' do
end
describe 'visits chat accounts' do
given!(:chat_name) { create(:chat_name, user: user, service: service) }
let!(:chat_name) { create(:chat_name, user: user, service: service) }
before do
visit profile_chat_names_path
end
scenario 'sees chat user' do
it 'sees chat user' do
expect(page).to have_content(chat_name.team_domain)
expect(page).to have_content(chat_name.chat_name)
end
scenario 'removes chat account' do
it 'removes chat account' do
click_link 'Remove'
expect(page).to have_content("You don't have any active chat names.")
......
require 'rails_helper'
feature 'Profile > Emails' do
describe 'Profile > Emails' do
let(:user) { create(:user) }
before do
......@@ -12,7 +12,7 @@ feature 'Profile > Emails' do
visit profile_emails_path
end
scenario 'saves the new email' do
it 'saves the new email' do
fill_in('Email', with: 'my@email.com')
click_button('Add email address')
......@@ -21,7 +21,7 @@ feature 'Profile > Emails' do
expect(page).to have_content('Resend confirmation email')
end
scenario 'does not add a duplicate email' do
it 'does not add a duplicate email' do
fill_in('Email', with: user.email)
click_button('Add email address')
......@@ -31,7 +31,7 @@ feature 'Profile > Emails' do
end
end
scenario 'User removes email' do
it 'User removes email' do
user.emails.create(email: 'my@email.com')
visit profile_emails_path
expect(page).to have_content("my@email.com")
......@@ -40,7 +40,7 @@ feature 'Profile > Emails' do
expect(page).not_to have_content("my@email.com")
end
scenario 'User confirms email' do
it 'User confirms email' do
email = user.emails.create(email: 'my@email.com')
visit profile_emails_path
expect(page).to have_content("#{email.email} Unverified")
......@@ -52,7 +52,7 @@ feature 'Profile > Emails' do
expect(page).to have_content("#{email.email} Verified")
end
scenario 'User re-sends confirmation email' do
it 'User re-sends confirmation email' do
email = user.emails.create(email: 'my@email.com')
visit profile_emails_path
......@@ -60,7 +60,7 @@ feature 'Profile > Emails' do
expect(page).to have_content("Confirmation email sent to #{email.email}")
end
scenario 'old unconfirmed emails show Send Confirmation button' do
it 'old unconfirmed emails show Send Confirmation button' do
email = user.emails.create(email: 'my@email.com')
email.update_attribute(:confirmation_sent_at, nil)
visit profile_emails_path
......
require 'rails_helper'
feature 'Profile > GPG Keys' do
describe 'Profile > GPG Keys' do
let(:user) { create(:user, email: GpgHelpers::User2.emails.first) }
before do
......@@ -12,7 +12,7 @@ feature 'Profile > GPG Keys' do
visit profile_gpg_keys_path
end
scenario 'saves the new key' do
it 'saves the new key' do
fill_in('Key', with: GpgHelpers::User2.public_key)
click_button('Add key')
......@@ -21,7 +21,7 @@ feature 'Profile > GPG Keys' do
expect(page).to have_content(GpgHelpers::User2.fingerprint)
end
scenario 'with multiple subkeys' do
it 'with multiple subkeys' do
fill_in('Key', with: GpgHelpers::User3.public_key)
click_button('Add key')
......@@ -34,7 +34,7 @@ feature 'Profile > GPG Keys' do
end
end
scenario 'User sees their key' do
it 'User sees their key' do
create(:gpg_key, user: user, key: GpgHelpers::User2.public_key)
visit profile_gpg_keys_path
......@@ -43,7 +43,7 @@ feature 'Profile > GPG Keys' do
expect(page).to have_content(GpgHelpers::User2.fingerprint)
end
scenario 'User removes a key via the key index' do
it 'User removes a key via the key index' do
create(:gpg_key, user: user, key: GpgHelpers::User2.public_key)
visit profile_gpg_keys_path
......@@ -52,7 +52,7 @@ feature 'Profile > GPG Keys' do
expect(page).to have_content('Your GPG keys (0)')
end
scenario 'User revokes a key via the key index' do
it 'User revokes a key via the key index' do
gpg_key = create :gpg_key, user: user, key: GpgHelpers::User2.public_key
gpg_signature = create :gpg_signature, gpg_key: gpg_key, verification_status: :verified
......
require 'rails_helper'
feature 'Profile > SSH Keys' do
describe 'Profile > SSH Keys' do
let(:user) { create(:user) }
before do
......@@ -12,13 +12,13 @@ feature 'Profile > SSH Keys' do
visit profile_keys_path
end
scenario 'auto-populates the title', :js do
it 'auto-populates the title', :js do
fill_in('Key', with: attributes_for(:key).fetch(:key))
expect(page).to have_field("Title", with: "dummy@gitlab.com")
end
scenario 'saves the new key' do
it 'saves the new key' do
attrs = attributes_for(:key)
fill_in('Key', with: attrs[:key])
......@@ -36,7 +36,7 @@ feature 'Profile > SSH Keys' do
stub_application_setting(rsa_key_restriction: forbidden, ed25519_key_restriction: forbidden)
end
scenario 'shows a validation error' do
it 'shows a validation error' do
attrs = attributes_for(:key)
fill_in('Key', with: attrs[:key])
......@@ -48,14 +48,14 @@ feature 'Profile > SSH Keys' do
end
end
scenario 'User sees their keys' do
it 'User sees their keys' do
key = create(:key, user: user)
visit profile_keys_path
expect(page).to have_content(key.title)
end
scenario 'User removes a key via the key index' do
it 'User removes a key via the key index' do
create(:key, user: user)
visit profile_keys_path
......@@ -64,7 +64,7 @@ feature 'Profile > SSH Keys' do
expect(page).to have_content('Your SSH keys (0)')
end
scenario 'User removes a key via its details page' do
it 'User removes a key via its details page' do
key = create(:key, user: user)
visit profile_key_path(key)
......
require 'spec_helper'
feature 'Profile > Notifications > User changes notified_of_own_activity setting', :js do
describe 'Profile > Notifications > User changes notified_of_own_activity setting', :js do
let(:user) { create(:user) }
before do
sign_in(user)
end
scenario 'User opts into receiving notifications about their own activity' do
it 'User opts into receiving notifications about their own activity' do
visit profile_notifications_path
expect(page).not_to have_checked_field('user[notified_of_own_activity]')
......@@ -18,7 +18,7 @@ feature 'Profile > Notifications > User changes notified_of_own_activity setting
expect(page).to have_checked_field('user[notified_of_own_activity]')
end
scenario 'User opts out of receiving notifications about their own activity' do
it 'User opts out of receiving notifications about their own activity' do
user.update!(notified_of_own_activity: true)
visit profile_notifications_path
......
require 'spec_helper'
feature 'User visits the notifications tab', :js do
describe 'User visits the notifications tab', :js do
let(:project) { create(:project) }
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Project Activity RSS' do
describe 'Project Activity RSS' do
let(:project) { create(:project, :public) }
let(:user) { project.owner }
let(:path) { activity_project_path(project) }
......
require 'spec_helper'
feature 'Projects > Activity > User sees activity' do
describe 'Projects > Activity > User sees activity' do
let(:project) { create(:project, :repository, :public) }
let(:user) { project.creator }
......
require 'spec_helper'
feature 'Artifact file', :js do
describe 'Artifact file', :js do
let(:project) { create(:project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) }
......
require 'spec_helper'
feature 'Raw artifact', :js do
describe 'Raw artifact', :js do
let(:project) { create(:project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
......
require 'spec_helper'
feature 'test coverage badge' do
given!(:user) { create(:user) }
given!(:project) { create(:project, :private) }
describe 'test coverage badge' do
let!(:user) { create(:user) }
let!(:project) { create(:project, :private) }
context 'when user has access to view badge' do
background do
before do
project.add_developer(user)
sign_in(user)
end
scenario 'user requests coverage badge image for pipeline' do
it 'user requests coverage badge image for pipeline' do
create_pipeline do |pipeline|
create_build(pipeline, coverage: 100, name: 'test:1')
create_build(pipeline, coverage: 90, name: 'test:2')
......@@ -21,7 +21,7 @@ feature 'test coverage badge' do
expect_coverage_badge('95.00%')
end
scenario 'user requests coverage badge for specific job' do
it 'user requests coverage badge for specific job' do
create_pipeline do |pipeline|
create_build(pipeline, coverage: 50, name: 'test:1')
create_build(pipeline, coverage: 50, name: 'test:2')
......@@ -33,7 +33,7 @@ feature 'test coverage badge' do
expect_coverage_badge('85.00%')
end
scenario 'user requests coverage badge for pipeline without coverage' do
it 'user requests coverage badge for pipeline without coverage' do
create_pipeline do |pipeline|
create_build(pipeline, coverage: nil, name: 'test')
end
......@@ -45,9 +45,11 @@ feature 'test coverage badge' do
end
context 'when user does not have access to view badge' do
background { sign_in(user) }
before do
sign_in(user)
end
scenario 'user requests test coverage badge image' do
it 'user requests test coverage badge image' do
show_test_coverage_badge
expect(page).to have_gitlab_http_status(404)
......
require 'spec_helper'
feature 'list of badges' do
background do
describe 'list of badges' do
before do
user = create(:user)
project = create(:project, :repository)
project.add_master(user)
......@@ -9,7 +9,7 @@ feature 'list of badges' do
visit project_settings_ci_cd_path(project)
end
scenario 'user wants to see build status badge' do
it 'user wants to see build status badge' do
page.within('.pipeline-status') do
expect(page).to have_content 'pipeline status'
expect(page).to have_content 'Markdown'
......@@ -24,7 +24,7 @@ feature 'list of badges' do
end
end
scenario 'user wants to see coverage report badge' do
it 'user wants to see coverage report badge' do
page.within('.coverage-report') do
expect(page).to have_content 'coverage report'
expect(page).to have_content 'Markdown'
......@@ -39,7 +39,7 @@ feature 'list of badges' do
end
end
scenario 'user changes current ref of build status badge', :js do
it 'user changes current ref of build status badge', :js do
page.within('.pipeline-status') do
first('.js-project-refs-dropdown').click
......
require 'spec_helper'
feature 'Pipeline Badge' do
describe 'Pipeline Badge' do
set(:project) { create(:project, :repository, :public) }
let(:ref) { project.default_branch }
......
require 'spec_helper'
feature 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js do
describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
......
require 'spec_helper'
feature 'File blob', :js do
describe 'File blob', :js do
include MobileHelpers
let(:project) { create(:project, :public, :repository) }
......
require 'spec_helper'
feature 'Editing file blob', :js do
describe 'Editing file blob', :js do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
......
require 'spec_helper'
feature 'Blob shortcuts' do
describe 'Blob shortcuts' do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
let(:path) { project.repository.ls_files(project.repository.root_ref)[0] }
......
require 'spec_helper'
feature 'User creates blob in new project', :js do
describe 'User creates blob in new project', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :empty_repo) }
......
require 'spec_helper'
feature 'Download buttons in branches page' do
given(:user) { create(:user) }
given(:role) { :developer }
given(:status) { 'success' }
given(:project) { create(:project, :repository) }
describe 'Download buttons in branches page' do
let(:user) { create(:user) }
let(:role) { :developer }
let(:status) { 'success' }
let(:project) { create(:project, :repository) }
given(:pipeline) do
let(:pipeline) do
create(:ci_pipeline,
project: project,
sha: project.commit('binary-encoding').sha,
......@@ -14,14 +14,14 @@ feature 'Download buttons in branches page' do
status: status)
end
given!(:build) do
let!(:build) do
create(:ci_build, :success, :artifacts,
pipeline: pipeline,
status: pipeline.status,
name: 'build')
end
background do
before do
sign_in(user)
project.add_role(user, role)
end
......@@ -32,7 +32,7 @@ feature 'Download buttons in branches page' do
visit project_branches_filtered_path(project, state: 'all', search: 'binary-encoding')
end
scenario 'shows download artifacts button' do
it 'shows download artifacts button' do
href = latest_succeeded_project_artifacts_path(project, 'binary-encoding/download', job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
......
require 'spec_helper'
feature 'Clusters Applications', :js do
describe 'Clusters Applications', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......@@ -19,7 +19,7 @@ feature 'Clusters Applications', :js do
context 'when cluster is being created' do
let(:cluster) { create(:cluster, :providing_by_gcp, projects: [project])}
scenario 'user is unable to install applications' do
it 'user is unable to install applications' do
page.within('.js-cluster-application-row-helm') do
expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to eq('true')
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Install')
......@@ -30,7 +30,7 @@ feature 'Clusters Applications', :js do
context 'when cluster is created' do
let(:cluster) { create(:cluster, :provided_by_gcp, projects: [project])}
scenario 'user can install applications' do
it 'user can install applications' do
page.within('.js-cluster-application-row-helm') do
expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to be_nil
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Install')
......
require 'spec_helper'
feature 'Gcp Cluster', :js do
describe 'Gcp Cluster', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Interchangeability between KubernetesService and Platform::Kubernetes' do
describe 'Interchangeability between KubernetesService and Platform::Kubernetes' do
EXCEPT_METHODS = %i[test title description help fields initialize_properties namespace namespace= api_url api_url= deprecated? deprecation_message].freeze
EXCEPT_METHODS_GREP_V = %w[_touched? _changed? _was].freeze
......
require 'spec_helper'
feature 'User Cluster', :js do
describe 'User Cluster', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Clusters', :js do
describe 'Clusters', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'project commit pipelines', :js do
given(:project) { create(:project, :repository) }
describe 'project commit pipelines', :js do
let(:project) { create(:project, :repository) }
background do
before do
user = create(:user)
project.add_master(user)
sign_in(user)
end
context 'when no builds triggered yet' do
background do
before do
create(:ci_pipeline, project: project,
sha: project.commit.sha,
ref: 'master')
end
scenario 'user views commit pipelines page' do
it 'user views commit pipelines page' do
visit pipelines_project_commit_path(project, project.commit.sha)
page.within('.table-holder') do
......
require 'spec_helper'
feature 'Commit diff', :js do
describe 'Commit diff', :js do
include RepoHelpers
let(:user) { create(:user) }
......
require 'rails_helper'
feature 'Mini Pipeline Graph in Commit View', :js do
describe 'Mini Pipeline Graph in Commit View', :js do
let(:project) { create(:project, :public, :repository) }
context 'when commit has pipelines' do
......
require 'spec_helper'
feature 'Project Commits RSS' do
describe 'Project Commits RSS' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
let(:path) { project_commits_path(project, :master) }
......
require 'spec_helper'
feature 'Diff file viewer', :js do
describe 'Diff file viewer', :js do
let(:project) { create(:project, :public, :repository) }
def visit_commit(sha, anchor: nil)
......
require 'spec_helper'
feature 'Environment > Metrics' do
describe 'Environment > Metrics' do
include PrometheusHelpers
given(:user) { create(:user) }
given(:project) { create(:prometheus_project) }
given(:pipeline) { create(:ci_pipeline, project: project) }
given(:build) { create(:ci_build, pipeline: pipeline) }
given(:environment) { create(:environment, project: project) }
given(:current_time) { Time.now.utc }
let(:user) { create(:user) }
let(:project) { create(:prometheus_project) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
let(:environment) { create(:environment, project: project) }
let(:current_time) { Time.now.utc }
background do
before do
project.add_developer(user)
create(:deployment, environment: environment, deployable: build)
stub_all_prometheus_requests(environment.slug)
......@@ -24,7 +24,7 @@ feature 'Environment > Metrics' do
end
context 'with deployments and related deployable present' do
scenario 'shows metrics' do
it 'shows metrics' do
click_link('See metrics')
expect(page).to have_css('div#prometheus-graphs')
......
require 'spec_helper'
feature 'Environment' do
given(:project) { create(:project) }
given(:user) { create(:user) }
given(:role) { :developer }
describe 'Environment' do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:role) { :developer }
background do
before do
sign_in(user)
project.add_role(user, role)
end
feature 'environment details page' do
given!(:environment) { create(:environment, project: project) }
given!(:permissions) { }
given!(:deployment) { }
given!(:action) { }
describe 'environment details page' do
let!(:environment) { create(:environment, project: project) }
let!(:permissions) { }
let!(:deployment) { }
let!(:action) { }
before do
visit_environment(environment)
end
scenario 'shows environment name' do
it 'shows environment name' do
expect(page).to have_content(environment.name)
end
context 'without deployments' do
scenario 'does show no deployments' do
it 'does show no deployments' do
expect(page).to have_content('You don\'t have any deployments right now.')
end
end
context 'with deployments' do
context 'when there is no related deployable' do
given(:deployment) do
let(:deployment) do
create(:deployment, environment: environment, deployable: nil)
end
scenario 'does show deployment SHA' do
it 'does show deployment SHA' do
expect(page).to have_link(deployment.short_sha)
expect(page).not_to have_link('Re-deploy')
expect(page).not_to have_terminal_button
......@@ -44,27 +44,27 @@ feature 'Environment' do
end
context 'with related deployable present' do
given(:pipeline) { create(:ci_pipeline, project: project) }
given(:build) { create(:ci_build, pipeline: pipeline) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
given(:deployment) do
let(:deployment) do
create(:deployment, environment: environment, deployable: build)
end
scenario 'does show build name' do
it 'does show build name' do
expect(page).to have_link("#{build.name} (##{build.id})")
expect(page).to have_link('Re-deploy')
expect(page).not_to have_terminal_button
end
context 'with manual action' do
given(:action) do
let(:action) do
create(:ci_build, :manual, pipeline: pipeline,
name: 'deploy to production')
end
context 'when user has ability to trigger deployment' do
given(:permissions) do
let(:permissions) do
create(:protected_branch, :developers_can_merge,
name: action.ref, project: project)
end
......@@ -91,11 +91,11 @@ feature 'Environment' do
end
context 'with external_url' do
given(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') }
given(:build) { create(:ci_build, pipeline: pipeline) }
given(:deployment) { create(:deployment, environment: environment, deployable: build) }
let(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') }
let(:build) { create(:ci_build, pipeline: pipeline) }
let(:deployment) { create(:deployment, environment: environment, deployable: build) }
scenario 'does show an external link button' do
it 'does show an external link button' do
expect(page).to have_link(nil, href: environment.external_url)
end
end
......@@ -105,7 +105,7 @@ feature 'Environment' do
context 'for project master' do
let(:role) { :master }
scenario 'it shows the terminal button' do
it 'it shows the terminal button' do
expect(page).to have_terminal_button
end
......@@ -126,7 +126,7 @@ feature 'Environment' do
context 'for developer' do
let(:role) { :developer }
scenario 'does not show terminal button' do
it 'does not show terminal button' do
expect(page).not_to have_terminal_button
end
end
......@@ -148,19 +148,19 @@ feature 'Environment' do
context 'when environment is available' do
context 'with stop action' do
given(:action) do
let(:action) do
create(:ci_build, :manual, pipeline: pipeline,
name: 'close_app')
end
given(:deployment) do
let(:deployment) do
create(:deployment, environment: environment,
deployable: build,
on_stop: 'close_app')
end
context 'when user has ability to stop environment' do
given(:permissions) do
let(:permissions) do
create(:protected_branch, :developers_can_merge,
name: action.ref, project: project)
end
......@@ -181,7 +181,7 @@ feature 'Environment' do
context 'for reporter' do
let(:role) { :reporter }
scenario 'does not show stop button' do
it 'does not show stop button' do
expect(page).not_to have_link('Stop')
end
end
......@@ -189,9 +189,9 @@ feature 'Environment' do
end
context 'when environment is stopped' do
given(:environment) { create(:environment, project: project, state: :stopped) }
let(:environment) { create(:environment, project: project, state: :stopped) }
scenario 'does not show stop button' do
it 'does not show stop button' do
expect(page).not_to have_link('Stop')
end
end
......@@ -200,7 +200,7 @@ feature 'Environment' do
end
end
feature 'environment folders', :js do
describe 'environment folders', :js do
context 'when folder name contains special charaters' do
before do
create(:environment, project: project,
......@@ -219,21 +219,21 @@ feature 'Environment' do
end
end
feature 'auto-close environment when branch is deleted' do
given(:project) { create(:project, :repository) }
describe 'auto-close environment when branch is deleted' do
let(:project) { create(:project, :repository) }
given!(:environment) do
let!(:environment) do
create(:environment, :with_review_app, project: project,
ref: 'feature')
end
scenario 'user visits environment page' do
it 'user visits environment page' do
visit_environment(environment)
expect(page).to have_link('Stop')
end
scenario 'user deletes the branch with running environment' do
it 'user deletes the branch with running environment' do
visit project_branches_filtered_path(project, state: 'all', search: 'feature')
remove_branch_with_hooks(project, user, 'feature') do
......
require 'spec_helper'
feature 'Environments page', :js do
given(:project) { create(:project) }
given(:user) { create(:user) }
given(:role) { :developer }
describe 'Environments page', :js do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:role) { :developer }
background do
before do
project.add_role(user, role)
sign_in(user)
end
......@@ -99,7 +99,7 @@ feature 'Environments page', :js do
end
describe 'environments table' do
given!(:environment) do
let!(:environment) do
create(:environment, project: project, state: :available)
end
......@@ -125,9 +125,9 @@ feature 'Environments page', :js do
end
context 'when there are deployments' do
given(:project) { create(:project, :repository) }
let(:project) { create(:project, :repository) }
given!(:deployment) do
let!(:deployment) do
create(:deployment, environment: environment,
sha: project.commit.id)
end
......@@ -140,14 +140,14 @@ feature 'Environments page', :js do
end
context 'when builds and manual actions are present' do
given!(:pipeline) { create(:ci_pipeline, project: project) }
given!(:build) { create(:ci_build, pipeline: pipeline) }
let!(:pipeline) { create(:ci_pipeline, project: project) }
let!(:build) { create(:ci_build, pipeline: pipeline) }
given!(:action) do
let!(:action) do
create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production')
end
given!(:deployment) do
let!(:deployment) do
create(:deployment, environment: environment,
deployable: build,
sha: project.commit.id)
......@@ -190,9 +190,9 @@ feature 'Environments page', :js do
end
context 'with external_url' do
given(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') }
given(:build) { create(:ci_build, pipeline: pipeline) }
given(:deployment) { create(:deployment, environment: environment, deployable: build) }
let(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') }
let(:build) { create(:ci_build, pipeline: pipeline) }
let(:deployment) { create(:deployment, environment: environment, deployable: build) }
it 'shows an external link button' do
expect(page).to have_link(nil, href: environment.external_url)
......@@ -200,11 +200,11 @@ feature 'Environments page', :js do
end
context 'with stop action' do
given(:action) do
let(:action) do
create(:ci_build, :manual, pipeline: pipeline, name: 'close_app')
end
given(:deployment) do
let(:deployment) do
create(:deployment, environment: environment,
deployable: build,
on_stop: 'close_app')
......@@ -271,9 +271,9 @@ feature 'Environments page', :js do
end
context 'user is a developer' do
given(:role) { :developer }
let(:role) { :developer }
scenario 'developer creates a new environment with a valid name' do
it 'developer creates a new environment with a valid name' do
within(".top-area") { click_link 'New environment' }
fill_in('Name', with: 'production')
click_on 'Save'
......@@ -281,7 +281,7 @@ feature 'Environments page', :js do
expect(page).to have_content('production')
end
scenario 'developer creates a new environmetn with invalid name' do
it 'developer creates a new environmetn with invalid name' do
within(".top-area") { click_link 'New environment' }
fill_in('Name', with: 'name,with,commas')
click_on 'Save'
......@@ -291,9 +291,9 @@ feature 'Environments page', :js do
end
context 'user is a reporter' do
given(:role) { :reporter }
let(:role) { :reporter }
scenario 'reporters tries to create a new environment' do
it 'reporters tries to create a new environment' do
expect(page).not_to have_link('New environment')
end
end
......@@ -309,7 +309,7 @@ feature 'Environments page', :js do
state: :available)
end
scenario 'users unfurls an environment folder' do
it 'users unfurls an environment folder' do
visit_environments(project)
expect(page).not_to have_content 'review-1'
......@@ -335,7 +335,7 @@ feature 'Environments page', :js do
state: :available)
end
scenario 'user opens folder view' do
it 'user opens folder view' do
visit folder_project_environments_path(project, 'staging.review')
wait_for_requests
......
require 'spec_helper'
feature 'Template selector menu', :js do
describe 'Template selector menu', :js do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
......@@ -14,7 +14,7 @@ feature 'Template selector menu', :js do
create_and_edit_file('README.md')
end
scenario 'is not displayed' do
it 'is not displayed' do
check_template_selector_menu_display(false)
end
......@@ -23,7 +23,7 @@ feature 'Template selector menu', :js do
click_link 'Preview'
end
scenario 'template selector menu is not displayed' do
it 'template selector menu is not displayed' do
check_template_selector_menu_display(false)
click_link 'Write'
check_template_selector_menu_display(false)
......@@ -36,7 +36,7 @@ feature 'Template selector menu', :js do
visit project_edit_blob_path(project, File.join(project.default_branch, 'LICENSE'))
end
scenario 'is displayed' do
it 'is displayed' do
check_template_selector_menu_display(true)
end
......@@ -45,7 +45,7 @@ feature 'Template selector menu', :js do
click_link 'Preview'
end
scenario 'template selector menu is hidden and shown correctly' do
it 'template selector menu is hidden and shown correctly' do
check_template_selector_menu_display(false)
click_link 'Write'
check_template_selector_menu_display(true)
......
......@@ -17,7 +17,7 @@ describe 'user reads pipeline status', :js do
end
shared_examples 'visiting project tree' do
scenario 'sees the correct pipeline status' do
it 'sees the correct pipeline status' do
visit project_tree_path(project, expected_pipeline.ref)
wait_for_requests
......
require 'spec_helper'
feature 'Hook logs' do
given(:web_hook_log) { create(:web_hook_log, response_body: '<script>') }
given(:project) { web_hook_log.web_hook.project }
given(:user) { create(:user) }
describe 'Hook logs' do
let(:web_hook_log) { create(:web_hook_log, response_body: '<script>') }
let(:project) { web_hook_log.web_hook.project }
let(:user) { create(:user) }
before do
project.add_master(user)
......@@ -11,7 +11,7 @@ feature 'Hook logs' do
sign_in(user)
end
scenario 'user reads log without getting XSS' do
it 'user reads log without getting XSS' do
visit(
project_hook_hook_log_path(
project, web_hook_log.web_hook, web_hook_log))
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
# It looks up for any sensitive word inside the JSON, so if a sensitive word is found
# we'll have to either include it adding the model that includes it to the +safe_list+
# or make sure the attribute is blacklisted in the +import_export.yml+ configuration
feature 'Import/Export - project export integration test', :js do
describe 'Import/Export - project export integration test', :js do
include Select2Helper
include ExportFileHelper
......@@ -23,7 +23,7 @@ feature 'Import/Export - project export integration test', :js do
let(:project) { setup_project }
background do
before do
allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
end
......@@ -36,7 +36,7 @@ feature 'Import/Export - project export integration test', :js do
sign_in(user)
end
scenario 'exports a project successfully' do
it 'exports a project successfully' do
visit edit_project_path(project)
expect(page).to have_content('Export project')
......
require 'spec_helper'
feature 'Import/Export - project import integration test', :js do
describe 'Import/Export - project import integration test', :js do
include Select2Helper
let(:user) { create(:user) }
let(:file) { File.join(Rails.root, 'spec', 'features', 'projects', 'import_export', 'test_project_export.tar.gz') }
let(:export_path) { "#{Dir.tmpdir}/import_file_spec" }
background do
before do
allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
gitlab_sign_in(user)
end
......@@ -22,7 +22,7 @@ feature 'Import/Export - project import integration test', :js do
let(:project_path) { 'test-project-path' + SecureRandom.hex }
context 'prefilled the path' do
scenario 'user imports an exported project successfully' do
it 'user imports an exported project successfully' do
visit new_project_path
select2(namespace.id, from: '#project_namespace_id')
......@@ -51,7 +51,7 @@ feature 'Import/Export - project import integration test', :js do
end
context 'path is not prefilled' do
scenario 'user imports an exported project successfully' do
it 'user imports an exported project successfully' do
visit new_project_path
click_import_project_tab
click_link 'GitLab export'
......@@ -68,7 +68,7 @@ feature 'Import/Export - project import integration test', :js do
end
end
scenario 'invalid project' do
it 'invalid project' do
project = create(:project, namespace: user.namespace)
visit new_project_path
......
require 'spec_helper'
feature 'issuable templates', :js do
describe 'issuable templates', :js do
include ProjectForksHelper
let(:user) { create(:user) }
......@@ -18,7 +18,7 @@ feature 'issuable templates', :js do
let(:issue) { create(:issue, author: user, assignees: [user], project: project) }
let(:description_addition) { ' appending to description' }
background do
before do
project.repository.create_file(
user,
'.gitlab/issue_templates/bug.md',
......@@ -36,14 +36,14 @@ feature 'issuable templates', :js do
fill_in :'issuable-title', with: 'test issue title'
end
scenario 'user selects "bug" template' do
it 'user selects "bug" template' do
select_template 'bug'
wait_for_requests
assert_template(page_part: issue_form_location)
save_changes
end
scenario 'user selects "bug" template and then "no template"' do
it 'user selects "bug" template and then "no template"' do
select_template 'bug'
wait_for_requests
select_option 'No template'
......@@ -51,7 +51,7 @@ feature 'issuable templates', :js do
save_changes('')
end
scenario 'user selects "bug" template, edits description and then selects "reset template"' do
it 'user selects "bug" template, edits description and then selects "reset template"' do
select_template 'bug'
wait_for_requests
find_field('issue-description').send_keys(description_addition)
......@@ -67,7 +67,7 @@ feature 'issuable templates', :js do
let(:template_content) { 'this is a test "bug" template' }
let(:issue) { create(:issue, author: user, assignees: [user], project: project) }
background do
before do
project.repository.create_file(
user,
'.gitlab/issue_templates/bug.md',
......@@ -80,7 +80,7 @@ feature 'issuable templates', :js do
fill_in :'issue-description', with: prior_description
end
scenario 'user selects "bug" template' do
it 'user selects "bug" template' do
select_template 'bug'
wait_for_requests
assert_template(page_part: issue_form_location)
......@@ -92,7 +92,7 @@ feature 'issuable templates', :js do
let(:template_content) { 'this is a test "feature-proposal" template' }
let(:merge_request) { create(:merge_request, :with_diffs, source_project: project) }
background do
before do
project.repository.create_file(
user,
'.gitlab/merge_request_templates/feature-proposal.md',
......@@ -103,7 +103,7 @@ feature 'issuable templates', :js do
fill_in :'merge_request[title]', with: 'test merge request title'
end
scenario 'user selects "feature-proposal" template' do
it 'user selects "feature-proposal" template' do
select_template 'feature-proposal'
wait_for_requests
assert_template
......@@ -117,7 +117,7 @@ feature 'issuable templates', :js do
let(:forked_project) { fork_project(project, fork_user, repository: true) }
let(:merge_request) { create(:merge_request, :with_diffs, source_project: forked_project, target_project: project) }
background do
before do
sign_out(:user)
project.add_developer(fork_user)
......@@ -136,7 +136,7 @@ feature 'issuable templates', :js do
context 'feature proposal template' do
context 'template exists in target project' do
scenario 'user selects template' do
it 'user selects template' do
select_template 'feature-proposal'
wait_for_requests
assert_template
......
require 'spec_helper'
feature 'Project Issues RSS' do
describe 'Project Issues RSS' do
let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
let(:path) { project_issues_path(project) }
......
require 'spec_helper'
require 'tempfile'
feature 'Jobs', :clean_gitlab_redis_shared_state do
describe 'Jobs', :clean_gitlab_redis_shared_state do
let(:user) { create(:user) }
let(:user_access_level) { :developer }
let(:project) { create(:project, :repository) }
......@@ -259,7 +259,7 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
end
end
feature 'Raw trace' do
describe 'Raw trace' do
before do
job.run!
......@@ -271,7 +271,7 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
end
end
feature 'HTML trace', :js do
describe 'HTML trace', :js do
before do
job.run!
......@@ -291,7 +291,7 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
end
end
feature 'Variables' do
describe 'Variables' do
let(:trigger_request) { create(:ci_trigger_request) }
let(:job) do
......
require 'spec_helper'
feature 'Issue prioritization' do
describe 'Issue prioritization' do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
......@@ -13,7 +13,7 @@ feature 'Issue prioritization' do
# According to https://gitlab.com/gitlab-org/gitlab-ce/issues/14189#note_4360653
context 'when issues have one label' do
scenario 'Are sorted properly' do
it 'Are sorted properly' do
# Issues
issue_1 = create(:issue, title: 'issue_1', project: project)
issue_2 = create(:issue, title: 'issue_2', project: project)
......@@ -43,7 +43,7 @@ feature 'Issue prioritization' do
end
context 'when issues have multiple labels' do
scenario 'Are sorted properly' do
it 'Are sorted properly' do
# Issues
issue_1 = create(:issue, title: 'issue_1', project: project)
issue_2 = create(:issue, title: 'issue_2', project: project)
......
require 'spec_helper'
feature 'Labels subscription' do
describe 'Labels subscription' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, :public, namespace: group) }
......@@ -13,7 +13,7 @@ feature 'Labels subscription' do
sign_in user
end
scenario 'users can subscribe/unsubscribe to labels', :js do
it 'users can subscribe/unsubscribe to labels', :js do
visit project_labels_path(project)
expect(page).to have_content('bug')
......
require 'spec_helper'
feature 'Prioritize labels' do
describe 'Prioritize labels' do
include DragTo
let(:user) { create(:user) }
......@@ -17,7 +17,7 @@ feature 'Prioritize labels' do
sign_in user
end
scenario 'user can prioritize a group label', :js do
it 'user can prioritize a group label', :js do
visit project_labels_path(project)
expect(page).to have_content('Star labels to start sorting by priority')
......@@ -34,7 +34,7 @@ feature 'Prioritize labels' do
end
end
scenario 'user can unprioritize a group label', :js do
it 'user can unprioritize a group label', :js do
create(:label_priority, project: project, label: feature, priority: 1)
visit project_labels_path(project)
......@@ -52,7 +52,7 @@ feature 'Prioritize labels' do
end
end
scenario 'user can prioritize a project label', :js do
it 'user can prioritize a project label', :js do
visit project_labels_path(project)
expect(page).to have_content('Star labels to start sorting by priority')
......@@ -69,7 +69,7 @@ feature 'Prioritize labels' do
end
end
scenario 'user can unprioritize a project label', :js do
it 'user can unprioritize a project label', :js do
create(:label_priority, project: project, label: bug, priority: 1)
visit project_labels_path(project)
......@@ -88,7 +88,7 @@ feature 'Prioritize labels' do
end
end
scenario 'user can sort prioritized labels and persist across reloads', :js do
it 'user can sort prioritized labels and persist across reloads', :js do
create(:label_priority, project: project, label: bug, priority: 1)
create(:label_priority, project: project, label: feature, priority: 2)
......
require 'spec_helper'
feature 'Projects > Labels > User sees links to issuables' do
describe 'Projects > Labels > User sees links to issuables' do
set(:user) { create(:user) }
before do
......@@ -16,7 +16,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when merge requests and issues are enabled for the project' do
let(:project) { create(:project, :public) }
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 open issues')
end
......@@ -25,7 +25,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when issues are disabled for the project' do
let(:project) { create(:project, :public, issues_access_level: ProjectFeature::DISABLED) }
scenario 'shows links to MRs but not to issues' do
it 'shows links to MRs but not to issues' do
expect(page).to have_link('view merge requests')
expect(page).not_to have_link('view open issues')
end
......@@ -34,7 +34,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when merge requests are disabled for the project' do
let(:project) { create(:project, :public, merge_requests_access_level: ProjectFeature::DISABLED) }
scenario 'shows links to issues but not to MRs' do
it 'shows links to issues but not to MRs' do
expect(page).not_to have_link('view merge requests')
expect(page).to have_link('view open issues')
end
......@@ -48,7 +48,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when merge requests and issues are enabled for the project' do
let(:project) { create(:project, :public, namespace: group) }
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 open issues')
end
......@@ -57,7 +57,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when issues are disabled for the project' do
let(:project) { create(:project, :public, namespace: group, issues_access_level: ProjectFeature::DISABLED) }
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 open issues')
end
......@@ -66,7 +66,7 @@ feature 'Projects > Labels > User sees links to issuables' do
context 'when merge requests are disabled for the project' do
let(:project) { create(:project, :public, namespace: group, merge_requests_access_level: ProjectFeature::DISABLED) }
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 open issues')
end
......
require 'spec_helper'
feature 'Projects > Members > Anonymous user sees members' do
describe 'Projects > Members > Anonymous user sees members' do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:project) { create(:project, :public) }
background do
before do
project.add_master(user)
create(:project_group_link, project: project, group: group)
end
scenario "anonymous user visits the project's members page and sees the list of members" do
it "anonymous user visits the project's members page and sees the list of members" do
visit project_project_members_path(project)
expect(current_path).to eq(
......
require 'spec_helper'
feature 'Projects > Members > Group member cannot leave group project' do
describe 'Projects > Members > Group member cannot leave group project' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
background do
before do
group.add_developer(user)
sign_in(user)
visit project_path(project)
end
scenario 'user does not see a "Leave project" link' do
it 'user does not see a "Leave project" link' do
expect(page).not_to have_content 'Leave project'
end
end
require 'spec_helper'
feature 'Projects > Members > Group member cannot request access to his group project' do
describe 'Projects > Members > Group member cannot request access to his group project' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
scenario 'owner does not see the request access button' do
it 'owner does not see the request access button' do
group.add_owner(user)
login_and_visit_project_page(user)
expect(page).not_to have_content 'Request Access'
end
scenario 'master does not see the request access button' do
it 'master does not see the request access button' do
group.add_master(user)
login_and_visit_project_page(user)
expect(page).not_to have_content 'Request Access'
end
scenario 'developer does not see the request access button' do
it 'developer does not see the request access button' do
group.add_developer(user)
login_and_visit_project_page(user)
expect(page).not_to have_content 'Request Access'
end
scenario 'reporter does not see the request access button' do
it 'reporter does not see the request access button' do
group.add_reporter(user)
login_and_visit_project_page(user)
expect(page).not_to have_content 'Request Access'
end
scenario 'guest does not see the request access button' do
it 'guest does not see the request access button' do
group.add_guest(user)
login_and_visit_project_page(user)
......
require 'spec_helper'
feature 'Projects members' do
describe 'Projects members' do
let(:user) { create(:user) }
let(:developer) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) }
......@@ -10,7 +10,7 @@ feature 'Projects members' do
let(:project_requester) { create(:user) }
let(:group_requester) { create(:user) }
background do
before do
project.add_developer(developer)
group.add_owner(user)
sign_in(user)
......@@ -22,7 +22,7 @@ feature 'Projects members' do
visit project_settings_members_path(project)
end
scenario 'does not appear in the project members page' do
it 'does not appear in the project members page' do
page.within first('.content-list') do
expect(page).not_to have_content('test2@abc.com')
end
......@@ -36,7 +36,7 @@ feature 'Projects members' do
visit project_settings_members_path(project)
end
scenario 'shows the project invitee, the project developer, and the group owner' do
it 'shows the project invitee, the project developer, and the group owner' do
page.within first('.content-list') do
expect(page).to have_content('test1@abc.com')
expect(page).not_to have_content('test2@abc.com')
......@@ -57,7 +57,7 @@ feature 'Projects members' do
visit project_settings_members_path(project)
end
scenario 'does not appear in the project members page' do
it 'does not appear in the project members page' do
page.within first('.content-list') do
expect(page).not_to have_content(group_requester.name)
end
......@@ -71,7 +71,7 @@ feature 'Projects members' do
visit project_settings_members_path(project)
end
scenario 'shows the project requester, the project developer, and the group owner' do
it 'shows the project requester, the project developer, and the group owner' do
page.within first('.content-list') do
expect(page).to have_content(project_requester.name)
expect(page).not_to have_content(group_requester.name)
......
require 'spec_helper'
feature 'Projects > Members > Group requester cannot request access to project', :js do
describe 'Projects > Members > Group requester cannot request access to project', :js do
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) }
let(:project) { create(:project, :public, :access_requestable, namespace: group) }
background do
before do
group.add_owner(owner)
sign_in(user)
visit group_path(group)
......@@ -14,7 +14,7 @@ feature 'Projects > Members > Group requester cannot request access to project',
visit project_path(project)
end
scenario 'group requester does not see the request access / withdraw access request button' do
it 'group requester does not see the request access / withdraw access request button' do
expect(page).not_to have_content 'Request Access'
expect(page).not_to have_content 'Withdraw Access Request'
end
......
require 'spec_helper'
feature 'Projects > Members > Groups with access list', :js do
describe 'Projects > Members > Groups with access list', :js do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:project) { create(:project, :public) }
background do
before do
project.add_master(user)
@group_link = create(:project_group_link, project: project, group: group)
......@@ -13,7 +13,7 @@ feature 'Projects > Members > Groups with access list', :js do
visit project_settings_members_path(project)
end
scenario 'updates group access level' do
it 'updates group access level' do
click_button @group_link.human_access
page.within '.dropdown-menu' do
......@@ -27,7 +27,7 @@ feature 'Projects > Members > Groups with access list', :js do
expect(first('.group_member')).to have_content('Guest')
end
scenario 'updates expiry date' do
it 'updates expiry date' do
tomorrow = Date.today + 3
fill_in "member_expires_at_#{group.id}", with: tomorrow.strftime("%F")
......@@ -39,7 +39,7 @@ feature 'Projects > Members > Groups with access list', :js do
end
end
scenario 'deletes group link' do
it 'deletes group link' do
page.within(first('.group_member')) do
accept_confirm { find('.btn-remove').click }
end
......@@ -49,7 +49,7 @@ feature 'Projects > Members > Groups with access list', :js do
end
context 'search in existing members (yes, this filters the groups list as well)' do
scenario 'finds no results' do
it 'finds no results' do
page.within '.member-search-form' do
fill_in 'search', with: 'testing 123'
find('.member-search-btn').click
......@@ -58,7 +58,7 @@ feature 'Projects > Members > Groups with access list', :js do
expect(page).not_to have_selector('.group_member')
end
scenario 'finds results' do
it 'finds results' do
page.within '.member-search-form' do
fill_in 'search', with: group.name
find('.member-search-btn').click
......
require 'spec_helper'
feature 'Project members list' do
describe 'Project members list' do
include Select2Helper
let(:user1) { create(:user, name: 'John Doe') }
......@@ -8,12 +8,12 @@ feature 'Project members list' do
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
background do
before do
sign_in(user1)
group.add_owner(user1)
end
scenario 'show members from project and group' do
it 'show members from project and group' do
project.add_developer(user2)
visit_members_page
......@@ -22,7 +22,7 @@ feature 'Project members list' do
expect(second_row.text).to include(user2.name)
end
scenario 'show user once if member of both group and project' do
it 'show user once if member of both group and project' do
project.add_developer(user1)
visit_members_page
......@@ -31,7 +31,7 @@ feature 'Project members list' do
expect(second_row).to be_blank
end
scenario 'update user acess level', :js do
it 'update user acess level', :js do
project.add_developer(user2)
visit_members_page
......@@ -44,7 +44,7 @@ feature 'Project members list' do
end
end
scenario 'add user to project', :js do
it 'add user to project', :js do
visit_members_page
add_user(user2.id, 'Reporter')
......@@ -55,7 +55,7 @@ feature 'Project members list' do
end
end
scenario 'remove user from project', :js do
it 'remove user from project', :js do
other_user = create(:user)
project.add_developer(other_user)
......@@ -71,7 +71,7 @@ feature 'Project members list' do
expect(project.users).not_to include(other_user)
end
scenario 'invite user to project', :js do
it 'invite user to project', :js do
visit_members_page
add_user('test@example.com', 'Reporter')
......
require 'spec_helper'
feature 'Projects > Members > Master adds member with expiration date', :js do
describe 'Projects > Members > Master adds member with expiration date', :js do
include Select2Helper
include ActiveSupport::Testing::TimeHelpers
......@@ -8,12 +8,12 @@ feature 'Projects > Members > Master adds member with expiration date', :js do
let(:project) { create(:project) }
let!(:new_member) { create(:user) }
background do
before do
project.add_master(master)
sign_in(master)
end
scenario 'expiration date is displayed in the members list' do
it 'expiration date is displayed in the members list' do
travel_to Time.zone.parse('2016-08-06 08:00') do
date = 4.days.from_now
visit project_project_members_path(project)
......@@ -30,7 +30,7 @@ feature 'Projects > Members > Master adds member with expiration date', :js do
end
end
scenario 'change expiration date' do
it 'change expiration date' do
travel_to Time.zone.parse('2016-08-06 08:00') do
date = 3.days.from_now
project.team.add_users([new_member.id], :developer, expires_at: Date.today.to_s(:medium))
......
require 'spec_helper'
feature 'Projects > Members > Master manages access requests' do
describe 'Projects > Members > Master manages access requests' do
it_behaves_like 'Master manages access requests' do
let(:entity) { create(:project, :public, :access_requestable) }
let(:members_page_path) { project_project_members_path(entity) }
......
require 'spec_helper'
feature 'Projects > Members > Member cannot request access to his project' do
describe 'Projects > Members > Member cannot request access to his project' do
let(:member) { create(:user) }
let(:project) { create(:project) }
background do
before do
project.add_developer(member)
sign_in(member)
visit project_path(project)
end
scenario 'member does not see the request access button' do
it 'member does not see the request access button' do
expect(page).not_to have_content 'Request Access'
end
end
require 'spec_helper'
feature 'Projects > Members > Member leaves project' do
describe 'Projects > Members > Member leaves project' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
background do
before do
project.add_developer(user)
sign_in(user)
visit project_path(project)
end
scenario 'user leaves project' do
it 'user leaves project' do
click_link 'Leave project'
expect(current_path).to eq(dashboard_projects_path)
......
require 'spec_helper'
feature 'Projects > Members > Owner cannot leave project' do
describe 'Projects > Members > Owner cannot leave project' do
let(:project) { create(:project) }
background do
before do
sign_in(project.owner)
visit project_path(project)
end
scenario 'user does not see a "Leave project" link' do
it 'user does not see a "Leave project" link' do
expect(page).not_to have_content 'Leave project'
end
end
require 'spec_helper'
feature 'Projects > Members > Owner cannot request access to his project' do
describe 'Projects > Members > Owner cannot request access to his project' do
let(:project) { create(:project) }
background do
before do
sign_in(project.owner)
visit project_path(project)
end
scenario 'owner does not see the request access button' do
it 'owner does not see the request access button' do
expect(page).not_to have_content 'Request Access'
end
end
require 'spec_helper'
feature 'Project > Members > Share with Group', :js do
describe 'Project > Members > Share with Group', :js do
include Select2Helper
include ActionView::Helpers::DateHelper
......@@ -8,14 +8,14 @@ feature 'Project > Members > Share with Group', :js do
describe 'Share with group lock' do
shared_examples 'the project can be shared with groups' do
scenario 'the "Share with group" tab exists' do
it 'the "Share with group" tab exists' do
visit project_settings_members_path(project)
expect(page).to have_selector('#share-with-group-tab')
end
end
shared_examples 'the project cannot be shared with groups' do
scenario 'the "Share with group" tab does not exist' do
it 'the "Share with group" tab does not exist' do
visit project_settings_members_path(project)
expect(page).to have_selector('#add-member-tab')
expect(page).not_to have_selector('#share-with-group-tab')
......@@ -26,7 +26,7 @@ feature 'Project > Members > Share with Group', :js do
let!(:group_to_share_with) { create(:group) }
let(:project) { create(:project, namespace: create(:group)) }
background do
before do
project.add_master(master)
sign_in(master)
end
......@@ -34,7 +34,7 @@ feature 'Project > Members > Share with Group', :js do
context 'when the group has "Share with group lock" disabled' do
it_behaves_like 'the project can be shared with groups'
scenario 'the project can be shared with another group' do
it 'the project can be shared with another group' do
visit project_settings_members_path(project)
click_on 'share-with-group-tab'
......@@ -64,7 +64,7 @@ feature 'Project > Members > Share with Group', :js do
let(:subgroup) { create(:group, parent: root_group) }
let(:project) { create(:project, namespace: subgroup) }
background do
before do
project.add_master(master)
sign_in(master)
end
......@@ -126,7 +126,7 @@ feature 'Project > Members > Share with Group', :js do
find('.btn-create').click
end
scenario 'the group link shows the expiration time with a warning class' do
it 'the group link shows the expiration time with a warning class' do
page.within('.project-members-groups') do
# Using distance_of_time_in_words_to_now because it is not the same as
# subtraction, and this way avoids time zone issues as well
......@@ -141,7 +141,7 @@ feature 'Project > Members > Share with Group', :js do
context 'with multiple groups to choose from' do
let(:project) { create(:project) }
background do
before do
project.add_master(master)
sign_in(master)
......@@ -173,14 +173,14 @@ feature 'Project > Members > Share with Group', :js do
let!(:group_to_share_with) { create(:group) }
let!(:project) { create(:project, namespace: nested_group) }
background do
before do
project.add_master(master)
sign_in(master)
group.add_master(master)
group_to_share_with.add_master(master)
end
scenario 'the groups dropdown does not show ancestors', :nested_groups do
it 'the groups dropdown does not show ancestors', :nested_groups do
visit project_settings_members_path(project)
click_on 'share-with-group-tab'
......
require 'spec_helper'
feature 'Projects > Members > Sorting' do
describe 'Projects > Members > Sorting' do
let(:master) { create(:user, name: 'John Doe') }
let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) }
let(:project) { create(:project, namespace: master.namespace, creator: master) }
background do
before do
create(:project_member, :developer, user: developer, project: project, created_at: 3.days.ago)
sign_in(master)
end
scenario 'sorts alphabetically by default' do
it 'sorts alphabetically by default' do
visit_members_list(sort: nil)
expect(first_member).to include(master.name)
......@@ -19,7 +19,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end
scenario 'sorts by access level ascending' do
it 'sorts by access level ascending' do
visit_members_list(sort: :access_level_asc)
expect(first_member).to include(developer.name)
......@@ -27,7 +27,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, ascending')
end
scenario 'sorts by access level descending' do
it 'sorts by access level descending' do
visit_members_list(sort: :access_level_desc)
expect(first_member).to include(master.name)
......@@ -35,7 +35,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, descending')
end
scenario 'sorts by last joined' do
it 'sorts by last joined' do
visit_members_list(sort: :last_joined)
expect(first_member).to include(master.name)
......@@ -43,7 +43,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined')
end
scenario 'sorts by oldest joined' do
it 'sorts by oldest joined' do
visit_members_list(sort: :oldest_joined)
expect(first_member).to include(developer.name)
......@@ -51,7 +51,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined')
end
scenario 'sorts by name ascending' do
it 'sorts by name ascending' do
visit_members_list(sort: :name_asc)
expect(first_member).to include(master.name)
......@@ -59,7 +59,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end
scenario 'sorts by name descending' do
it 'sorts by name descending' do
visit_members_list(sort: :name_desc)
expect(first_member).to include(developer.name)
......@@ -67,7 +67,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
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)
expect(first_member).to include(master.name)
......@@ -75,7 +75,7 @@ feature 'Projects > Members > Sorting' do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in')
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)
expect(first_member).to include(developer.name)
......
require 'spec_helper'
feature 'Projects > Members > User requests access', :js do
describe 'Projects > Members > User requests access', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :access_requestable, :repository) }
let(:master) { project.owner }
background do
before do
sign_in(user)
visit project_path(project)
end
scenario 'request access feature is disabled' do
it 'request access feature is disabled' do
project.update_attributes(request_access_enabled: false)
visit project_path(project)
expect(page).not_to have_content 'Request Access'
end
scenario 'user can request access to a project' do
it 'user can request access to a project' do
perform_enqueued_jobs { click_link 'Request Access' }
expect(ActionMailer::Base.deliveries.last.to).to eq [master.notification_email]
......@@ -31,7 +31,7 @@ feature 'Projects > Members > User requests access', :js do
end
context 'code access is restricted' do
scenario 'user can request access' do
it 'user can request access' do
project.project_feature.update!(repository_access_level: ProjectFeature::PRIVATE,
builds_access_level: ProjectFeature::PRIVATE,
merge_requests_access_level: ProjectFeature::PRIVATE)
......@@ -41,7 +41,7 @@ feature 'Projects > Members > User requests access', :js do
end
end
scenario 'user is not listed in the project members page' do
it 'user is not listed in the project members page' do
click_link 'Request Access'
expect(project.requesters.exists?(user_id: user)).to be_truthy
......@@ -55,7 +55,7 @@ feature 'Projects > Members > User requests access', :js do
end
end
scenario 'user can withdraw its request for access' do
it 'user can withdraw its request for access' do
click_link 'Request Access'
expect(project.requesters.exists?(user_id: user)).to be_truthy
......
require 'spec_helper'
feature 'Merge Request button' do
describe 'Merge Request button' do
shared_examples 'Merge request button only shown when allowed' do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) }
......
require 'spec_helper'
feature 'Project milestone' do
describe 'Project milestone' do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:milestone) { create(:milestone, project: project) }
......
require 'spec_helper'
feature 'Milestones sorting', :js do
describe 'Milestones sorting', :js do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
......@@ -17,7 +17,7 @@ feature 'Milestones sorting', :js do
sign_in(user)
end
scenario 'visit project milestones and sort by due_date_asc' do
it 'visit project milestones and sort by due_date_asc' do
visit project_milestones_path(project)
expect(page).to have_button('Due soon')
......
require 'spec_helper'
feature 'Creating a new project milestone', :js do
describe 'Creating a new project milestone', :js do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
......
require 'spec_helper'
feature 'New project' do
describe 'New project' do
include Select2Helper
let(:user) { create(:admin) }
......
require 'spec_helper'
feature 'Pages' do
given(:project) { create(:project) }
given(:user) { create(:user) }
given(:role) { :master }
describe 'Pages' do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:role) { :master }
background do
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
project.add_role(user, role)
......@@ -14,7 +14,7 @@ feature 'Pages' do
end
shared_examples 'no pages deployed' do
scenario 'does not see anything to destroy' do
it 'does not see anything to destroy' do
visit project_pages_path(project)
expect(page).to have_content('Configure pages')
......@@ -24,16 +24,16 @@ feature 'Pages' do
end
context 'when user is the owner' do
background do
before do
project.namespace.update(owner: user)
end
context 'when pages deployed' do
background do
before do
allow_any_instance_of(Project).to receive(:pages_deployed?) { true }
end
scenario 'renders Access pages' do
it 'renders Access pages' do
visit project_pages_path(project)
expect(page).to have_content('Access pages')
......@@ -48,7 +48,7 @@ feature 'Pages' do
end
context 'when pages are exposed on external HTTP address', :http_pages_enabled do
given(:project) { create(:project, pages_https_only: false) }
let(:project) { create(:project, pages_https_only: false) }
shared_examples 'adds new domain' do
it 'adds new domain' do
......@@ -210,11 +210,11 @@ feature 'Pages' do
context 'when the user is not the owner' do
context 'when pages deployed' do
background do
before do
allow_any_instance_of(Project).to receive(:pages_deployed?) { true }
end
scenario 'sees "Only the project owner can remove pages" text' do
it 'sees "Only the project owner can remove pages" text' do
visit project_pages_path(project)
expect(page).to have_text('Only the project owner can remove pages')
......@@ -225,13 +225,13 @@ feature 'Pages' do
end
describe 'HTTPS settings', :js, :https_pages_enabled do
background do
before do
project.namespace.update(owner: user)
allow_any_instance_of(Project).to receive(:pages_deployed?) { true }
end
scenario 'tries to change the setting' do
it 'tries to change the setting' do
visit project_pages_path(project)
expect(page).to have_content("Force domains with SSL certificates to use HTTPS")
......@@ -251,7 +251,7 @@ feature 'Pages' do
allow(service).to receive(:execute).and_return(status: :error)
end
scenario 'tries to change the setting' do
it 'tries to change the setting' do
visit project_pages_path(project)
uncheck :project_pages_https_only
......@@ -263,13 +263,13 @@ feature 'Pages' do
end
context 'non-HTTPS domain exists' do
given(:project) { create(:project, pages_https_only: false) }
let(:project) { create(:project, pages_https_only: false) }
before do
create(:pages_domain, :without_key, :without_certificate, project: project)
end
scenario 'the setting is disabled' do
it 'the setting is disabled' do
visit project_pages_path(project)
expect(page).to have_field(:project_pages_https_only, disabled: true)
......@@ -278,7 +278,7 @@ feature 'Pages' do
end
context 'HTTPS pages are disabled', :https_pages_disabled do
scenario 'the setting is unavailable' do
it 'the setting is unavailable' do
visit project_pages_path(project)
expect(page).not_to have_field(:project_pages_https_only)
......
require 'spec_helper'
feature 'Pipeline Schedules', :js do
describe 'Pipeline Schedules', :js do
include PipelineSchedulesHelper
let!(:project) { create(:project, :repository) }
......@@ -155,7 +155,7 @@ feature 'Pipeline Schedules', :js do
end
context 'when user creates a new pipeline schedule with variables' do
background do
before do
visit_pipelines_schedules
click_link 'New schedule'
fill_in_schedule_form
......@@ -166,7 +166,7 @@ feature 'Pipeline Schedules', :js do
save_pipeline_schedule
end
scenario 'user sees the new variable in edit window' do
it 'user sees the new variable in edit window' do
find(".content-list .pipeline-schedule-table-row:nth-child(1) .btn-group a[title='Edit']").click
page.within('.ci-variable-list') do
expect(find(".ci-variable-row:nth-child(1) .js-ci-variable-input-key").value).to eq('AAA')
......@@ -178,7 +178,7 @@ feature 'Pipeline Schedules', :js do
end
context 'when user edits a variable of a pipeline schedule' do
background do
before do
create(:ci_pipeline_schedule, project: project, owner: user).tap do |pipeline_schedule|
create(:ci_pipeline_schedule_variable, key: 'AAA', value: 'AAA123', pipeline_schedule: pipeline_schedule)
end
......@@ -192,7 +192,7 @@ feature 'Pipeline Schedules', :js do
click_button 'Save pipeline schedule'
end
scenario 'user sees the updated variable in edit window' do
it 'user sees the updated variable in edit window' do
find(".content-list .pipeline-schedule-table-row:nth-child(1) .btn-group a[title='Edit']").click
page.within('.ci-variable-list') do
expect(find(".ci-variable-row:nth-child(1) .js-ci-variable-input-key").value).to eq('foo')
......@@ -202,7 +202,7 @@ feature 'Pipeline Schedules', :js do
end
context 'when user removes a variable of a pipeline schedule' do
background do
before do
create(:ci_pipeline_schedule, project: project, owner: user).tap do |pipeline_schedule|
create(:ci_pipeline_schedule_variable, key: 'AAA', value: 'AAA123', pipeline_schedule: pipeline_schedule)
end
......@@ -213,7 +213,7 @@ feature 'Pipeline Schedules', :js do
click_button 'Save pipeline schedule'
end
scenario 'user does not see the removed variable in edit window' do
it 'user does not see the removed variable in edit window' do
find(".content-list .pipeline-schedule-table-row:nth-child(1) .btn-group a[title='Edit']").click
page.within('.ci-variable-list') do
expect(find(".ci-variable-row:nth-child(1) .js-ci-variable-input-key").value).to eq('')
......@@ -223,13 +223,13 @@ feature 'Pipeline Schedules', :js do
end
context 'when active is true and next_run_at is NULL' do
background do
before do
create(:ci_pipeline_schedule, project: project, owner: user).tap do |pipeline_schedule|
pipeline_schedule.update_attribute(:cron, nil) # Consequently next_run_at will be nil
end
end
scenario 'user edit and recover the problematic pipeline schedule' do
it 'user edit and recover the problematic pipeline schedule' do
visit_pipelines_schedules
find(".content-list .pipeline-schedule-table-row:nth-child(1) .btn-group a[title='Edit']").click
fill_in 'schedule_cron', with: '* 1 2 3 4'
......
require 'spec_helper'
feature 'Project remote mirror', :feature do
describe 'Project remote mirror', :feature do
let(:project) { create(:project, :repository, :remote_mirror) }
let(:remote_mirror) { project.remote_mirrors.first }
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Setup Mattermost slash commands', :js do
describe 'Setup Mattermost slash commands', :js do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:service) { project.create_mattermost_slash_commands_service }
......
require 'spec_helper'
feature 'Slack slash commands' do
given(:user) { create(:user) }
given(:project) { create(:project) }
given(:service) { project.create_slack_slash_commands_service }
describe 'Slack slash commands' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:service) { project.create_slack_slash_commands_service }
background do
before do
project.add_master(user)
sign_in(user)
visit edit_project_service_path(project, service)
......
require 'spec_helper'
feature 'Project Badges' do
describe 'Project Badges' do
include WaitForRequests
let(:user) { create(:user) }
......
......@@ -101,7 +101,7 @@ describe 'Projects > Settings > Repository settings' do
visit project_settings_repository_path(project)
end
scenario 'view deploy tokens' do
it 'view deploy tokens' do
within('.deploy-tokens') do
expect(page).to have_content(deploy_token.name)
expect(page).to have_content('read_repository')
......@@ -109,7 +109,7 @@ describe 'Projects > Settings > Repository settings' do
end
end
scenario 'add a new deploy token' do
it 'add a new deploy token' do
fill_in 'deploy_token_name', with: 'new_deploy_key'
fill_in 'deploy_token_expires_at', with: (Date.today + 1.month).to_s
check 'deploy_token_read_repository'
......
require 'rails_helper'
feature 'Projects > Show > Developer views empty project instructions' do
describe 'Projects > Show > Developer views empty project instructions' do
let(:project) { create(:project, :empty_repo) }
let(:developer) { create(:user) }
background do
before do
project.add_developer(developer)
sign_in(developer)
end
context 'without an SSH key' do
scenario 'defaults to HTTP' do
it 'defaults to HTTP' do
visit_project
expect_instructions_for('http')
end
scenario 'switches to SSH', :js do
it 'switches to SSH', :js do
visit_project
select_protocol('SSH')
......@@ -27,17 +27,17 @@ feature 'Projects > Show > Developer views empty project instructions' do
end
context 'with an SSH key' do
background do
before do
create(:personal_key, user: developer)
end
scenario 'defaults to SSH' do
it 'defaults to SSH' do
visit_project
expect_instructions_for('ssh')
end
scenario 'switches to HTTP', :js do
it 'switches to HTTP', :js do
visit_project
select_protocol('HTTP')
......
require 'spec_helper'
feature 'Projects > Show > Download buttons' do
given(:user) { create(:user) }
given(:role) { :developer }
given(:status) { 'success' }
given(:project) { create(:project, :repository) }
describe 'Projects > Show > Download buttons' do
let(:user) { create(:user) }
let(:role) { :developer }
let(:status) { 'success' }
let(:project) { create(:project, :repository) }
given(:pipeline) do
let(:pipeline) do
create(:ci_pipeline,
project: project,
sha: project.commit.sha,
......@@ -14,14 +14,14 @@ feature 'Projects > Show > Download buttons' do
status: status)
end
given!(:build) do
let!(:build) do
create(:ci_build, :success, :artifacts,
pipeline: pipeline,
status: pipeline.status,
name: 'build')
end
background do
before do
sign_in(user)
project.add_role(user, role)
end
......@@ -32,13 +32,13 @@ feature 'Projects > Show > Download buttons' do
visit project_path(project)
end
scenario 'shows download artifacts button' do
it 'shows download artifacts button' do
href = latest_succeeded_project_artifacts_path(project, "#{project.default_branch}/download", job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
end
scenario 'download links have download attribute' do
it 'download links have download attribute' do
expect(page).to have_selector('a', text: 'Download')
page.all('a', text: 'Download').each do |link|
expect(link[:download]).to eq ''
......
require 'spec_helper'
feature 'No Password Alert' do
describe 'No Password Alert' do
let(:project) { create(:project, :repository, namespace: user.namespace) }
context 'with internal auth enabled' do
......
require 'spec_helper'
feature 'Projects > Show > RSS' do
describe 'Projects > Show > RSS' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
let(:path) { project_path(project) }
......
require 'spec_helper'
feature 'Download buttons in tags page' do
given(:user) { create(:user) }
given(:role) { :developer }
given(:status) { 'success' }
given(:tag) { 'v1.0.0' }
given(:project) { create(:project, :repository) }
describe 'Download buttons in tags page' do
let(:user) { create(:user) }
let(:role) { :developer }
let(:status) { 'success' }
let(:tag) { 'v1.0.0' }
let(:project) { create(:project, :repository) }
given(:pipeline) do
let(:pipeline) do
create(:ci_pipeline,
project: project,
sha: project.commit(tag).sha,
......@@ -15,14 +15,14 @@ feature 'Download buttons in tags page' do
status: status)
end
given!(:build) do
let!(:build) do
create(:ci_build, :success, :artifacts,
pipeline: pipeline,
status: pipeline.status,
name: 'build')
end
background do
before do
sign_in(user)
project.add_role(user, role)
end
......@@ -33,7 +33,7 @@ feature 'Download buttons in tags page' do
visit project_tags_path(project)
end
scenario 'shows download artifacts button' do
it 'shows download artifacts button' do
href = latest_succeeded_project_artifacts_path(project, "#{tag}/download", job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
......
require 'spec_helper'
feature 'Multi-file editor new directory', :js do
describe 'Multi-file editor new directory', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Multi-file editor new file', :js do
describe 'Multi-file editor new file', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Project Tree RSS' do
describe 'Project Tree RSS' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
let(:path) { project_tree_path(project, :master) }
......
require 'spec_helper'
feature 'Projects tree' do
describe 'Projects tree' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Multi-file editor upload file', :js do
describe 'Multi-file editor upload file', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:txt_file) { File.join(Rails.root, 'spec', 'fixtures', 'doc_sample.txt') }
......
require 'spec_helper'
feature 'User creates a project', :js do
describe 'User creates a project', :js do
let(:user) { create(:user) }
before do
......
require 'spec_helper'
feature 'Projects > Wiki > User previews markdown changes', :js do
describe 'Projects > Wiki > User previews markdown changes', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_content) do
......@@ -12,7 +12,7 @@ feature 'Projects > Wiki > User previews markdown changes', :js do
HEREDOC
end
background do
before do
project.add_master(user)
sign_in(user)
......
require 'spec_helper'
feature 'Wiki shortcuts', :js do
describe 'Wiki shortcuts', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: 'Home page' }) }
......@@ -10,7 +10,7 @@ feature 'Wiki shortcuts', :js do
visit project_wiki_path(project, wiki_page)
end
scenario 'Visit edit wiki page using "e" keyboard shortcut' do
it 'Visit edit wiki page using "e" keyboard shortcut' do
find('body').native.send_key('e')
expect(find('.wiki-page-title')).to have_content('Edit Page')
......
require 'spec_helper'
feature 'User deletes wiki page', :js do
describe 'User deletes wiki page', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
......
......@@ -9,7 +9,7 @@ describe 'Projects > Wiki > User views Git access wiki page' do
sign_in(user)
end
scenario 'Visit Wiki Page Current Commit' do
it 'Visit Wiki Page Current Commit' do
visit project_wiki_path(project, wiki_page)
click_link 'Clone repository'
......
require 'spec_helper'
feature 'Project' do
describe 'Project' do
include ProjectForksHelper
describe 'creating from template' do
......
require 'spec_helper'
feature 'Protected Branches', :js do
describe 'Protected Branches', :js do
let(:user) { create(:user) }
let(:admin) { create(:admin) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Protected Tags', :js do
describe 'Protected Tags', :js do
let(:user) { create(:user, :admin) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'RavenJS' do
describe 'RavenJS' do
let(:raven_path) { '/raven.chunk.js' }
it 'should not load raven if sentry is disabled' do
......
require 'spec_helper'
feature 'Runners' do
given(:user) { create(:user) }
describe 'Runners' do
let(:user) { create(:user) }
background do
before do
sign_in(user)
end
context 'when user opens runners page' do
given(:project) { create(:project) }
let(:project) { create(:project) }
background do
before do
project.add_master(user)
end
scenario 'user can see a button to install runners on kubernetes clusters' do
it 'user can see a button to install runners on kubernetes clusters' do
visit project_runners_path(project)
expect(page).to have_link('Install Runner on Kubernetes', href: project_clusters_path(project))
......@@ -22,16 +22,16 @@ feature 'Runners' do
end
context 'when a project has enabled shared_runners' do
given(:project) { create(:project) }
let(:project) { create(:project) }
background do
before do
project.add_master(user)
end
context 'when a project_type runner is activated on the project' do
given!(:specific_runner) { create(:ci_runner, :project, projects: [project]) }
let!(:specific_runner) { create(:ci_runner, :project, projects: [project]) }
scenario 'user sees the specific runner' do
it 'user sees the specific runner' do
visit project_runners_path(project)
within '.activated-specific-runners' do
......@@ -43,7 +43,7 @@ feature 'Runners' do
expect(page).to have_content(specific_runner.platform)
end
scenario 'user can pause and resume the specific runner' do
it 'user can pause and resume the specific runner' do
visit project_runners_path(project)
within '.activated-specific-runners' do
......@@ -63,7 +63,7 @@ feature 'Runners' do
end
end
scenario 'user removes an activated specific runner if this is last project for that runners' do
it 'user removes an activated specific runner if this is last project for that runners' do
visit project_runners_path(project)
within '.activated-specific-runners' do
......@@ -73,7 +73,7 @@ feature 'Runners' do
expect(page).not_to have_content(specific_runner.display_name)
end
scenario 'user edits the runner to be protected' do
it 'user edits the runner to be protected' do
visit project_runners_path(project)
within '.activated-specific-runners' do
......@@ -89,11 +89,11 @@ feature 'Runners' do
end
context 'when a runner has a tag' do
background do
before do
specific_runner.update(tag_list: ['tag'])
end
scenario 'user edits runner not to run untagged jobs' do
it 'user edits runner not to run untagged jobs' do
visit project_runners_path(project)
within '.activated-specific-runners' do
......@@ -110,9 +110,9 @@ feature 'Runners' do
end
context 'when a shared runner is activated on the project' do
given!(:shared_runner) { create(:ci_runner, :instance) }
let!(:shared_runner) { create(:ci_runner, :instance) }
scenario 'user sees CI/CD setting page' do
it 'user sees CI/CD setting page' do
visit project_runners_path(project)
expect(page.find('.available-shared-runners')).to have_content(shared_runner.display_name)
......@@ -121,14 +121,14 @@ feature 'Runners' do
end
context 'when a specific runner exists in another project' do
given(:another_project) { create(:project) }
given!(:specific_runner) { create(:ci_runner, :project, projects: [another_project]) }
let(:another_project) { create(:project) }
let!(:specific_runner) { create(:ci_runner, :project, projects: [another_project]) }
background do
before do
another_project.add_master(user)
end
scenario 'user enables and disables a specific runner' do
it 'user enables and disables a specific runner' do
visit project_runners_path(project)
within '.available-specific-runners' do
......@@ -146,14 +146,14 @@ feature 'Runners' do
end
context 'when application settings have shared_runners_text' do
given(:shared_runners_text) { 'custom **shared** runners description' }
given(:shared_runners_html) { 'custom shared runners description' }
let(:shared_runners_text) { 'custom **shared** runners description' }
let(:shared_runners_html) { 'custom shared runners description' }
background do
before do
stub_application_setting(shared_runners_text: shared_runners_text)
end
scenario 'user sees shared runners description' do
it 'user sees shared runners description' do
visit project_runners_path(project)
expect(page.find('.shared-runners-description')).to have_content(shared_runners_html)
......@@ -162,13 +162,13 @@ feature 'Runners' do
end
context 'when a project has disabled shared_runners' do
given(:project) { create(:project, shared_runners_enabled: false) }
let(:project) { create(:project, shared_runners_enabled: false) }
background do
before do
project.add_master(user)
end
scenario 'user enables shared runners' do
it 'user enables shared runners' do
visit project_runners_path(project)
click_on 'Enable shared Runners'
......@@ -178,21 +178,21 @@ feature 'Runners' do
end
context 'group runners in project settings' do
background do
before do
project.add_master(user)
end
given(:group) { create :group }
let(:group) { create :group }
context 'as project and group maintainer' do
background do
before do
group.add_master(user)
end
context 'project with a group but no group runner' do
given(:project) { create :project, group: group }
let(:project) { create :project, group: group }
scenario 'group runners are not available' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet'
......@@ -205,9 +205,9 @@ feature 'Runners' do
context 'as project maintainer' do
context 'project without a group' do
given(:project) { create :project }
let(:project) { create :project }
scenario 'group runners are not available' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This project does not belong to a group and can therefore not make use of group Runners.'
......@@ -215,10 +215,10 @@ feature 'Runners' do
end
context 'project with a group but no group runner' do
given(:group) { create(:group) }
given(:project) { create(:project, group: group) }
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
scenario 'group runners are not available' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet.'
......@@ -229,18 +229,18 @@ feature 'Runners' do
end
context 'project with a group and a group runner' do
given(:group) { create(:group) }
given(:project) { create(:project, group: group) }
given!(:ci_runner) { create(:ci_runner, :group, groups: [group], description: 'group-runner') }
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
let!(:ci_runner) { create(:ci_runner, :group, groups: [group], description: 'group-runner') }
scenario 'group runners are available' do
it 'group runners are available' do
visit project_runners_path(project)
expect(page).to have_content 'Available group Runners : 1'
expect(page).to have_content 'group-runner'
end
scenario 'group runners may be disabled for a project' do
it 'group runners may be disabled for a project' do
visit project_runners_path(project)
click_on 'Disable group Runners'
......@@ -258,13 +258,13 @@ feature 'Runners' do
end
context 'group runners in group settings' do
given(:group) { create(:group) }
background do
let(:group) { create(:group) }
before do
group.add_master(user)
end
context 'group with no runners' do
scenario 'there are no runners displayed' do
it 'there are no runners displayed' do
visit group_settings_ci_cd_path(group)
expect(page).to have_content 'This group does not provide any group Runners yet'
......@@ -274,7 +274,7 @@ feature 'Runners' do
context 'group with a runner' do
let!(:runner) { create(:ci_runner, :group, groups: [group], description: 'group-runner') }
scenario 'the runner is visible' do
it 'the runner is visible' do
visit group_settings_ci_cd_path(group)
expect(page).not_to have_content 'This group does not provide any group Runners yet'
......@@ -282,7 +282,7 @@ feature 'Runners' do
expect(page).to have_content 'group-runner'
end
scenario 'user can pause and resume the group runner' do
it 'user can pause and resume the group runner' do
visit group_settings_ci_cd_path(group)
expect(page).to have_content('Pause')
......@@ -299,7 +299,7 @@ feature 'Runners' do
expect(page).not_to have_content('Resume')
end
scenario 'user can view runner details' do
it 'user can view runner details' do
visit group_settings_ci_cd_path(group)
expect(page).to have_content(runner.display_name)
......@@ -309,7 +309,7 @@ feature 'Runners' do
expect(page).to have_content(runner.platform)
end
scenario 'user can remove a group runner' do
it 'user can remove a group runner' do
visit group_settings_ci_cd_path(group)
click_on 'Remove Runner'
......@@ -317,7 +317,7 @@ feature 'Runners' do
expect(page).not_to have_content(runner.display_name)
end
scenario 'user edits the runner to be protected' do
it 'user edits the runner to be protected' do
visit group_settings_ci_cd_path(group)
first('.edit-runner > a').click
......@@ -331,11 +331,11 @@ feature 'Runners' do
end
context 'when a runner has a tag' do
background do
before do
runner.update(tag_list: ['tag'])
end
scenario 'user edits runner not to run untagged jobs' do
it 'user edits runner not to run untagged jobs' do
visit group_settings_ci_cd_path(group)
first('.edit-runner > a').click
......
require 'rails_helper'
feature 'Explore Snippets' do
describe 'Explore Snippets' do
let!(:public_snippet) { create(:personal_snippet, :public) }
let!(:internal_snippet) { create(:personal_snippet, :internal) }
let!(:private_snippet) { create(:personal_snippet, :private) }
scenario 'User should see snippets that are not private' do
it 'User should see snippets that are not private' do
sign_in create(:user)
visit explore_snippets_path
......@@ -14,7 +14,7 @@ feature 'Explore Snippets' do
expect(page).not_to have_content(private_snippet.title)
end
scenario 'External user should see only public snippets' do
it 'External user should see only public snippets' do
sign_in create(:user, :external)
visit explore_snippets_path
......@@ -23,7 +23,7 @@ feature 'Explore Snippets' do
expect(page).not_to have_content(private_snippet.title)
end
scenario 'Not authenticated user should see only public snippets' do
it 'Not authenticated user should see only public snippets' do
visit explore_snippets_path
expect(page).to have_content(public_snippet.title)
......
require 'rails_helper'
feature 'Internal Snippets', :js do
describe 'Internal Snippets', :js do
let(:internal_snippet) { create(:personal_snippet, :internal) }
describe 'normal user' do
......@@ -8,13 +8,13 @@ feature 'Internal Snippets', :js do
sign_in(create(:user))
end
scenario 'sees internal snippets' do
it 'sees internal snippets' do
visit snippet_path(internal_snippet)
expect(page).to have_content(internal_snippet.content)
end
scenario 'sees raw internal snippets' do
it 'sees raw internal snippets' do
visit raw_snippet_path(internal_snippet)
expect(page).to have_content(internal_snippet.content)
......
require 'rails_helper'
feature 'Public Snippets', :js do
scenario 'Unauthenticated user should see public snippets' do
describe 'Public Snippets', :js do
it 'Unauthenticated user should see public snippets' do
public_snippet = create(:personal_snippet, :public)
visit snippet_path(public_snippet)
......@@ -10,7 +10,7 @@ feature 'Public Snippets', :js do
expect(page).to have_content(public_snippet.content)
end
scenario 'Unauthenticated user should see raw public snippets' do
it 'Unauthenticated user should see raw public snippets' do
public_snippet = create(:personal_snippet, :public)
visit raw_snippet_path(public_snippet)
......
require 'rails_helper'
feature 'Search Snippets' do
scenario 'User searches for snippets by title' do
describe 'Search Snippets' do
it 'User searches for snippets by title' do
public_snippet = create(:personal_snippet, :public, title: 'Beginning and Middle')
private_snippet = create(:personal_snippet, :private, title: 'Middle and End')
......@@ -19,7 +19,7 @@ feature 'Search Snippets' do
expect(page).to have_link(private_snippet.title)
end
scenario 'User searches for snippet contents' do
it 'User searches for snippet contents' do
create(:personal_snippet,
:public,
title: 'Many lined snippet',
......
require 'spec_helper'
feature 'Snippet', :js do
describe 'Snippet', :js do
let(:project) { create(:project, :repository) }
let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content) }
......
require 'rails_helper'
feature 'User creates snippet', :js do
describe 'User creates snippet', :js do
include DropzoneHelper
let(:user) { create(:user) }
......@@ -18,7 +18,7 @@ feature 'User creates snippet', :js do
end
end
scenario 'Authenticated user creates a snippet' do
it 'Authenticated user creates a snippet' do
fill_form
click_button('Create snippet')
......@@ -32,7 +32,7 @@ feature 'User creates snippet', :js do
expect(page).to have_content('Hello World!')
end
scenario 'previews a snippet with file' do
it 'previews a snippet with file' do
fill_in 'personal_snippet_description', with: 'My Snippet'
dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif')
find('.js-md-preview-button').click
......@@ -48,7 +48,7 @@ feature 'User creates snippet', :js do
end
end
scenario 'uploads a file when dragging into textarea' do
it 'uploads a file when dragging into textarea' do
fill_form
dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif')
......@@ -65,7 +65,7 @@ feature 'User creates snippet', :js do
expect(reqs.first.status_code).to eq(200)
end
scenario 'validation fails for the first time' do
it 'validation fails for the first time' do
fill_in 'personal_snippet_title', with: 'My Snippet Title'
click_button('Create snippet')
......@@ -90,7 +90,7 @@ feature 'User creates snippet', :js do
expect(reqs.first.status_code).to eq(200)
end
scenario 'Authenticated user creates a snippet with + in filename' do
it 'Authenticated user creates a snippet with + in filename' do
fill_in 'personal_snippet_title', with: 'My Snippet Title'
page.within('.file-editor') do
find(:xpath, "//input[@id='personal_snippet_file_name']").set 'snippet+file+name'
......
require 'rails_helper'
feature 'User deletes snippet' do
describe 'User deletes snippet' do
let(:user) { create(:user) }
let(:content) { 'puts "test"' }
let(:snippet) { create(:personal_snippet, :public, content: content, author: user) }
......
require 'rails_helper'
feature 'User edits snippet', :js do
describe 'User edits snippet', :js do
include DropzoneHelper
let(:file_name) { 'test.rb' }
......
require 'rails_helper'
feature 'User Snippets' do
describe 'User Snippets' do
let(:author) { create(:user) }
let!(:public_snippet) { create(:personal_snippet, :public, author: author, title: "This is a public snippet") }
let!(:internal_snippet) { create(:personal_snippet, :internal, author: author, title: "This is an internal snippet") }
let!(:private_snippet) { create(:personal_snippet, :private, author: author, title: "This is a private snippet") }
background do
before do
sign_in author
visit dashboard_snippets_path
end
scenario 'View all of my snippets' do
it 'View all of my snippets' do
expect(page).to have_content(public_snippet.title)
expect(page).to have_content(internal_snippet.title)
expect(page).to have_content(private_snippet.title)
end
scenario 'View my public snippets' do
it 'View my public snippets' do
page.within('.snippet-scope-menu') do
click_link "Public"
end
......@@ -27,7 +27,7 @@ feature 'User Snippets' do
expect(page).not_to have_content(private_snippet.title)
end
scenario 'View my internal snippets' do
it 'View my internal snippets' do
page.within('.snippet-scope-menu') do
click_link "Internal"
end
......@@ -37,7 +37,7 @@ feature 'User Snippets' do
expect(page).not_to have_content(private_snippet.title)
end
scenario 'View my private snippets' do
it 'View my private snippets' do
page.within('.snippet-scope-menu') do
click_link "Private"
end
......
require 'spec_helper'
feature 'Master creates tag' do
describe 'Master creates tag' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
......@@ -14,25 +14,25 @@ feature 'Master creates tag' do
visit project_tags_path(project)
end
scenario 'with an invalid name displays an error' do
it 'with an invalid name displays an error' do
create_tag_in_form(tag: 'v 1.0', ref: 'master')
expect(page).to have_content 'Tag name invalid'
end
scenario 'with an invalid reference displays an error' do
it 'with an invalid reference displays an error' do
create_tag_in_form(tag: 'v2.0', ref: 'foo')
expect(page).to have_content 'Target foo is invalid'
end
scenario 'that already exists displays an error' do
it 'that already exists displays an error' do
create_tag_in_form(tag: 'v1.1.0', ref: 'master')
expect(page).to have_content 'Tag v1.1.0 already exists'
end
scenario 'with multiline message displays the message in a <pre> block' do
it 'with multiline message displays the message in a <pre> block' do
create_tag_in_form(tag: 'v3.0', ref: 'master', message: "Awesome tag message\n\n- hello\n- world")
expect(current_path).to eq(
......@@ -43,7 +43,7 @@ feature 'Master creates tag' do
end
end
scenario 'with multiline release notes parses the release note as Markdown' do
it 'with multiline release notes parses the release note as Markdown' do
create_tag_in_form(tag: 'v4.0', ref: 'master', desc: "Awesome release notes\n\n- hello\n- world")
expect(current_path).to eq(
......@@ -55,7 +55,7 @@ feature 'Master creates tag' do
end
end
scenario 'opens dropdown for ref', :js do
it 'opens dropdown for ref', :js do
click_link 'New tag'
ref_row = find('.form-group:nth-of-type(2) .col-sm-10')
page.within ref_row do
......
require 'spec_helper'
feature 'Master deletes tag' do
describe 'Master deletes tag' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
......@@ -11,7 +11,7 @@ feature 'Master deletes tag' do
end
context 'from the tags list page', :js do
scenario 'deletes the tag' do
it 'deletes the tag' do
expect(page).to have_content 'v1.1.0'
delete_first_tag
......@@ -21,7 +21,7 @@ feature 'Master deletes tag' do
end
context 'from a specific tag page' do
scenario 'deletes the tag' do
it 'deletes the tag' do
click_on 'v1.0.0'
expect(current_path).to eq(
project_tag_path(project, 'v1.0.0'))
......@@ -40,7 +40,7 @@ feature 'Master deletes tag' do
.and_raise(Gitlab::Git::PreReceiveError, 'Do not delete tags')
end
scenario 'shows the error message' do
it 'shows the error message' do
delete_first_tag
expect(page).to have_content('Do not delete tags')
......
require 'spec_helper'
feature 'Master updates tag' do
describe 'Master updates tag' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
......@@ -11,7 +11,7 @@ feature 'Master updates tag' do
end
context 'from the tags list page' do
scenario 'updates the release notes' do
it 'updates the release notes' do
page.within(first('.content-list .controls')) do
click_link 'Edit release notes'
end
......@@ -25,7 +25,7 @@ feature 'Master updates tag' do
expect(page).to have_content 'Awesome release notes'
end
scenario 'description has emoji autocomplete', :js do
it 'description has emoji autocomplete', :js do
page.within(first('.content-list .controls')) do
click_link 'Edit release notes'
end
......@@ -38,7 +38,7 @@ feature 'Master updates tag' do
end
context 'from a specific tag page' do
scenario 'updates the release notes' do
it 'updates the release notes' do
click_on 'v1.1.0'
click_link 'Edit release notes'
fill_in 'release_description', with: 'Awesome release notes'
......
require 'spec_helper'
feature 'Master views tags' do
describe 'Master views tags' do
let(:user) { create(:user) }
before do
......@@ -19,7 +19,7 @@ feature 'Master views tags' do
visit project_tags_path(project)
end
scenario 'displays a specific message' do
it 'displays a specific message' do
expect(page).to have_content 'Repository has no tags yet.'
end
end
......@@ -32,7 +32,7 @@ feature 'Master views tags' do
visit project_tags_path(project)
end
scenario 'avoids a N+1 query in branches index' do
it 'avoids a N+1 query in branches index' do
control_count = ActiveRecord::QueryRecorder.new { visit project_tags_path(project) }.count
%w(one two three four five).each { |tag| repository.add_tag(user, tag, 'master', 'foo') }
......@@ -40,11 +40,11 @@ feature 'Master views tags' do
expect { visit project_tags_path(project) }.not_to exceed_query_limit(control_count)
end
scenario 'views the tags list page' do
it 'views the tags list page' do
expect(page).to have_content 'v1.0.0'
end
scenario 'views a specific tag page' do
it 'views a specific tag page' do
click_on 'v1.0.0'
expect(current_path).to eq(
......@@ -54,7 +54,7 @@ feature 'Master views tags' do
end
describe 'links on the tag page' do
scenario 'has a button to browse files' do
it 'has a button to browse files' do
click_on 'v1.0.0'
expect(current_path).to eq(
......@@ -66,7 +66,7 @@ feature 'Master views tags' do
project_tree_path(project, 'v1.0.0'))
end
scenario 'has a button to browse commits' do
it 'has a button to browse commits' do
click_on 'v1.0.0'
expect(current_path).to eq(
......
require 'spec_helper'
feature 'Task Lists' do
describe 'Task Lists' do
include Warden::Test::Helpers
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Triggers', :js do
describe 'Triggers', :js do
let(:trigger_title) { 'trigger desc' }
let(:user) { create(:user) }
let(:user2) { create(:user) }
......@@ -18,7 +18,7 @@ feature 'Triggers', :js do
end
describe 'create trigger workflow' do
scenario 'prevents adding new trigger with no description' do
it 'prevents adding new trigger with no description' do
fill_in 'trigger_description', with: ''
click_button 'Add trigger'
......@@ -26,7 +26,7 @@ feature 'Triggers', :js do
expect(page.find('form.gl-show-field-errors .gl-field-error')).to be_visible
end
scenario 'adds new trigger with description' do
it 'adds new trigger with description' do
fill_in 'trigger_description', with: 'trigger desc'
click_button 'Add trigger'
......@@ -40,7 +40,7 @@ feature 'Triggers', :js do
describe 'edit trigger workflow' do
let(:new_trigger_title) { 'new trigger' }
scenario 'click on edit trigger opens edit trigger page' do
it 'click on edit trigger opens edit trigger page' do
create(:ci_trigger, owner: user, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
......@@ -49,7 +49,7 @@ feature 'Triggers', :js do
expect(page.find('#trigger_description').value).to have_content 'trigger desc'
end
scenario 'edit trigger and save' do
it 'edit trigger and save' do
create(:ci_trigger, owner: user, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
......@@ -64,7 +64,7 @@ feature 'Triggers', :js do
expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end
scenario 'edit "legacy" trigger and save' do
it 'edit "legacy" trigger and save' do
# Create new trigger without owner association, i.e. Legacy trigger
create(:ci_trigger, owner: nil, project: @project)
visit project_settings_ci_cd_path(@project)
......@@ -87,12 +87,12 @@ feature 'Triggers', :js do
visit project_settings_ci_cd_path(@project)
end
scenario 'button "Take ownership" has correct alert' do
it 'button "Take ownership" has correct alert' do
expected_alert = 'By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?'
expect(page.find('a.btn-trigger-take-ownership')['data-confirm']).to eq expected_alert
end
scenario 'take trigger ownership' do
it 'take trigger ownership' do
# See if "Take ownership" on trigger works post trigger creation
page.accept_confirm do
first(:link, "Take ownership").send_keys(:return)
......@@ -110,12 +110,12 @@ feature 'Triggers', :js do
visit project_settings_ci_cd_path(@project)
end
scenario 'button "Revoke" has correct alert' do
it 'button "Revoke" has correct alert' do
expected_alert = 'By revoking a trigger you will break any processes making use of it. Are you sure?'
expect(page.find('a.btn-trigger-revoke')['data-confirm']).to eq expected_alert
end
scenario 'revoke trigger' do
it 'revoke trigger' do
# See if "Revoke" on trigger works post trigger creation
page.accept_confirm do
find('a.btn-trigger-revoke').send_keys(:return)
......@@ -127,11 +127,11 @@ feature 'Triggers', :js do
end
describe 'show triggers workflow' do
scenario 'contains trigger description placeholder' do
it 'contains trigger description placeholder' do
expect(page.find('#trigger_description')['placeholder']).to eq 'Trigger description'
end
scenario 'show "legacy" badge for legacy trigger' do
it 'show "legacy" badge for legacy trigger' do
create(:ci_trigger, owner: nil, project: @project)
visit project_settings_ci_cd_path(@project)
......@@ -140,7 +140,7 @@ feature 'Triggers', :js do
expect(page.find('.triggers-list')).to have_selector('a[title="Edit"]')
end
scenario 'show "invalid" badge for trigger with owner having insufficient permissions' do
it 'show "invalid" badge for trigger with owner having insufficient permissions' do
create(:ci_trigger, owner: guest_user, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
......@@ -149,7 +149,7 @@ feature 'Triggers', :js do
expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]')
end
scenario 'do not show "Edit" or full token for not owned trigger' do
it 'do not show "Edit" or full token for not owned trigger' do
# Create trigger with user different from current_user
create(:ci_trigger, owner: user2, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
......@@ -163,7 +163,7 @@ feature 'Triggers', :js do
expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]')
end
scenario 'show "Edit" and full token for owned trigger' do
it 'show "Edit" and full token for owned trigger' do
create(:ci_trigger, owner: user, project: @project, description: trigger_title)
visit project_settings_ci_cd_path(@project)
......
require 'spec_helper'
feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
def manage_two_factor_authentication
click_on 'Manage two-factor authentication'
expect(page).to have_content("Setup new U2F device")
......
require 'rails_helper'
feature 'User uploads avatar to group' do
scenario 'they see the new avatar' do
describe 'User uploads avatar to group' do
it 'they see the new avatar' do
user = create(:user)
group = create(:group)
group.add_owner(user)
......
require 'rails_helper'
feature 'User uploads avatar to profile' do
describe 'User uploads avatar to profile' do
let!(:user) { create(:user) }
let(:avatar_file_path) { Rails.root.join('spec', 'fixtures', 'dk.png') }
......@@ -9,7 +9,7 @@ feature 'User uploads avatar to profile' do
visit profile_path
end
scenario 'they see their new avatar on their profile' do
it 'they see their new avatar on their profile' do
attach_file('user_avatar', avatar_file_path, visible: false)
click_button 'Update profile settings'
......@@ -21,7 +21,7 @@ feature 'User uploads avatar to profile' do
expect(user.reload.avatar.file).to exist
end
scenario 'their new avatar is immediately visible in the header', :js do
it 'their new avatar is immediately visible in the header', :js do
find('.js-user-avatar-input', visible: false).set(avatar_file_path)
click_button 'Set new profile picture'
......
require 'rails_helper'
feature 'User uploads file to note' do
describe 'User uploads file to note' do
include DropzoneHelper
let(:user) { create(:user) }
......@@ -71,7 +71,7 @@ feature 'User uploads file to note' do
expect(page).not_to have_selector('.uploading-progress-container', visible: true)
end
scenario 'they see the attached file', :js do
it 'they see the attached file', :js do
dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')])
click_button 'Comment'
wait_for_requests
......
require 'spec_helper'
feature 'Active user sessions', :clean_gitlab_redis_shared_state do
scenario 'Successful login adds a new active user login' do
describe 'Active user sessions', :clean_gitlab_redis_shared_state do
it 'Successful login adds a new active user login' do
now = Time.zone.parse('2018-03-12 09:06')
Timecop.freeze(now) do
user = create(:user)
......@@ -24,7 +24,7 @@ feature 'Active user sessions', :clean_gitlab_redis_shared_state do
end
end
scenario 'Successful login cleans up obsolete entries' do
it 'Successful login cleans up obsolete entries' do
user = create(:user)
Gitlab::Redis::SharedState.with do |redis|
......@@ -38,7 +38,7 @@ feature 'Active user sessions', :clean_gitlab_redis_shared_state do
end
end
scenario 'Sessionless login does not clean up obsolete entries' do
it 'Sessionless login does not clean up obsolete entries' do
user = create(:user)
personal_access_token = create(:personal_access_token, user: user)
......@@ -54,7 +54,7 @@ feature 'Active user sessions', :clean_gitlab_redis_shared_state do
end
end
scenario 'Logout deletes the active user login' do
it 'Logout deletes the active user login' do
user = create(:user)
gitlab_sign_in(user)
expect(current_path).to eq root_path
......
require 'spec_helper'
feature 'Login' do
describe 'Login' do
include TermsHelper
scenario 'Successful user signin invalidates password reset token' do
it 'Successful user signin invalidates password reset token' do
user = create(:user)
expect(user.reset_password_token).to be_nil
......
require 'spec_helper'
feature 'User RSS' do
describe 'User RSS' do
let(:user) { create(:user) }
let(:path) { user_path(create(:user)) }
......
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