Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-07 03:09:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-07 03:09:52 +0300
commitcbb9c704ee65b439fa1646c86b78a1eb18d677fe (patch)
tree7f03e43731c23896c4d81fe968fee352779a4e53 /spec
parentd650b4f4c4a20f9d1801a0dc69bdc3e106a18e11 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/devise_mailer_spec.rb4
-rw-r--r--spec/models/project_spec.rb2
-rw-r--r--spec/requests/api/environments_spec.rb28
-rw-r--r--spec/support/helpers/login_helpers.rb2
-rw-r--r--spec/views/registrations/welcome/show.html.haml_spec.rb4
5 files changed, 35 insertions, 5 deletions
diff --git a/spec/mailers/devise_mailer_spec.rb b/spec/mailers/devise_mailer_spec.rb
index 360eb827927..1b99bf33033 100644
--- a/spec/mailers/devise_mailer_spec.rb
+++ b/spec/mailers/devise_mailer_spec.rb
@@ -125,6 +125,10 @@ RSpec.describe DeviseMailer do
it 'includes a link to reset the password' do
is_expected.to have_link("Reset password", href: "#{Gitlab.config.gitlab.url}/users/password/edit?reset_password_token=faketoken")
end
+
+ it 'has the mailgun suppression bypass header' do
+ is_expected.to have_header 'X-Mailgun-Suppressions-Bypass', 'true'
+ end
end
describe '#email_changed' do
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 4b51c9e2013..e8adb406a73 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -372,7 +372,7 @@ RSpec.describe Project, factory_default: :keep do
end
it 'is equivalent to #project_members' do
- expect(project.namespace_members).to eq project.project_members
+ expect(project.namespace_members).to match_array(project.project_members)
end
it_behaves_like 'query without source filters' do
diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb
index d06e70a1a02..049c4500207 100644
--- a/spec/requests/api/environments_spec.rb
+++ b/spec/requests/api/environments_spec.rb
@@ -69,6 +69,34 @@ RSpec.describe API::Environments, feature_category: :continuous_delivery do
expect(json_response.size).to eq(0)
end
+ context "when params[:search] is less than #{described_class::MIN_SEARCH_LENGTH} characters" do
+ before do
+ stub_feature_flags(environment_search_api_min_chars: false)
+ end
+
+ it 'returns a normal response' do
+ get api("/projects/#{project.id}/environments?search=ab", user)
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to include_pagination_headers
+ expect(json_response).to be_an Array
+ expect(json_response.size).to eq(0)
+ end
+
+ context 'and environment_search_api_min_chars flag is enabled for the project' do
+ before do
+ stub_feature_flags(environment_search_api_min_chars: project)
+ end
+
+ it 'returns with status 400' do
+ get api("/projects/#{project.id}/environments?search=ab", user)
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['message']).to include("Search query is less than #{described_class::MIN_SEARCH_LENGTH} characters")
+ end
+ end
+ end
+
it 'returns environment by valid state' do
get api("/projects/#{project.id}/environments?states=available", user)
diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb
index 44237b821c3..5fde80e6dc9 100644
--- a/spec/support/helpers/login_helpers.rb
+++ b/spec/support/helpers/login_helpers.rb
@@ -101,6 +101,8 @@ module LoginHelpers
fill_in "user_password", with: (password || user.password)
check 'user_remember_me' if remember
+ wait_for_all_requests
+
find('[data-testid="sign-in-button"]:enabled').click
if two_factor_auth
diff --git a/spec/views/registrations/welcome/show.html.haml_spec.rb b/spec/views/registrations/welcome/show.html.haml_spec.rb
index 99d87ac449b..372dbf01a64 100644
--- a/spec/views/registrations/welcome/show.html.haml_spec.rb
+++ b/spec/views/registrations/welcome/show.html.haml_spec.rb
@@ -7,10 +7,6 @@ RSpec.describe 'registrations/welcome/show' do
before do
allow(view).to receive(:current_user).and_return(user)
- allow(view).to receive(:in_subscription_flow?).and_return(false)
- allow(view).to receive(:in_trial_flow?).and_return(false)
- allow(view).to receive(:user_has_memberships?).and_return(false)
- allow(view).to receive(:in_oauth_flow?).and_return(false)
allow(view).to receive(:glm_tracking_params).and_return({})
render