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:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/users/email_verification_on_login_spec.rb1
-rw-r--r--spec/frontend/search/mock_data.js430
-rw-r--r--spec/frontend/search/store/actions_spec.js29
-rw-r--r--spec/frontend/search/store/getters_spec.js20
-rw-r--r--spec/frontend/search/store/mutations_spec.js14
-rw-r--r--spec/helpers/registrations_helper_spec.rb16
-rw-r--r--spec/lib/api/entities/merge_request_basic_spec.rb28
-rw-r--r--spec/lib/gitlab/auth/ip_rate_limiter_spec.rb2
-rw-r--r--spec/lib/gitlab/redis/cluster_rate_limiting_spec.rb7
-rw-r--r--spec/lib/gitlab/redis/multi_store_spec.rb4
-rw-r--r--spec/lib/gitlab/slash_commands/command_spec.rb4
-rw-r--r--spec/models/concerns/require_email_verification_spec.rb17
-rw-r--r--spec/requests/verifies_with_email_spec.rb9
-rw-r--r--spec/support/shared_examples/requests/rack_attack_shared_examples.rb2
14 files changed, 566 insertions, 17 deletions
diff --git a/spec/features/users/email_verification_on_login_spec.rb b/spec/features/users/email_verification_on_login_spec.rb
index de52f0b517e..481ff52b800 100644
--- a/spec/features/users/email_verification_on_login_spec.rb
+++ b/spec/features/users/email_verification_on_login_spec.rb
@@ -11,6 +11,7 @@ RSpec.describe 'Email Verification On Login', :clean_gitlab_redis_rate_limiting,
before do
stub_feature_flags(require_email_verification: require_email_verification_enabled)
+ stub_feature_flags(skip_require_email_verification: false)
end
shared_examples 'email verification required' do
diff --git a/spec/frontend/search/mock_data.js b/spec/frontend/search/mock_data.js
index e02d3b0eab8..4ccfbe41836 100644
--- a/spec/frontend/search/mock_data.js
+++ b/spec/frontend/search/mock_data.js
@@ -192,3 +192,433 @@ export const MOCK_NAVIGATION_ACTION_MUTATION = {
type: types.RECEIVE_NAVIGATION_COUNT,
payload: { key: 'projects', count: '13' },
};
+
+export const MOCK_AGGREGATIONS = [
+ {
+ name: 'language',
+ buckets: [
+ { key: 'random-label-edumingos0', count: 1 },
+ { key: 'random-label-rbourgourd1', count: 2 },
+ { key: 'random-label-dfearnside2', count: 3 },
+ { key: 'random-label-gewins3', count: 4 },
+ { key: 'random-label-telverstone4', count: 5 },
+ { key: 'random-label-ygerriets5', count: 6 },
+ { key: 'random-label-lmoffet6', count: 7 },
+ { key: 'random-label-ehinnerk7', count: 8 },
+ { key: 'random-label-flanceley8', count: 9 },
+ { key: 'random-label-adoyle9', count: 10 },
+ { key: 'random-label-rmcgirla', count: 11 },
+ { key: 'random-label-dwhellansb', count: 12 },
+ { key: 'random-label-apitkethlyc', count: 13 },
+ { key: 'random-label-senevoldsend', count: 14 },
+ { key: 'random-label-tlardnare', count: 15 },
+ { key: 'random-label-fcoilsf', count: 16 },
+ { key: 'random-label-qgeckg', count: 17 },
+ { key: 'random-label-rgrabenh', count: 18 },
+ { key: 'random-label-lashardi', count: 19 },
+ { key: 'random-label-sadamovitchj', count: 20 },
+ { key: 'random-label-rlyddiardk', count: 21 },
+ { key: 'random-label-jpoell', count: 22 },
+ { key: 'random-label-kcharitym', count: 23 },
+ { key: 'random-label-cbertenshawn', count: 24 },
+ { key: 'random-label-jsturgeso', count: 25 },
+ { key: 'random-label-ohouldcroftp', count: 26 },
+ { key: 'random-label-rheijnenq', count: 27 },
+ { key: 'random-label-snortheyr', count: 28 },
+ { key: 'random-label-vpairpoints', count: 29 },
+ { key: 'random-label-odavidovicit', count: 30 },
+ { key: 'random-label-fmccartu', count: 31 },
+ { key: 'random-label-cwansburyv', count: 32 },
+ { key: 'random-label-bdimontw', count: 33 },
+ { key: 'random-label-adocketx', count: 34 },
+ { key: 'random-label-obavridgey', count: 35 },
+ { key: 'random-label-jperezz', count: 36 },
+ { key: 'random-label-gdeneve10', count: 37 },
+ { key: 'random-label-rmckeand11', count: 38 },
+ { key: 'random-label-kwestmerland12', count: 39 },
+ { key: 'random-label-mpryer13', count: 40 },
+ { key: 'random-label-rmcneil14', count: 41 },
+ { key: 'random-label-ablondel15', count: 42 },
+ { key: 'random-label-wbalducci16', count: 43 },
+ { key: 'random-label-swigley17', count: 44 },
+ { key: 'random-label-gferroni18', count: 45 },
+ { key: 'random-label-icollings19', count: 46 },
+ { key: 'random-label-wszymanski1a', count: 47 },
+ { key: 'random-label-jelson1b', count: 48 },
+ { key: 'random-label-fsambrook1c', count: 49 },
+ { key: 'random-label-kconey1d', count: 50 },
+ { key: 'random-label-agoodread1e', count: 51 },
+ { key: 'random-label-nmewton1f', count: 52 },
+ { key: 'random-label-gcodman1g', count: 53 },
+ { key: 'random-label-rpoplee1h', count: 54 },
+ { key: 'random-label-mhug1i', count: 55 },
+ { key: 'random-label-ggowrie1j', count: 56 },
+ { key: 'random-label-ctonepohl1k', count: 57 },
+ { key: 'random-label-cstillman1l', count: 58 },
+ { key: 'random-label-dcollyer1m', count: 59 },
+ { key: 'random-label-idimelow1n', count: 60 },
+ { key: 'random-label-djarley1o', count: 61 },
+ { key: 'random-label-omclleese1p', count: 62 },
+ { key: 'random-label-dstivers1q', count: 63 },
+ { key: 'random-label-svose1r', count: 64 },
+ { key: 'random-label-clanfare1s', count: 65 },
+ { key: 'random-label-aport1t', count: 66 },
+ { key: 'random-label-hcarlett1u', count: 67 },
+ { key: 'random-label-dstillmann1v', count: 68 },
+ { key: 'random-label-ncorpe1w', count: 69 },
+ { key: 'random-label-mjacobsohn1x', count: 70 },
+ { key: 'random-label-ycleiment1y', count: 71 },
+ { key: 'random-label-owherton1z', count: 72 },
+ { key: 'random-label-anowaczyk20', count: 73 },
+ { key: 'random-label-rmckennan21', count: 74 },
+ { key: 'random-label-cmoulding22', count: 75 },
+ { key: 'random-label-sswate23', count: 76 },
+ { key: 'random-label-cbarge24', count: 77 },
+ { key: 'random-label-agrainger25', count: 78 },
+ { key: 'random-label-ncosin26', count: 79 },
+ { key: 'random-label-pkears27', count: 80 },
+ { key: 'random-label-cmcarthur28', count: 81 },
+ { key: 'random-label-jmantripp29', count: 82 },
+ { key: 'random-label-cjekel2a', count: 83 },
+ { key: 'random-label-hdilleway2b', count: 84 },
+ { key: 'random-label-lbovaird2c', count: 85 },
+ { key: 'random-label-mweld2d', count: 86 },
+ { key: 'random-label-marnowitz2e', count: 87 },
+ { key: 'random-label-nbertomieu2f', count: 88 },
+ { key: 'random-label-mledward2g', count: 89 },
+ { key: 'random-label-mhince2h', count: 90 },
+ { key: 'random-label-baarons2i', count: 91 },
+ { key: 'random-label-kfrancie2j', count: 92 },
+ { key: 'random-label-ishooter2k', count: 93 },
+ { key: 'random-label-glowmass2l', count: 94 },
+ { key: 'random-label-rgeorgi2m', count: 95 },
+ { key: 'random-label-bproby2n', count: 96 },
+ { key: 'random-label-hsteffan2o', count: 97 },
+ { key: 'random-label-doruane2p', count: 98 },
+ { key: 'random-label-rlunny2q', count: 99 },
+ { key: 'random-label-geles2r', count: 100 },
+ { key: 'random-label-nmaggiore2s', count: 101 },
+ { key: 'random-label-aboocock2t', count: 102 },
+ { key: 'random-label-eguilbert2u', count: 103 },
+ { key: 'random-label-emccutcheon2v', count: 104 },
+ { key: 'random-label-hcowser2w', count: 105 },
+ { key: 'random-label-dspeeding2x', count: 106 },
+ { key: 'random-label-oseebright2y', count: 107 },
+ { key: 'random-label-hpresdee2z', count: 108 },
+ { key: 'random-label-pesseby30', count: 109 },
+ { key: 'random-label-hpusey31', count: 110 },
+ { key: 'random-label-dmanthorpe32', count: 111 },
+ { key: 'random-label-natley33', count: 112 },
+ { key: 'random-label-iferentz34', count: 113 },
+ { key: 'random-label-adyble35', count: 114 },
+ { key: 'random-label-dlockitt36', count: 115 },
+ { key: 'random-label-acoxwell37', count: 116 },
+ { key: 'random-label-amcgarvey38', count: 117 },
+ { key: 'random-label-rmcgougan39', count: 118 },
+ { key: 'random-label-mscole3a', count: 119 },
+ { key: 'random-label-lmalim3b', count: 120 },
+ { key: 'random-label-cends3c', count: 121 },
+ { key: 'random-label-dmannie3d', count: 122 },
+ { key: 'random-label-lgoodricke3e', count: 123 },
+ { key: 'random-label-rcaghy3f', count: 124 },
+ { key: 'random-label-mprozillo3g', count: 125 },
+ { key: 'random-label-mcardnell3h', count: 126 },
+ { key: 'random-label-gericssen3i', count: 127 },
+ { key: 'random-label-fspooner3j', count: 128 },
+ { key: 'random-label-achadney3k', count: 129 },
+ { key: 'random-label-corchard3l', count: 130 },
+ { key: 'random-label-lyerill3m', count: 131 },
+ { key: 'random-label-jrusk3n', count: 132 },
+ { key: 'random-label-lbonelle3o', count: 133 },
+ { key: 'random-label-eduny3p', count: 134 },
+ { key: 'random-label-mhutchence3q', count: 135 },
+ { key: 'random-label-rmargeram3r', count: 136 },
+ { key: 'random-label-smaudlin3s', count: 137 },
+ { key: 'random-label-sfarrance3t', count: 138 },
+ { key: 'random-label-eclendennen3u', count: 139 },
+ { key: 'random-label-cyabsley3v', count: 140 },
+ { key: 'random-label-ahensmans3w', count: 141 },
+ { key: 'random-label-tsenchenko3x', count: 142 },
+ { key: 'random-label-ryurchishin3y', count: 143 },
+ { key: 'random-label-teby3z', count: 144 },
+ { key: 'random-label-dvaillant40', count: 145 },
+ { key: 'random-label-kpetyakov41', count: 146 },
+ { key: 'random-label-cmorrison42', count: 147 },
+ { key: 'random-label-ltwiddy43', count: 148 },
+ { key: 'random-label-ineame44', count: 149 },
+ { key: 'random-label-blucock45', count: 150 },
+ { key: 'random-label-kdunsford46', count: 151 },
+ { key: 'random-label-dducham47', count: 152 },
+ { key: 'random-label-javramovitz48', count: 153 },
+ { key: 'random-label-mascraft49', count: 154 },
+ { key: 'random-label-bloughead4a', count: 155 },
+ { key: 'random-label-sduckit4b', count: 156 },
+ { key: 'random-label-hhardman4c', count: 157 },
+ { key: 'random-label-cstaniforth4d', count: 158 },
+ { key: 'random-label-jedney4e', count: 159 },
+ { key: 'random-label-bobbard4f', count: 160 },
+ { key: 'random-label-cgiraux4g', count: 161 },
+ { key: 'random-label-tkiln4h', count: 162 },
+ { key: 'random-label-jwansbury4i', count: 163 },
+ { key: 'random-label-dquinlan4j', count: 164 },
+ { key: 'random-label-hgindghill4k', count: 165 },
+ { key: 'random-label-jjowle4l', count: 166 },
+ { key: 'random-label-egambrell4m', count: 167 },
+ { key: 'random-label-jmcgloughlin4n', count: 168 },
+ { key: 'random-label-bbabb4o', count: 169 },
+ { key: 'random-label-achuck4p', count: 170 },
+ { key: 'random-label-tsyers4q', count: 171 },
+ { key: 'random-label-jlandon4r', count: 172 },
+ { key: 'random-label-wteather4s', count: 173 },
+ { key: 'random-label-dfoskin4t', count: 174 },
+ { key: 'random-label-gmorlon4u', count: 175 },
+ { key: 'random-label-jseely4v', count: 176 },
+ { key: 'random-label-cbrass4w', count: 177 },
+ { key: 'random-label-fmanilo4x', count: 178 },
+ { key: 'random-label-bfrangleton4y', count: 179 },
+ { key: 'random-label-vbartkiewicz4z', count: 180 },
+ { key: 'random-label-tclymer50', count: 181 },
+ { key: 'random-label-pqueen51', count: 182 },
+ { key: 'random-label-bpol52', count: 183 },
+ { key: 'random-label-jclaeskens53', count: 184 },
+ { key: 'random-label-cstranieri54', count: 185 },
+ { key: 'random-label-drumbelow55', count: 186 },
+ { key: 'random-label-wbrumham56', count: 187 },
+ { key: 'random-label-azeal57', count: 188 },
+ { key: 'random-label-msnooks58', count: 189 },
+ { key: 'random-label-blapre59', count: 190 },
+ { key: 'random-label-cduckers5a', count: 191 },
+ { key: 'random-label-mgumary5b', count: 192 },
+ { key: 'random-label-rtebbs5c', count: 193 },
+ { key: 'random-label-eroe5d', count: 194 },
+ { key: 'random-label-rconfait5e', count: 195 },
+ { key: 'random-label-fsinderland5f', count: 196 },
+ { key: 'random-label-tdallywater5g', count: 197 },
+ { key: 'random-label-glindenman5h', count: 198 },
+ { key: 'random-label-fbauser5i', count: 199 },
+ { key: 'random-label-bdownton5j', count: 200 },
+ ],
+ },
+];
+
+export const MOCK_LANGUAGE_AGGREGATIONS_BUCKETS = [
+ { key: 'random-label-edumingos0', count: 1 },
+ { key: 'random-label-rbourgourd1', count: 2 },
+ { key: 'random-label-dfearnside2', count: 3 },
+ { key: 'random-label-gewins3', count: 4 },
+ { key: 'random-label-telverstone4', count: 5 },
+ { key: 'random-label-ygerriets5', count: 6 },
+ { key: 'random-label-lmoffet6', count: 7 },
+ { key: 'random-label-ehinnerk7', count: 8 },
+ { key: 'random-label-flanceley8', count: 9 },
+ { key: 'random-label-adoyle9', count: 10 },
+ { key: 'random-label-rmcgirla', count: 11 },
+ { key: 'random-label-dwhellansb', count: 12 },
+ { key: 'random-label-apitkethlyc', count: 13 },
+ { key: 'random-label-senevoldsend', count: 14 },
+ { key: 'random-label-tlardnare', count: 15 },
+ { key: 'random-label-fcoilsf', count: 16 },
+ { key: 'random-label-qgeckg', count: 17 },
+ { key: 'random-label-rgrabenh', count: 18 },
+ { key: 'random-label-lashardi', count: 19 },
+ { key: 'random-label-sadamovitchj', count: 20 },
+ { key: 'random-label-rlyddiardk', count: 21 },
+ { key: 'random-label-jpoell', count: 22 },
+ { key: 'random-label-kcharitym', count: 23 },
+ { key: 'random-label-cbertenshawn', count: 24 },
+ { key: 'random-label-jsturgeso', count: 25 },
+ { key: 'random-label-ohouldcroftp', count: 26 },
+ { key: 'random-label-rheijnenq', count: 27 },
+ { key: 'random-label-snortheyr', count: 28 },
+ { key: 'random-label-vpairpoints', count: 29 },
+ { key: 'random-label-odavidovicit', count: 30 },
+ { key: 'random-label-fmccartu', count: 31 },
+ { key: 'random-label-cwansburyv', count: 32 },
+ { key: 'random-label-bdimontw', count: 33 },
+ { key: 'random-label-adocketx', count: 34 },
+ { key: 'random-label-obavridgey', count: 35 },
+ { key: 'random-label-jperezz', count: 36 },
+ { key: 'random-label-gdeneve10', count: 37 },
+ { key: 'random-label-rmckeand11', count: 38 },
+ { key: 'random-label-kwestmerland12', count: 39 },
+ { key: 'random-label-mpryer13', count: 40 },
+ { key: 'random-label-rmcneil14', count: 41 },
+ { key: 'random-label-ablondel15', count: 42 },
+ { key: 'random-label-wbalducci16', count: 43 },
+ { key: 'random-label-swigley17', count: 44 },
+ { key: 'random-label-gferroni18', count: 45 },
+ { key: 'random-label-icollings19', count: 46 },
+ { key: 'random-label-wszymanski1a', count: 47 },
+ { key: 'random-label-jelson1b', count: 48 },
+ { key: 'random-label-fsambrook1c', count: 49 },
+ { key: 'random-label-kconey1d', count: 50 },
+ { key: 'random-label-agoodread1e', count: 51 },
+ { key: 'random-label-nmewton1f', count: 52 },
+ { key: 'random-label-gcodman1g', count: 53 },
+ { key: 'random-label-rpoplee1h', count: 54 },
+ { key: 'random-label-mhug1i', count: 55 },
+ { key: 'random-label-ggowrie1j', count: 56 },
+ { key: 'random-label-ctonepohl1k', count: 57 },
+ { key: 'random-label-cstillman1l', count: 58 },
+ { key: 'random-label-dcollyer1m', count: 59 },
+ { key: 'random-label-idimelow1n', count: 60 },
+ { key: 'random-label-djarley1o', count: 61 },
+ { key: 'random-label-omclleese1p', count: 62 },
+ { key: 'random-label-dstivers1q', count: 63 },
+ { key: 'random-label-svose1r', count: 64 },
+ { key: 'random-label-clanfare1s', count: 65 },
+ { key: 'random-label-aport1t', count: 66 },
+ { key: 'random-label-hcarlett1u', count: 67 },
+ { key: 'random-label-dstillmann1v', count: 68 },
+ { key: 'random-label-ncorpe1w', count: 69 },
+ { key: 'random-label-mjacobsohn1x', count: 70 },
+ { key: 'random-label-ycleiment1y', count: 71 },
+ { key: 'random-label-owherton1z', count: 72 },
+ { key: 'random-label-anowaczyk20', count: 73 },
+ { key: 'random-label-rmckennan21', count: 74 },
+ { key: 'random-label-cmoulding22', count: 75 },
+ { key: 'random-label-sswate23', count: 76 },
+ { key: 'random-label-cbarge24', count: 77 },
+ { key: 'random-label-agrainger25', count: 78 },
+ { key: 'random-label-ncosin26', count: 79 },
+ { key: 'random-label-pkears27', count: 80 },
+ { key: 'random-label-cmcarthur28', count: 81 },
+ { key: 'random-label-jmantripp29', count: 82 },
+ { key: 'random-label-cjekel2a', count: 83 },
+ { key: 'random-label-hdilleway2b', count: 84 },
+ { key: 'random-label-lbovaird2c', count: 85 },
+ { key: 'random-label-mweld2d', count: 86 },
+ { key: 'random-label-marnowitz2e', count: 87 },
+ { key: 'random-label-nbertomieu2f', count: 88 },
+ { key: 'random-label-mledward2g', count: 89 },
+ { key: 'random-label-mhince2h', count: 90 },
+ { key: 'random-label-baarons2i', count: 91 },
+ { key: 'random-label-kfrancie2j', count: 92 },
+ { key: 'random-label-ishooter2k', count: 93 },
+ { key: 'random-label-glowmass2l', count: 94 },
+ { key: 'random-label-rgeorgi2m', count: 95 },
+ { key: 'random-label-bproby2n', count: 96 },
+ { key: 'random-label-hsteffan2o', count: 97 },
+ { key: 'random-label-doruane2p', count: 98 },
+ { key: 'random-label-rlunny2q', count: 99 },
+ { key: 'random-label-geles2r', count: 100 },
+ { key: 'random-label-nmaggiore2s', count: 101 },
+ { key: 'random-label-aboocock2t', count: 102 },
+ { key: 'random-label-eguilbert2u', count: 103 },
+ { key: 'random-label-emccutcheon2v', count: 104 },
+ { key: 'random-label-hcowser2w', count: 105 },
+ { key: 'random-label-dspeeding2x', count: 106 },
+ { key: 'random-label-oseebright2y', count: 107 },
+ { key: 'random-label-hpresdee2z', count: 108 },
+ { key: 'random-label-pesseby30', count: 109 },
+ { key: 'random-label-hpusey31', count: 110 },
+ { key: 'random-label-dmanthorpe32', count: 111 },
+ { key: 'random-label-natley33', count: 112 },
+ { key: 'random-label-iferentz34', count: 113 },
+ { key: 'random-label-adyble35', count: 114 },
+ { key: 'random-label-dlockitt36', count: 115 },
+ { key: 'random-label-acoxwell37', count: 116 },
+ { key: 'random-label-amcgarvey38', count: 117 },
+ { key: 'random-label-rmcgougan39', count: 118 },
+ { key: 'random-label-mscole3a', count: 119 },
+ { key: 'random-label-lmalim3b', count: 120 },
+ { key: 'random-label-cends3c', count: 121 },
+ { key: 'random-label-dmannie3d', count: 122 },
+ { key: 'random-label-lgoodricke3e', count: 123 },
+ { key: 'random-label-rcaghy3f', count: 124 },
+ { key: 'random-label-mprozillo3g', count: 125 },
+ { key: 'random-label-mcardnell3h', count: 126 },
+ { key: 'random-label-gericssen3i', count: 127 },
+ { key: 'random-label-fspooner3j', count: 128 },
+ { key: 'random-label-achadney3k', count: 129 },
+ { key: 'random-label-corchard3l', count: 130 },
+ { key: 'random-label-lyerill3m', count: 131 },
+ { key: 'random-label-jrusk3n', count: 132 },
+ { key: 'random-label-lbonelle3o', count: 133 },
+ { key: 'random-label-eduny3p', count: 134 },
+ { key: 'random-label-mhutchence3q', count: 135 },
+ { key: 'random-label-rmargeram3r', count: 136 },
+ { key: 'random-label-smaudlin3s', count: 137 },
+ { key: 'random-label-sfarrance3t', count: 138 },
+ { key: 'random-label-eclendennen3u', count: 139 },
+ { key: 'random-label-cyabsley3v', count: 140 },
+ { key: 'random-label-ahensmans3w', count: 141 },
+ { key: 'random-label-tsenchenko3x', count: 142 },
+ { key: 'random-label-ryurchishin3y', count: 143 },
+ { key: 'random-label-teby3z', count: 144 },
+ { key: 'random-label-dvaillant40', count: 145 },
+ { key: 'random-label-kpetyakov41', count: 146 },
+ { key: 'random-label-cmorrison42', count: 147 },
+ { key: 'random-label-ltwiddy43', count: 148 },
+ { key: 'random-label-ineame44', count: 149 },
+ { key: 'random-label-blucock45', count: 150 },
+ { key: 'random-label-kdunsford46', count: 151 },
+ { key: 'random-label-dducham47', count: 152 },
+ { key: 'random-label-javramovitz48', count: 153 },
+ { key: 'random-label-mascraft49', count: 154 },
+ { key: 'random-label-bloughead4a', count: 155 },
+ { key: 'random-label-sduckit4b', count: 156 },
+ { key: 'random-label-hhardman4c', count: 157 },
+ { key: 'random-label-cstaniforth4d', count: 158 },
+ { key: 'random-label-jedney4e', count: 159 },
+ { key: 'random-label-bobbard4f', count: 160 },
+ { key: 'random-label-cgiraux4g', count: 161 },
+ { key: 'random-label-tkiln4h', count: 162 },
+ { key: 'random-label-jwansbury4i', count: 163 },
+ { key: 'random-label-dquinlan4j', count: 164 },
+ { key: 'random-label-hgindghill4k', count: 165 },
+ { key: 'random-label-jjowle4l', count: 166 },
+ { key: 'random-label-egambrell4m', count: 167 },
+ { key: 'random-label-jmcgloughlin4n', count: 168 },
+ { key: 'random-label-bbabb4o', count: 169 },
+ { key: 'random-label-achuck4p', count: 170 },
+ { key: 'random-label-tsyers4q', count: 171 },
+ { key: 'random-label-jlandon4r', count: 172 },
+ { key: 'random-label-wteather4s', count: 173 },
+ { key: 'random-label-dfoskin4t', count: 174 },
+ { key: 'random-label-gmorlon4u', count: 175 },
+ { key: 'random-label-jseely4v', count: 176 },
+ { key: 'random-label-cbrass4w', count: 177 },
+ { key: 'random-label-fmanilo4x', count: 178 },
+ { key: 'random-label-bfrangleton4y', count: 179 },
+ { key: 'random-label-vbartkiewicz4z', count: 180 },
+ { key: 'random-label-tclymer50', count: 181 },
+ { key: 'random-label-pqueen51', count: 182 },
+ { key: 'random-label-bpol52', count: 183 },
+ { key: 'random-label-jclaeskens53', count: 184 },
+ { key: 'random-label-cstranieri54', count: 185 },
+ { key: 'random-label-drumbelow55', count: 186 },
+ { key: 'random-label-wbrumham56', count: 187 },
+ { key: 'random-label-azeal57', count: 188 },
+ { key: 'random-label-msnooks58', count: 189 },
+ { key: 'random-label-blapre59', count: 190 },
+ { key: 'random-label-cduckers5a', count: 191 },
+ { key: 'random-label-mgumary5b', count: 192 },
+ { key: 'random-label-rtebbs5c', count: 193 },
+ { key: 'random-label-eroe5d', count: 194 },
+ { key: 'random-label-rconfait5e', count: 195 },
+ { key: 'random-label-fsinderland5f', count: 196 },
+ { key: 'random-label-tdallywater5g', count: 197 },
+ { key: 'random-label-glindenman5h', count: 198 },
+ { key: 'random-label-fbauser5i', count: 199 },
+ { key: 'random-label-bdownton5j', count: 200 },
+];
+
+export const MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION = [
+ {
+ type: types.REQUEST_AGGREGATIONS,
+ },
+ {
+ type: types.RECEIVE_AGGREGATIONS_SUCCESS,
+ payload: MOCK_AGGREGATIONS,
+ },
+];
+
+export const MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION = [
+ {
+ type: types.REQUEST_AGGREGATIONS,
+ },
+ {
+ type: types.RECEIVE_AGGREGATIONS_ERROR,
+ },
+];
diff --git a/spec/frontend/search/store/actions_spec.js b/spec/frontend/search/store/actions_spec.js
index 3d19b27ff86..041679e9139 100644
--- a/spec/frontend/search/store/actions_spec.js
+++ b/spec/frontend/search/store/actions_spec.js
@@ -27,6 +27,9 @@ import {
MOCK_NAVIGATION_DATA,
MOCK_NAVIGATION_ACTION_MUTATION,
MOCK_ENDPOINT_RESPONSE,
+ MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION,
+ MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION,
+ MOCK_AGGREGATIONS,
} from '../mock_data';
jest.mock('~/flash');
@@ -295,4 +298,30 @@ describe('Global Search Store Actions', () => {
});
});
});
+
+ describe.each`
+ action | axiosMock | type | expectedMutations | errorLogs
+ ${actions.fetchLanguageAggregation} | ${{ method: 'onGet', code: 200 }} | ${'success'} | ${MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION} | ${0}
+ ${actions.fetchLanguageAggregation} | ${{ method: 'onPut', code: 0 }} | ${'error'} | ${MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION} | ${1}
+ ${actions.fetchLanguageAggregation} | ${{ method: 'onGet', code: 500 }} | ${'error'} | ${MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION} | ${1}
+ `('fetchLanguageAggregation', ({ action, axiosMock, type, expectedMutations, errorLogs }) => {
+ describe(`on ${type}`, () => {
+ beforeEach(() => {
+ if (axiosMock.method) {
+ mock[axiosMock.method]().reply(
+ axiosMock.code,
+ axiosMock.code === 200 ? MOCK_AGGREGATIONS : [],
+ );
+ }
+ });
+
+ it(`should ${type === 'error' ? 'NOT ' : ''}dispatch ${
+ type === 'error' ? '' : 'the correct '
+ }mutations`, () => {
+ return testAction({ action, state, expectedMutations }).then(() => {
+ expect(logger.logError).toHaveBeenCalledTimes(errorLogs);
+ });
+ });
+ });
+ });
});
diff --git a/spec/frontend/search/store/getters_spec.js b/spec/frontend/search/store/getters_spec.js
index 081e6a986eb..818902ee720 100644
--- a/spec/frontend/search/store/getters_spec.js
+++ b/spec/frontend/search/store/getters_spec.js
@@ -1,7 +1,13 @@
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from '~/search/store/constants';
import * as getters from '~/search/store/getters';
import createState from '~/search/store/state';
-import { MOCK_QUERY, MOCK_GROUPS, MOCK_PROJECTS } from '../mock_data';
+import {
+ MOCK_QUERY,
+ MOCK_GROUPS,
+ MOCK_PROJECTS,
+ MOCK_AGGREGATIONS,
+ MOCK_LANGUAGE_AGGREGATIONS_BUCKETS,
+} from '../mock_data';
describe('Global Search Store Getters', () => {
let state;
@@ -29,4 +35,16 @@ describe('Global Search Store Getters', () => {
expect(getters.frequentProjects(state)).toStrictEqual(MOCK_PROJECTS);
});
});
+
+ describe('langugageAggregationBuckets', () => {
+ beforeEach(() => {
+ state.aggregations.data = MOCK_AGGREGATIONS;
+ });
+
+ it('returns the correct data', () => {
+ expect(getters.langugageAggregationBuckets(state)).toStrictEqual(
+ MOCK_LANGUAGE_AGGREGATIONS_BUCKETS,
+ );
+ });
+ });
});
diff --git a/spec/frontend/search/store/mutations_spec.js b/spec/frontend/search/store/mutations_spec.js
index a79ec8f70b0..d604cf38f8f 100644
--- a/spec/frontend/search/store/mutations_spec.js
+++ b/spec/frontend/search/store/mutations_spec.js
@@ -8,6 +8,7 @@ import {
MOCK_NAVIGATION_DATA,
MOCK_NAVIGATION_ACTION_MUTATION,
MOCK_DATA_FOR_NAVIGATION_ACTION_MUTATION,
+ MOCK_AGGREGATIONS,
} from '../mock_data';
describe('Global Search Store Mutations', () => {
@@ -108,4 +109,17 @@ describe('Global Search Store Mutations', () => {
);
});
});
+
+ describe.each`
+ mutation | data | result
+ ${types.REQUEST_AGGREGATIONS} | ${[]} | ${{ fetching: true, error: false, data: [] }}
+ ${types.RECEIVE_AGGREGATIONS_SUCCESS} | ${MOCK_AGGREGATIONS} | ${{ fetching: false, error: false, data: MOCK_AGGREGATIONS }}
+ ${types.RECEIVE_AGGREGATIONS_ERROR} | ${[]} | ${{ fetching: false, error: true, data: [] }}
+ `('$mutation', ({ mutation, data, result }) => {
+ it('sets correct object content', () => {
+ mutations[mutation](state, data);
+
+ expect(state.aggregations).toStrictEqual(result);
+ });
+ });
});
diff --git a/spec/helpers/registrations_helper_spec.rb b/spec/helpers/registrations_helper_spec.rb
index b2f9a794cb3..eec87bc8712 100644
--- a/spec/helpers/registrations_helper_spec.rb
+++ b/spec/helpers/registrations_helper_spec.rb
@@ -8,4 +8,20 @@ RSpec.describe RegistrationsHelper do
expect(helper.signup_username_data_attributes.keys).to include(:min_length, :min_length_message, :max_length, :max_length_message, :qa_selector)
end
end
+
+ describe '#arkose_labs_challenge_enabled?' do
+ before do
+ stub_application_setting(
+ arkose_labs_private_api_key: nil,
+ arkose_labs_public_api_key: nil,
+ arkose_labs_namespace: nil
+ )
+ stub_env('ARKOSE_LABS_PRIVATE_KEY', nil)
+ stub_env('ARKOSE_LABS_PUBLIC_KEY', nil)
+ end
+
+ it 'is false' do
+ expect(helper.arkose_labs_challenge_enabled?).to eq false
+ end
+ end
end
diff --git a/spec/lib/api/entities/merge_request_basic_spec.rb b/spec/lib/api/entities/merge_request_basic_spec.rb
index bb0e25d2613..33f8a806c50 100644
--- a/spec/lib/api/entities/merge_request_basic_spec.rb
+++ b/spec/lib/api/entities/merge_request_basic_spec.rb
@@ -4,11 +4,9 @@ require 'spec_helper'
RSpec.describe ::API::Entities::MergeRequestBasic do
let_it_be(:user) { create(:user) }
- let_it_be(:project) { create(:project, :public) }
let_it_be(:merge_request) { create(:merge_request) }
let_it_be(:labels) { create_list(:label, 3) }
let_it_be(:merge_requests) { create_list(:labeled_merge_request, 10, :unique_branches, labels: labels) }
-
let_it_be(:entity) { described_class.new(merge_request) }
# This mimics the behavior of the `Grape::Entity` serializer
@@ -16,7 +14,7 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
described_class.new(obj).presented
end
- subject { entity.as_json }
+ subject(:json) { entity.as_json }
it 'includes expected fields' do
expected_fields = %i[
@@ -57,7 +55,7 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
end
end
- context 'reviewers' do
+ describe 'reviewers' do
before do
merge_request.reviewers = [user]
end
@@ -68,4 +66,26 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
expect(result['reviewers'][0]['username']).to eq user.username
end
end
+
+ describe 'squash' do
+ subject { json[:squash] }
+
+ before do
+ merge_request.target_project.project_setting.update!(squash_option: :never)
+ merge_request.update!(squash: true)
+ end
+
+ it { is_expected.to eq(true) }
+ end
+
+ describe 'squash_on_merge' do
+ subject { json[:squash_on_merge] }
+
+ before do
+ merge_request.target_project.project_setting.update!(squash_option: :never)
+ merge_request.update!(squash: true)
+ end
+
+ it { is_expected.to eq(false) }
+ end
end
diff --git a/spec/lib/gitlab/auth/ip_rate_limiter_spec.rb b/spec/lib/gitlab/auth/ip_rate_limiter_spec.rb
index 3d9be4c3489..c5703cf5c24 100644
--- a/spec/lib/gitlab/auth/ip_rate_limiter_spec.rb
+++ b/spec/lib/gitlab/auth/ip_rate_limiter_spec.rb
@@ -19,7 +19,7 @@ RSpec.describe Gitlab::Auth::IpRateLimiter, :use_clean_rails_memory_store_cachin
before do
stub_rack_attack_setting(options)
- Rack::Attack.reset!
+ Gitlab::Redis::RateLimiting.with(&:flushdb)
Rack::Attack.clear_configuration
Gitlab::RackAttack.configure(Rack::Attack)
end
diff --git a/spec/lib/gitlab/redis/cluster_rate_limiting_spec.rb b/spec/lib/gitlab/redis/cluster_rate_limiting_spec.rb
new file mode 100644
index 00000000000..3eba3233f08
--- /dev/null
+++ b/spec/lib/gitlab/redis/cluster_rate_limiting_spec.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::Redis::ClusterRateLimiting, feature_category: :redis do
+ include_examples "redis_new_instance_shared_examples", 'cluster_rate_limiting', Gitlab::Redis::Cache
+end
diff --git a/spec/lib/gitlab/redis/multi_store_spec.rb b/spec/lib/gitlab/redis/multi_store_spec.rb
index 74b38cfa464..4c23f621b0f 100644
--- a/spec/lib/gitlab/redis/multi_store_spec.rb
+++ b/spec/lib/gitlab/redis/multi_store_spec.rb
@@ -1195,7 +1195,7 @@ RSpec.describe Gitlab::Redis::MultiStore, feature_category: :redis do
context 'when FF table guard raises' do
before do
- allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise(ActiveRecord::NoDatabaseError)
end
it 'multi store is disabled' do
@@ -1221,7 +1221,7 @@ RSpec.describe Gitlab::Redis::MultiStore, feature_category: :redis do
context 'when FF table guard raises' do
before do
- allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise(ActiveRecord::NoDatabaseError)
end
it 'multi store is disabled' do
diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb
index f4664bcfef9..7e3ff46fae5 100644
--- a/spec/lib/gitlab/slash_commands/command_spec.rb
+++ b/spec/lib/gitlab/slash_commands/command_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::SlashCommands::Command do
+RSpec.describe Gitlab::SlashCommands::Command, feature_category: :integrations do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:chat_name) { double(:chat_name, user: user) }
@@ -28,7 +28,7 @@ RSpec.describe Gitlab::SlashCommands::Command do
it 'displays the help message' do
expect(subject[:response_type]).to be(:ephemeral)
expect(subject[:text]).to start_with('The specified command is not valid')
- expect(subject[:text]).to match('/gitlab issue show')
+ expect(subject[:text]).to include('/gitlab [project name or alias] issue show <id>')
end
end
diff --git a/spec/models/concerns/require_email_verification_spec.rb b/spec/models/concerns/require_email_verification_spec.rb
index d087b2864f8..0a6293f852e 100644
--- a/spec/models/concerns/require_email_verification_spec.rb
+++ b/spec/models/concerns/require_email_verification_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe RequireEmailVerification do
+RSpec.describe RequireEmailVerification, feature_category: :insider_threat do
let_it_be(:model) do
Class.new(ApplicationRecord) do
self.table_name = 'users'
@@ -15,11 +15,15 @@ RSpec.describe RequireEmailVerification do
using RSpec::Parameterized::TableSyntax
- where(:feature_flag_enabled, :two_factor_enabled, :overridden) do
- false | false | false
- false | true | false
- true | false | true
- true | true | false
+ where(:feature_flag_enabled, :two_factor_enabled, :skipped, :overridden) do
+ false | false | false | false
+ false | false | true | false
+ false | true | false | false
+ false | true | true | false
+ true | false | false | true
+ true | false | true | false
+ true | true | false | false
+ true | true | true | false
end
with_them do
@@ -29,6 +33,7 @@ RSpec.describe RequireEmailVerification do
before do
stub_feature_flags(require_email_verification: feature_flag_enabled ? instance : another_instance)
allow(instance).to receive(:two_factor_enabled?).and_return(two_factor_enabled)
+ stub_feature_flags(skip_require_email_verification: skipped ? instance : another_instance)
end
describe '#lock_access!' do
diff --git a/spec/requests/verifies_with_email_spec.rb b/spec/requests/verifies_with_email_spec.rb
index cac754a9cb1..8a6a7e717ff 100644
--- a/spec/requests/verifies_with_email_spec.rb
+++ b/spec/requests/verifies_with_email_spec.rb
@@ -223,6 +223,7 @@ feature_category: :user_management do
context 'when the feature flag is toggled on' do
before do
stub_feature_flags(require_email_verification: user)
+ stub_feature_flags(skip_require_email_verification: false)
end
it_behaves_like 'verifying with email'
@@ -242,6 +243,14 @@ feature_category: :user_management do
it_behaves_like 'verifying with email'
end
+
+ context 'when the skip_require_email_verification feature flag is turned on' do
+ before do
+ stub_feature_flags(skip_require_email_verification: user)
+ end
+
+ it_behaves_like 'not verifying with email'
+ end
end
end
end
diff --git a/spec/support/shared_examples/requests/rack_attack_shared_examples.rb b/spec/support/shared_examples/requests/rack_attack_shared_examples.rb
index 82ed6eb4c95..3f457890f35 100644
--- a/spec/support/shared_examples/requests/rack_attack_shared_examples.rb
+++ b/spec/support/shared_examples/requests/rack_attack_shared_examples.rb
@@ -382,7 +382,7 @@ RSpec.shared_examples 'tracking when dry-run mode is set' do
end
def reset_rack_attack
- Rack::Attack.reset!
+ Gitlab::Redis::RateLimiting.with(&:flushdb)
Rack::Attack.clear_configuration
Gitlab::RackAttack.configure(Rack::Attack)
end