Commit 3855751d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'jacopo-beschi/gitlab-ce-29712-unnecessary-wait-for-ajax'

See merge request !10567
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parents 9d17ad10 ff76adb5
---
title: Remove unnecessary test helpers includes
merge_request: 10567
author: Jacopo Beschi @jacopo-beschi
require 'spec_helper' require 'spec_helper'
describe Dashboard::TodosController do describe Dashboard::TodosController do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::BuildsController do describe Projects::BuildsController do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::EnvironmentsController do describe Projects::EnvironmentsController do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::MergeRequestsController do describe Projects::MergeRequestsController do
include ApiHelpers
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::PipelinesController do describe Projects::PipelinesController do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require('spec_helper') require('spec_helper')
describe Projects::TodosController do describe Projects::TodosController do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
require 'spec_helper' require 'spec_helper'
RSpec.describe 'admin issues labels' do RSpec.describe 'admin issues labels' do
include WaitForAjax
let!(:bug_label) { Label.create(title: 'bug', template: true) } let!(:bug_label) { Label.create(title: 'bug', template: true) }
let!(:feature_label) { Label.create(title: 'feature', template: true) } let!(:feature_label) { Label.create(title: 'feature', template: true) }
......
require 'spec_helper' require 'spec_helper'
describe "Admin::Users", feature: true do describe "Admin::Users", feature: true do
include WaitForAjax
let!(:user) do let!(:user) do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456') create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end end
......
require 'spec_helper' require 'spec_helper'
describe 'Auto deploy' do describe 'Auto deploy' do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards add issue modal', :feature, :js do describe 'Issue Boards add issue modal', :feature, :js do
include WaitForAjax
include WaitForVueResource include WaitForVueResource
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do describe 'Issue Boards', feature: true, js: true do
include WaitForAjax
include WaitForVueResource include WaitForVueResource
include DragTo include DragTo
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards new issue', feature: true, js: true do describe 'Issue Boards new issue', feature: true, js: true do
include WaitForAjax
include WaitForVueResource include WaitForVueResource
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do describe 'Issue Boards', feature: true, js: true do
include WaitForAjax
include WaitForVueResource include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Contributions Calendar', :feature, :js do feature 'Contributions Calendar', :feature, :js do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:contributed_project) { create(:empty_project, :public) } let(:contributed_project) { create(:empty_project, :public) }
let(:issue_note) { create(:note, project: contributed_project) } let(:issue_note) { create(:note, project: contributed_project) }
......
require 'spec_helper' require 'spec_helper'
feature 'Cycle Analytics', feature: true, js: true do feature 'Cycle Analytics', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:guest) { create(:user) } let(:guest) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'spec_helper' require 'spec_helper'
feature 'Tooltips on .timeago dates', feature: true, js: true do feature 'Tooltips on .timeago dates', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time } let(:created_date) { Date.yesterday.to_time }
......
require 'spec_helper' require 'spec_helper'
describe 'Dashboard Groups page', js: true, feature: true do describe 'Dashboard Groups page', js: true, feature: true do
include WaitForAjax
let!(:user) { create :user } let!(:user) { create :user }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:nested_group) { create(:group, :nested) } let!(:nested_group) { create(:group, :nested) }
......
require 'spec_helper' require 'spec_helper'
feature 'Project member activity', feature: true, js: true do feature 'Project member activity', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public, name: 'x', namespace: user.namespace) } let(:project) { create(:empty_project, :public, name: 'x', namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
feature 'Expand and collapse diffs', js: true, feature: true do feature 'Expand and collapse diffs', js: true, feature: true do
include WaitForAjax
let(:branch) { 'expand-collapse-diffs' } let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'spec_helper' require 'spec_helper'
describe 'Explore Groups page', js: true, feature: true do describe 'Explore Groups page', js: true, feature: true do
include WaitForAjax
let!(:user) { create :user } let!(:user) { create :user }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:public_group) { create(:group, :public) } let!(:public_group) { create(:group, :public) }
......
require 'rails_helper' require 'rails_helper'
describe 'Awards Emoji', feature: true do describe 'Awards Emoji', feature: true do
include WaitForAjax
include WaitForVueResource include WaitForVueResource
let!(:project) { create(:project, :public) } let!(:project) { create(:project, :public) }
......
require 'rails_helper' require 'rails_helper'
feature 'Issues > Labels bulk assignment', feature: true do feature 'Issues > Labels bulk assignment', feature: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") } let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown assignee', :feature, :js do describe 'Dropdown assignee', :feature, :js do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user) { create(:user, name: 'administrator', username: 'root') }
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown author', js: true, feature: true do describe 'Dropdown author', js: true, feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user) { create(:user, name: 'administrator', username: 'root') }
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown hint', :js, :feature do describe 'Dropdown hint', :js, :feature do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
...@@ -3,7 +3,6 @@ require 'spec_helper' ...@@ -3,7 +3,6 @@ require 'spec_helper'
describe 'Filter issues', js: true, feature: true do describe 'Filter issues', js: true, feature: true do
include Devise::Test::IntegrationHelpers include Devise::Test::IntegrationHelpers
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, group: group) } let!(:project) { create(:project, group: group) }
......
...@@ -2,7 +2,6 @@ require 'spec_helper' ...@@ -2,7 +2,6 @@ require 'spec_helper'
describe 'Recent searches', js: true, feature: true do describe 'Recent searches', js: true, feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, group: group) } let!(:project) { create(:project, group: group) }
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Search bar', js: true, feature: true do describe 'Search bar', js: true, feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
require 'rails_helper' require 'rails_helper'
feature 'GFM autocomplete', feature: true, js: true do feature 'GFM autocomplete', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:label) { create(:label, project: project, title: 'special+') } let(:label) { create(:label, project: project, title: 'special+') }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue Sidebar', feature: true do feature 'Issue Sidebar', feature: true do
include WaitForAjax
include MobileHelpers include MobileHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'rails_helper' require 'rails_helper'
feature 'Multiple issue updating from issues#index', feature: true do feature 'Multiple issue updating from issues#index', feature: true do
include WaitForAjax
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
feature 'Issues > User uses slash commands', feature: true, js: true do feature 'Issues > User uses slash commands', feature: true, js: true do
include SlashCommandsHelpers include SlashCommandsHelpers
include WaitForAjax
it_behaves_like 'issuable record that supports slash commands in its description and notes', :issue do it_behaves_like 'issuable record that supports slash commands in its description and notes', :issue do
let(:issuable) { create(:issue, project: project) } let(:issuable) { create(:issue, project: project) }
......
...@@ -4,7 +4,6 @@ describe 'Issues', feature: true do ...@@ -4,7 +4,6 @@ describe 'Issues', feature: true do
include DropzoneHelper include DropzoneHelper
include IssueHelpers include IssueHelpers
include SortingHelper include SortingHelper
include WaitForAjax
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'Merge request conflict resolution', js: true, feature: true do feature 'Merge request conflict resolution', js: true, feature: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
...@@ -4,8 +4,6 @@ require 'spec_helper' ...@@ -4,8 +4,6 @@ require 'spec_helper'
# message to be shown by JavaScript when the source branch was deleted. # message to be shown by JavaScript when the source branch was deleted.
# Please do not remove "js: true". # Please do not remove "js: true".
describe 'Deleted source branch', feature: true, js: true do describe 'Deleted source branch', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
......
require 'spec_helper' require 'spec_helper'
feature 'Diff note avatars', feature: true, js: true do feature 'Diff note avatars', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") }
......
...@@ -3,7 +3,6 @@ require 'rails_helper' ...@@ -3,7 +3,6 @@ require 'rails_helper'
feature 'Issue filtering by Labels', feature: true, js: true do feature 'Issue filtering by Labels', feature: true, js: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
include WaitForAjax
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
...@@ -3,7 +3,6 @@ require 'rails_helper' ...@@ -3,7 +3,6 @@ require 'rails_helper'
describe 'Filter merge requests', feature: true do describe 'Filter merge requests', feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
include WaitForAjax
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:group) { create(:group) } let!(:group) { create(:group) }
......
require 'rails_helper' require 'rails_helper'
feature 'Mini Pipeline Graph', :js, :feature do feature 'Mini Pipeline Graph', :js, :feature do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'spec_helper' require 'spec_helper'
feature 'Pipelines for Merge Requests', feature: true, js: true do feature 'Pipelines for Merge Requests', feature: true, js: true do
include WaitForAjax
given(:user) { create(:user) } given(:user) { create(:user) }
given(:merge_request) { create(:merge_request) } given(:merge_request) { create(:merge_request) }
given(:project) { merge_request.target_project } given(:project) { merge_request.target_project }
......
...@@ -3,7 +3,6 @@ require 'rails_helper' ...@@ -3,7 +3,6 @@ require 'rails_helper'
feature 'Merge requests filter clear button', feature: true, js: true do feature 'Merge requests filter clear button', feature: true, js: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
include WaitForAjax
include IssueHelpers include IssueHelpers
let!(:project) { create(:project, :public) } let!(:project) { create(:project, :public) }
......
require 'rails_helper' require 'rails_helper'
feature 'Multiple merge requests updating from merge_requests#index', feature: true do feature 'Multiple merge requests updating from merge_requests#index', feature: true do
include WaitForAjax
let!(:user) { create(:user)} let!(:user) { create(:user)}
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
feature 'Merge Requests > User uses slash commands', feature: true, js: true do feature 'Merge Requests > User uses slash commands', feature: true, js: true do
include SlashCommandsHelpers include SlashCommandsHelpers
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'Widget Deployments Header', feature: true, js: true do feature 'Widget Deployments Header', feature: true, js: true do
include WaitForAjax
describe 'when deployed to an environment' do describe 'when deployed to an environment' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:project) { merge_request.target_project } given(:project) { merge_request.target_project }
......
require 'rails_helper' require 'rails_helper'
describe 'Merge request', :feature, :js do describe 'Merge request', :feature, :js do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'rails_helper' require 'rails_helper'
feature 'Milestone', feature: true do feature 'Milestone', feature: true do
include WaitForAjax
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'rails_helper' require 'rails_helper'
describe 'Milestone draggable', feature: true, js: true do describe 'Milestone draggable', feature: true, js: true do
include WaitForAjax
include DragTo include DragTo
let(:milestone) { create(:milestone, project: project, title: 8.14) } let(:milestone) { create(:milestone, project: project, title: 8.14) }
......
require 'spec_helper' require 'spec_helper'
feature 'File blob', feature: true do feature 'File blob', feature: true do
include WaitForAjax
include TreeHelper include TreeHelper
let(:project) { create(:project, :public, :test_repo) } let(:project) { create(:project, :public, :test_repo) }
......
require 'spec_helper' require 'spec_helper'
feature 'Editing file blob', feature: true, js: true do feature 'Editing file blob', feature: true, js: true do
include WaitForAjax
include TreeHelper include TreeHelper
let(:project) { create(:project, :public, :test_repo) } let(:project) { create(:project, :public, :test_repo) }
......
require 'spec_helper' require 'spec_helper'
feature 'New blob creation', feature: true, js: true do feature 'New blob creation', feature: true, js: true do
include WaitForAjax
include TargetBranchHelpers include TargetBranchHelpers
given(:user) { create(:user) } given(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
include WaitForAjax
describe 'Cherry-pick Commits' do describe 'Cherry-pick Commits' do
let(:group) { create(:group) } let(:group) { create(:group) }
......
require 'rails_helper' require 'rails_helper'
feature 'Mini Pipeline Graph in Commit View', :js, :feature do feature 'Mini Pipeline Graph in Commit View', :js, :feature do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'rails_helper' require 'rails_helper'
feature 'Project edit', feature: true, js: true do feature 'Project edit', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
include WaitForAjax
describe 'Edit Project Settings', feature: true do describe 'Edit Project Settings', feature: true do
include WaitForAjax
let(:member) { create(:user) } let(:member) { create(:user) }
let!(:project) { create(:project, :public, path: 'gitlab', name: 'sample') } let!(:project) { create(:project, :public, path: 'gitlab', name: 'sample') }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to create a file', feature: true do feature 'User wants to create a file', feature: true do
include WaitForAjax
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to add a Dockerfile file', feature: true do feature 'User wants to add a Dockerfile file', feature: true do
include WaitForAjax
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project)
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to edit a file', feature: true do feature 'User wants to edit a file', feature: true do
include WaitForAjax
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:commit_params) do let(:commit_params) do
......
require 'spec_helper' require 'spec_helper'
feature 'User views files page', feature: true do feature 'User views files page', feature: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:forked_project_with_submodules) } let(:project) { create(:forked_project_with_submodules) }
......
require 'spec_helper' require 'spec_helper'
feature 'Find file keyboard shortcuts', feature: true, js: true do feature 'Find file keyboard shortcuts', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to add a .gitignore file', feature: true do feature 'User wants to add a .gitignore file', feature: true do
include WaitForAjax
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project)
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to add a .gitlab-ci.yml file', feature: true do feature 'User wants to add a .gitlab-ci.yml file', feature: true do
include WaitForAjax
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project)
......
require 'spec_helper' require 'spec_helper'
feature 'project owner creates a license file', feature: true, js: true do feature 'project owner creates a license file', feature: true, js: true do
include WaitForAjax
let(:project_master) { create(:user) } let(:project_master) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
background do background do
......
require 'spec_helper' require 'spec_helper'
feature 'project owner sees a link to create a license file in empty project', feature: true, js: true do feature 'project owner sees a link to create a license file in empty project', feature: true, js: true do
include WaitForAjax
let(:project_master) { create(:user) } let(:project_master) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
background do background do
......
require 'spec_helper' require 'spec_helper'
include WaitForAjax
feature 'Template Undo Button', js: true do feature 'Template Undo Button', js: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as user login_as user
end end
context 'editing a matching file and applying a template' do context 'editing a matching file and applying a template' do
before do before do
visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, "LICENSE")) visit namespace_project_edit_blob_path(project.namespace, project, File.join(project.default_branch, "LICENSE"))
select_file_template('.js-license-selector', 'Apache License 2.0') select_file_template('.js-license-selector', 'Apache License 2.0')
end end
scenario 'reverts template application' do scenario 'reverts template application' do
try_template_undo('http://www.apache.org/licenses/', 'Apply a license template') try_template_undo('http://www.apache.org/licenses/', 'Apply a license template')
end end
end end
context 'creating a non-matching file' do context 'creating a non-matching file' do
before do before do
visit namespace_project_new_blob_path(project.namespace, project, 'master') visit namespace_project_new_blob_path(project.namespace, project, 'master')
......
require 'spec_helper' require 'spec_helper'
feature 'issuable templates', feature: true, js: true do feature 'issuable templates', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'Prioritize labels', feature: true do feature 'Prioritize labels', feature: true do
include WaitForAjax
include DragTo include DragTo
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
feature 'Projects > Members > Anonymous user sees members', feature: true, js: true do feature 'Projects > Members > Anonymous user sees members', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group, :public) } let(:group) { create(:group, :public) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'Projects > Members > Master adds member with expiration date', feature: true, js: true do feature 'Projects > Members > Master adds member with expiration date', feature: true, js: true do
include WaitForAjax
include Select2Helper include Select2Helper
include ActiveSupport::Testing::TimeHelpers include ActiveSupport::Testing::TimeHelpers
......
require 'rails_helper' require 'rails_helper'
feature 'Ref switcher', feature: true, js: true do feature 'Ref switcher', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
feature 'New directory creation', feature: true, js: true do feature 'New directory creation', feature: true, js: true do
include WaitForAjax
include TargetBranchHelpers include TargetBranchHelpers
given(:user) { create(:user) } given(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe 'View on environment', js: true do describe 'View on environment', js: true do
include WaitForAjax
let(:branch_name) { 'feature' } let(:branch_name) { 'feature' }
let(:file_path) { 'files/ruby/feature.rb' } let(:file_path) { 'files/ruby/feature.rb' }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -75,8 +75,6 @@ feature 'Project', feature: true do ...@@ -75,8 +75,6 @@ feature 'Project', feature: true do
end end
describe 'project title' do describe 'project title' do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, namespace: user.namespace) } let(:project) { create(:empty_project, namespace: user.namespace) }
......
...@@ -2,8 +2,6 @@ require 'spec_helper' ...@@ -2,8 +2,6 @@ require 'spec_helper'
Dir["./spec/features/protected_branches/*.rb"].sort.each { |f| require f } Dir["./spec/features/protected_branches/*.rb"].sort.each { |f| require f }
feature 'Projected Branches', feature: true, js: true do feature 'Projected Branches', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,8 +2,6 @@ require 'spec_helper' ...@@ -2,8 +2,6 @@ require 'spec_helper'
Dir["./spec/features/protected_tags/*.rb"].sort.each { |f| require f } Dir["./spec/features/protected_tags/*.rb"].sort.each { |f| require f }
feature 'Projected Tags', feature: true, js: true do feature 'Projected Tags', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,6 @@ require 'spec_helper' ...@@ -2,7 +2,6 @@ require 'spec_helper'
describe "Search", feature: true do describe "Search", feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, namespace: user.namespace) } let(:project) { create(:empty_project, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
describe 'Dashboard > User filters todos', feature: true, js: true do describe 'Dashboard > User filters todos', feature: true, js: true do
include WaitForAjax
let(:user_1) { create(:user, username: 'user_1', name: 'user_1') } let(:user_1) { create(:user, username: 'user_1', name: 'user_1') }
let(:user_2) { create(:user, username: 'user_2', name: 'user_2') } let(:user_2) { create(:user, username: 'user_2', name: 'user_2') }
......
require 'spec_helper' require 'spec_helper'
describe 'Dashboard Todos', feature: true do describe 'Dashboard Todos', feature: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
......
require 'spec_helper' require 'spec_helper'
feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
include WaitForAjax
before { allow_any_instance_of(U2fHelper).to receive(:inject_u2f_api?).and_return(true) } before { allow_any_instance_of(U2fHelper).to receive(:inject_u2f_api?).and_return(true) }
def manage_two_factor_authentication def manage_two_factor_authentication
......
require 'spec_helper' require 'spec_helper'
describe 'Projects tab on a user profile', :feature, :js do describe 'Projects tab on a user profile', :feature, :js do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:empty_project, namespace: user.namespace) } let!(:project) { create(:empty_project, namespace: user.namespace) }
let!(:project2) { create(:empty_project, namespace: user.namespace) } let!(:project2) { create(:empty_project, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
describe 'Snippets tab on a user profile', feature: true, js: true do describe 'Snippets tab on a user profile', feature: true, js: true do
include WaitForAjax
context 'when the user has snippets' do context 'when the user has snippets' do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:snippets) { create_list(:snippet, 2, :public, author: user) } let!(:snippets) { create_list(:snippet, 2, :public, author: user) }
......
...@@ -68,7 +68,6 @@ feature 'Users', feature: true, js: true do ...@@ -68,7 +68,6 @@ feature 'Users', feature: true, js: true do
end end
feature 'username validation' do feature 'username validation' do
include WaitForAjax
let(:loading_icon) { '.fa.fa-spinner' } let(:loading_icon) { '.fa.fa-spinner' }
let(:username_input) { 'new_user_username' } let(:username_input) { 'new_user_username' }
......
require 'spec_helper' require 'spec_helper'
describe API::AccessRequests, api: true do describe API::AccessRequests do
include ApiHelpers
let(:master) { create(:user) } let(:master) { create(:user) }
let(:developer) { create(:user) } let(:developer) { create(:user) }
let(:access_requester) { create(:user) } let(:access_requester) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe API::AwardEmoji, api: true do describe API::AwardEmoji do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
require 'spec_helper' require 'spec_helper'
describe API::Boards, api: true do describe API::Boards do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:non_member) { create(:user) } let(:non_member) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
require 'mime/types' require 'mime/types'
describe API::Branches, api: true do describe API::Branches do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project, :repository, creator: user) } let!(:project) { create(:project, :repository, creator: user) }
let!(:master) { create(:project_member, :master, user: user, project: project) } let!(:master) { create(:project_member, :master, user: user, project: project) }
......
require 'spec_helper' require 'spec_helper'
describe API::BroadcastMessages, api: true do describe API::BroadcastMessages do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
......
require 'spec_helper' require 'spec_helper'
describe API::CommitStatuses, api: true do describe API::CommitStatuses do
include ApiHelpers
let!(:project) { create(:project, :repository) } let!(:project) { create(:project, :repository) }
let(:commit) { project.repository.commit } let(:commit) { project.repository.commit }
let(:guest) { create_user(:guest) } let(:guest) { create_user(:guest) }
......
require 'spec_helper' require 'spec_helper'
require 'mime/types' require 'mime/types'
describe API::Commits, api: true do describe API::Commits do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let!(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } let!(:project) { create(:project, :repository, creator: user, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
describe API::DeployKeys, api: true do describe API::DeployKeys do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:project) { create(:empty_project, creator_id: user.id) } let(:project) { create(:empty_project, creator_id: user.id) }
......
require 'spec_helper' require 'spec_helper'
describe API::Deployments, api: true do describe API::Deployments do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:non_member) { create(:user) } let(:non_member) { create(:user) }
let(:project) { deployment.environment.project } let(:project) { deployment.environment.project }
......
require 'spec_helper' require 'spec_helper'
describe API::API, api: true do describe API::API do
include ApiHelpers
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:application) { Doorkeeper::Application.create!(name: "MyApp", redirect_uri: "https://app.com", owner: user) } let!(:application) { Doorkeeper::Application.create!(name: "MyApp", redirect_uri: "https://app.com", owner: user) }
let!(:token) { Doorkeeper::AccessToken.create! application_id: application.id, resource_owner_id: user.id, scopes: "api" } let!(:token) { Doorkeeper::AccessToken.create! application_id: application.id, resource_owner_id: user.id, scopes: "api" }
......
require 'spec_helper' require 'spec_helper'
describe API::Environments, api: true do describe API::Environments do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:non_member) { create(:user) } let(:non_member) { create(:user) }
let(:project) { create(:empty_project, :private, namespace: user.namespace) } let(:project) { create(:empty_project, :private, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
describe API::Files, api: true do describe API::Files do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project, :repository, namespace: user.namespace ) } let!(:project) { create(:project, :repository, namespace: user.namespace ) }
let(:guest) { create(:user) { |u| project.add_guest(u) } } let(:guest) { create(:user) { |u| project.add_guest(u) } }
......
require 'spec_helper' require 'spec_helper'
describe API::Groups, api: true do describe API::Groups do
include ApiHelpers
include UploadHelpers include UploadHelpers
let(:user1) { create(:user, can_create_group: false) } let(:user1) { create(:user, can_create_group: false) }
......
require 'spec_helper' require 'spec_helper'
describe API::Helpers, api: true do describe API::Helpers do
include API::APIGuard::HelperMethods include API::APIGuard::HelperMethods
include API::Helpers include API::Helpers
include SentryHelper include SentryHelper
......
require 'spec_helper' require 'spec_helper'
describe API::Internal, api: true do describe API::Internal do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:key) { create(:key, user: user) } let(:key) { create(:key, user: user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
require 'spec_helper' require 'spec_helper'
describe API::Issues, api: true do describe API::Issues do
include ApiHelpers
include EmailHelpers include EmailHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe API::Jobs, api: true do describe API::Jobs do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:api_user) { user } let(:api_user) { user }
let!(:project) { create(:project, :repository, creator: user, public_builds: false) } let!(:project) { create(:project, :repository, creator: user, public_builds: false) }
......
require 'spec_helper' require 'spec_helper'
describe API::Keys, api: true do describe API::Keys do
include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:key) { create(:key, user: user) } let(:key) { create(:key, user: user) }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment