Commit ff76adb5 authored by Jacopo's avatar Jacopo

Unnecessary "include WaitForAjax" and "include ApiHelpers"

Removed all the unnecessary include of `WaitForAjax` and `ApiHelpers` in the specs.
Removed unnecessary usage of `api:true`
parent d5835016
---
title: Remove unnecessary test helpers includes
merge_request: 10567
author: Jacopo Beschi @jacopo-beschi
require 'spec_helper'
describe Dashboard::TodosController do
include ApiHelpers
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:empty_project) }
......
require 'spec_helper'
describe Projects::BuildsController do
include ApiHelpers
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
......
require 'spec_helper'
describe Projects::BuildsController do
include ApiHelpers
let(:project) { create(:empty_project, :public) }
describe 'GET trace.json' do
......
require 'spec_helper'
describe Projects::EnvironmentsController do
include ApiHelpers
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
......
require 'spec_helper'
describe Projects::MergeRequestsController do
include ApiHelpers
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
......
require 'spec_helper'
describe Projects::PipelinesController do
include ApiHelpers
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
......
require('spec_helper')
describe Projects::TodosController do
include ApiHelpers
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) }
......
require 'spec_helper'
RSpec.describe 'admin issues labels' do
include WaitForAjax
let!(:bug_label) { Label.create(title: 'bug', template: true) }
let!(:feature_label) { Label.create(title: 'feature', template: true) }
......
require 'spec_helper'
describe "Admin::Users", feature: true do
include WaitForAjax
let!(:user) do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end
......
require 'spec_helper'
describe 'Auto deploy' do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
......
require 'rails_helper'
describe 'Issue Boards add issue modal', :feature, :js do
include WaitForAjax
include WaitForVueResource
let(:project) { create(:empty_project, :public) }
......
require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do
include WaitForAjax
include WaitForVueResource
include DragTo
......
require 'rails_helper'
describe 'Issue Boards new issue', feature: true, js: true do
include WaitForAjax
include WaitForVueResource
let(:project) { create(:empty_project, :public) }
......
require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do
include WaitForAjax
include WaitForVueResource
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Contributions Calendar', :feature, :js do
include WaitForAjax
let(:user) { create(:user) }
let(:contributed_project) { create(:project, :public) }
let(:issue_note) { create(:note, project: contributed_project) }
......
require 'spec_helper'
feature 'Cycle Analytics', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:guest) { create(:user) }
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Tooltips on .timeago dates', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time }
......
require 'spec_helper'
describe 'Dashboard Groups page', js: true, feature: true do
include WaitForAjax
let!(:user) { create :user }
let!(:group) { create(:group) }
let!(:nested_group) { create(:group, :nested) }
......
require 'spec_helper'
feature 'Project member activity', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public, name: 'x', namespace: user.namespace) }
......
require 'spec_helper'
feature 'Expand and collapse diffs', js: true, feature: true do
include WaitForAjax
let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project) }
......
require 'spec_helper'
describe 'Explore Groups page', js: true, feature: true do
include WaitForAjax
let!(:user) { create :user }
let!(:group) { create(:group) }
let!(:public_group) { create(:group, :public) }
......
require 'rails_helper'
describe 'Awards Emoji', feature: true do
include WaitForAjax
include WaitForVueResource
let!(:project) { create(:project, :public) }
......
require 'rails_helper'
feature 'Issues > Labels bulk assignment', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let!(:project) { create(:project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown assignee', :feature, :js do
include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') }
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown author', js: true, feature: true do
include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') }
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown hint', :js, :feature do
include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) }
let!(:user) { create(:user) }
......
......@@ -3,7 +3,6 @@ require 'spec_helper'
describe 'Filter issues', js: true, feature: true do
include Devise::Test::IntegrationHelpers
include FilteredSearchHelpers
include WaitForAjax
let!(:group) { create(:group) }
let!(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,6 @@ require 'spec_helper'
describe 'Recent searches', js: true, feature: true do
include FilteredSearchHelpers
include WaitForAjax
let!(:group) { create(:group) }
let!(:project) { create(:project, group: group) }
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Search bar', js: true, feature: true do
include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) }
let!(:user) { create(:user) }
......
require 'rails_helper'
feature 'GFM autocomplete', feature: true, js: true do
include WaitForAjax
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 Sidebar', feature: true do
include WaitForAjax
include MobileHelpers
let(:project) { create(:project, :public) }
......
require 'rails_helper'
feature 'Multiple issue updating from issues#index', feature: true do
include WaitForAjax
let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
feature 'Issues > User uses slash commands', feature: true, js: true do
include SlashCommandsHelpers
include WaitForAjax
it_behaves_like 'issuable record that supports slash commands in its description and notes', :issue do
let(:issuable) { create(:issue, project: project) }
......
......@@ -4,7 +4,6 @@ describe 'Issues', feature: true do
include DropzoneHelper
include IssueHelpers
include SortingHelper
include WaitForAjax
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'Merge request conflict resolution', js: true, feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
......
......@@ -4,8 +4,6 @@ require 'spec_helper'
# message to be shown by JavaScript when the source branch was deleted.
# Please do not remove "js: true".
describe 'Deleted source branch', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request) }
......
require 'spec_helper'
feature 'Diff note avatars', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") }
......
......@@ -3,7 +3,6 @@ require 'rails_helper'
feature 'Issue filtering by Labels', feature: true, js: true do
include FilteredSearchHelpers
include MergeRequestHelpers
include WaitForAjax
let(:project) { create(:project, :public) }
let!(:user) { create(:user) }
......
......@@ -3,7 +3,6 @@ require 'rails_helper'
describe 'Filter merge requests', feature: true do
include FilteredSearchHelpers
include MergeRequestHelpers
include WaitForAjax
let!(:project) { create(:project) }
let!(:group) { create(:group) }
......
require 'rails_helper'
feature 'Mini Pipeline Graph', :js, :feature do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'spec_helper'
feature 'Pipelines for Merge Requests', feature: true, js: true do
include WaitForAjax
given(:user) { create(:user) }
given(:merge_request) { create(:merge_request) }
given(:project) { merge_request.target_project }
......
......@@ -3,7 +3,6 @@ require 'rails_helper'
feature 'Merge requests filter clear button', feature: true, js: true do
include FilteredSearchHelpers
include MergeRequestHelpers
include WaitForAjax
include IssueHelpers
let!(:project) { create(:project, :public) }
......
require 'rails_helper'
feature 'Multiple merge requests updating from merge_requests#index', feature: true do
include WaitForAjax
let!(:user) { create(:user)}
let!(:project) { create(:project) }
let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
......
......@@ -2,7 +2,6 @@ require 'rails_helper'
feature 'Merge Requests > User uses slash commands', feature: true, js: true do
include SlashCommandsHelpers
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'Widget Deployments Header', feature: true, js: true do
include WaitForAjax
describe 'when deployed to an environment' do
given(:user) { create(:user) }
given(:project) { merge_request.target_project }
......
require 'rails_helper'
describe 'Merge request', :feature, :js do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'rails_helper'
feature 'Milestone', feature: true do
include WaitForAjax
let(:project) { create(:empty_project, :public) }
let(:user) { create(:user) }
......
require 'rails_helper'
describe 'Milestone draggable', feature: true, js: true do
include WaitForAjax
include DragTo
let(:milestone) { create(:milestone, project: project, title: 8.14) }
......
require 'spec_helper'
feature 'File blob', feature: true do
include WaitForAjax
include TreeHelper
let(:project) { create(:project, :public, :test_repo) }
......
require 'spec_helper'
feature 'Editing file blob', feature: true, js: true do
include WaitForAjax
include TreeHelper
let(:project) { create(:project, :public, :test_repo) }
......
require 'spec_helper'
feature 'New blob creation', feature: true, js: true do
include WaitForAjax
include TargetBranchHelpers
given(:user) { create(:user) }
......
require 'spec_helper'
include WaitForAjax
describe 'Cherry-pick Commits' do
let(:group) { create(:group) }
......
require 'rails_helper'
feature 'Mini Pipeline Graph in Commit View', :js, :feature do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'rails_helper'
feature 'Project edit', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
......
require 'spec_helper'
include WaitForAjax
describe 'Edit Project Settings', feature: true do
include WaitForAjax
let(:member) { create(:user) }
let!(:project) { create(:project, :public, path: 'gitlab', name: 'sample') }
let!(:issue) { create(:issue, project: project) }
......
require 'spec_helper'
feature 'User wants to create a file', feature: true do
include WaitForAjax
let(:project) { create(:project) }
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'User wants to add a Dockerfile file', feature: true do
include WaitForAjax
before do
user = create(:user)
project = create(:project)
......
require 'spec_helper'
feature 'User wants to edit a file', feature: true do
include WaitForAjax
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:commit_params) do
......
require 'spec_helper'
feature 'User views files page', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:forked_project_with_submodules) }
......
require 'spec_helper'
feature 'Find file keyboard shortcuts', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'User wants to add a .gitignore file', feature: true do
include WaitForAjax
before do
user = create(:user)
project = create(:project)
......
require 'spec_helper'
feature 'User wants to add a .gitlab-ci.yml file', feature: true do
include WaitForAjax
before do
user = create(:user)
project = create(:project)
......
require 'spec_helper'
feature 'project owner creates a license file', feature: true, js: true do
include WaitForAjax
let(:project_master) { create(:user) }
let(:project) { create(:project) }
background do
......
require 'spec_helper'
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) { create(:empty_project) }
background do
......
require 'spec_helper'
include WaitForAjax
feature 'Template Undo Button', js: true do
feature 'Template Undo Button', js: true do
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
project.team << [user, :master]
login_as user
login_as user
end
context 'editing a matching file and applying a template' do
context 'editing a matching file and applying a template' 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')
end
scenario 'reverts template application' do
try_template_undo('http://www.apache.org/licenses/', 'Apply a license template')
end
end
context 'creating a non-matching file' do
before do
visit namespace_project_new_blob_path(project.namespace, project, 'master')
......