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
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'issuable templates', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'Prioritize labels', feature: true do
include WaitForAjax
include DragTo
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Projects > Members > Anonymous user sees members', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:project) { create(:empty_project, :public) }
......
require 'spec_helper'
feature 'Projects > Members > Master adds member with expiration date', feature: true, js: true do
include WaitForAjax
include Select2Helper
include ActiveSupport::Testing::TimeHelpers
......
require 'rails_helper'
feature 'Ref switcher', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'New directory creation', feature: true, js: true do
include WaitForAjax
include TargetBranchHelpers
given(:user) { create(:user) }
......
require 'spec_helper'
describe 'View on environment', js: true do
include WaitForAjax
let(:branch_name) { 'feature' }
let(:file_path) { 'files/ruby/feature.rb' }
let(:project) { create(:project, :repository) }
......
......@@ -75,8 +75,6 @@ feature 'Project', feature: true do
end
describe 'project title' do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
......
......@@ -2,8 +2,6 @@ require 'spec_helper'
Dir["./spec/features/protected_branches/*.rb"].sort.each { |f| require f }
feature 'Projected Branches', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) }
let(:project) { create(:project) }
......
......@@ -2,8 +2,6 @@ require 'spec_helper'
Dir["./spec/features/protected_tags/*.rb"].sort.each { |f| require f }
feature 'Projected Tags', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) }
let(:project) { create(:project) }
......
......@@ -2,7 +2,6 @@ require 'spec_helper'
describe "Search", feature: true do
include FilteredSearchHelpers
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
......
require 'spec_helper'
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_2) { create(:user, username: 'user_2', name: 'user_2') }
......
require 'spec_helper'
describe 'Dashboard Todos', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
......
require 'spec_helper'
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) }
def manage_two_factor_authentication
......
require 'spec_helper'
describe 'Projects tab on a user profile', :feature, :js do
include WaitForAjax
let(:user) { create(:user) }
let!(:project) { create(:empty_project, namespace: user.namespace) }
let!(:project2) { create(:empty_project, namespace: user.namespace) }
......
require 'spec_helper'
describe 'Snippets tab on a user profile', feature: true, js: true do
include WaitForAjax
context 'when the user has snippets' do
let(:user) { create(:user) }
let!(:snippets) { create_list(:snippet, 2, :public, author: user) }
......
......@@ -68,7 +68,6 @@ feature 'Users', feature: true, js: true do
end
feature 'username validation' do
include WaitForAjax
let(:loading_icon) { '.fa.fa-spinner' }
let(:username_input) { 'new_user_username' }
......
require 'spec_helper'
describe API::AccessRequests, api: true do
include ApiHelpers
describe API::AccessRequests do
let(:master) { create(:user) }
let(:developer) { create(:user) }
let(:access_requester) { create(:user) }
......
require 'spec_helper'
describe API::AwardEmoji, api: true do
include ApiHelpers
describe API::AwardEmoji do
let(:user) { create(:user) }
let!(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) }
......
require 'spec_helper'
describe API::Boards, api: true do
include ApiHelpers
describe API::Boards do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let(:non_member) { create(:user) }
......
require 'spec_helper'
require 'mime/types'
describe API::Branches, api: true do
include ApiHelpers
describe API::Branches do
let(:user) { create(:user) }
let!(:project) { create(:project, :repository, creator: user) }
let!(:master) { create(:project_member, :master, user: user, project: project) }
......
require 'spec_helper'
describe API::BroadcastMessages, api: true do
include ApiHelpers
describe API::BroadcastMessages do
let(:user) { create(:user) }
let(:admin) { create(:admin) }
......
require 'spec_helper'
describe API::CommitStatuses, api: true do
include ApiHelpers
describe API::CommitStatuses do
let!(:project) { create(:project, :repository) }
let(:commit) { project.repository.commit }
let(:guest) { create_user(:guest) }
......
require 'spec_helper'
require 'mime/types'
describe API::Commits, api: true do
include ApiHelpers
describe API::Commits do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let!(:project) { create(:project, :repository, creator: user, namespace: user.namespace) }
......
require 'spec_helper'
describe API::DeployKeys, api: true do
include ApiHelpers
describe API::DeployKeys do
let(:user) { create(:user) }
let(:admin) { create(:admin) }
let(:project) { create(:empty_project, creator_id: user.id) }
......
require 'spec_helper'
describe API::Deployments, api: true do
include ApiHelpers
describe API::Deployments do
let(:user) { create(:user) }
let(:non_member) { create(:user) }
let(:project) { deployment.environment.project }
......
require 'spec_helper'
describe API::API, api: true do
include ApiHelpers
describe API::API do
let!(:user) { create(: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" }
......
require 'spec_helper'
describe API::Environments, api: true do
include ApiHelpers
describe API::Environments do
let(:user) { create(:user) }
let(:non_member) { create(:user) }
let(:project) { create(:empty_project, :private, namespace: user.namespace) }
......
require 'spec_helper'
describe API::Files, api: true do
include ApiHelpers
describe API::Files do
let(:user) { create(:user) }
let!(:project) { create(:project, :repository, namespace: user.namespace ) }
let(:guest) { create(:user) { |u| project.add_guest(u) } }
......
require 'spec_helper'
describe API::Groups, api: true do
include ApiHelpers
describe API::Groups do
include UploadHelpers
let(:user1) { create(:user, can_create_group: false) }
......
require 'spec_helper'
describe API::Helpers, api: true do
describe API::Helpers do
include API::APIGuard::HelperMethods
include API::Helpers
include SentryHelper
......
require 'spec_helper'
describe API::Internal, api: true do
include ApiHelpers
describe API::Internal do
let(:user) { create(:user) }
let(:key) { create(:key, user: user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
describe API::Issues, api: true do
include ApiHelpers
describe API::Issues do
include EmailHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
describe API::Jobs, api: true do
include ApiHelpers
describe API::Jobs do
let(:user) { create(:user) }
let(:api_user) { user }
let!(:project) { create(:project, :repository, creator: user, public_builds: false) }
......
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.
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