Commit 784fae4b authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent fc53ce8e
...@@ -226,7 +226,7 @@ export default { ...@@ -226,7 +226,7 @@ export default {
<icon :size="12" name="expand-up" aria-hidden="true" /> <icon :size="12" name="expand-up" aria-hidden="true" />
</a> </a>
<a class="mx-2 cursor-pointer js-unfold-all" @click="handleExpandLines()"> <a class="mx-2 cursor-pointer js-unfold-all" @click="handleExpandLines()">
<span>{{ s__('Diffs|Show all lines') }}</span> <span>{{ s__('Diffs|Show unchanged lines') }}</span>
</a> </a>
<a <a
v-if="canExpandDown" v-if="canExpandDown"
......
...@@ -57,4 +57,4 @@ export const MIN_RENDERING_MS = 2; ...@@ -57,4 +57,4 @@ export const MIN_RENDERING_MS = 2;
export const START_RENDERING_INDEX = 200; export const START_RENDERING_INDEX = 200;
export const INLINE_DIFF_LINES_KEY = 'highlighted_diff_lines'; export const INLINE_DIFF_LINES_KEY = 'highlighted_diff_lines';
export const PARALLEL_DIFF_LINES_KEY = 'parallel_diff_lines'; export const PARALLEL_DIFF_LINES_KEY = 'parallel_diff_lines';
export const DIFFS_PER_PAGE = 10; export const DIFFS_PER_PAGE = 20;
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
} }
.template-selector-dropdowns-wrap { .template-selector-dropdowns-wrap {
display: inline-block; display: flex;
vertical-align: top; vertical-align: top;
@media(max-width: map-get($grid-breakpoints, lg)-1) { @media(max-width: map-get($grid-breakpoints, lg)-1) {
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
font-family: $regular_font; font-family: $regular_font;
margin: 0 8px 0 0;
@media(max-width: map-get($grid-breakpoints, lg)-1) { @media(max-width: map-get($grid-breakpoints, lg)-1) {
display: block; display: block;
......
...@@ -249,14 +249,9 @@ module Clusters ...@@ -249,14 +249,9 @@ module Clusters
end end
def kubernetes_namespace_for(environment) def kubernetes_namespace_for(environment)
project = environment.project managed_namespace(environment) ||
persisted_namespace = Clusters::KubernetesNamespaceFinder.new( ci_configured_namespace(environment) ||
self, default_namespace(environment)
project: project,
environment_name: environment.name
).execute
persisted_namespace&.namespace || Gitlab::Kubernetes::DefaultNamespace.new(self, project: project).from_environment_slug(environment.slug)
end end
def allow_user_defined_namespace? def allow_user_defined_namespace?
...@@ -308,6 +303,25 @@ module Clusters ...@@ -308,6 +303,25 @@ module Clusters
end end
end end
def managed_namespace(environment)
Clusters::KubernetesNamespaceFinder.new(
self,
project: environment.project,
environment_name: environment.name
).execute&.namespace
end
def ci_configured_namespace(environment)
environment.last_deployable&.expanded_kubernetes_namespace
end
def default_namespace(environment)
Gitlab::Kubernetes::DefaultNamespace.new(
self,
project: environment.project
).from_environment_slug(environment.slug)
end
def instance_domain def instance_domain
@instance_domain ||= Gitlab::CurrentSettings.auto_devops_domain @instance_domain ||= Gitlab::CurrentSettings.auto_devops_domain
end end
......
...@@ -2079,10 +2079,16 @@ class Project < ApplicationRecord ...@@ -2079,10 +2079,16 @@ class Project < ApplicationRecord
end end
def default_merge_request_target def default_merge_request_target
if forked_from_project&.merge_requests_enabled? return self unless forked_from_project
forked_from_project return self unless forked_from_project.merge_requests_enabled?
else
# When our current visibility is more restrictive than the source project,
# (e.g., the fork is `private` but the parent is `public`), target the less
# permissive project
if visibility_level_value < forked_from_project.visibility_level_value
self self
else
forked_from_project
end end
end end
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
= form_tag labels_filter_path, method: :get do = form_tag labels_filter_path, method: :get do
= hidden_field_tag :subscribed, params[:subscribed] = hidden_field_tag :subscribed, params[:subscribed]
.input-group .input-group
= search_field_tag :search, params[:search], { placeholder: _('Filter'), id: 'label-search', class: 'form-control search-text-input input-short', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: _('Filter'), id: 'label-search', class: 'form-control search-text-input input-short', spellcheck: false, autofocus: true }
%span.input-group-append %span.input-group-append
%button.btn.btn-default{ type: "submit", "aria-label" => _('Submit search') } %button.btn.btn-default{ type: "submit", "aria-label" => _('Submit search') }
= icon("search") = icon("search")
......
---
title: Allow Kubernetes namespaces specified via CI template to be used for terminals,
pod logs and deploy boards
merge_request: 21460
author:
type: added
---
title: Add autofocus to label search fields
merge_request: 21508
author:
type: changed
---
title: Improve diff expansion text
merge_request: 21616
author:
type: other
---
title: Fix Single-File-Editor-Layout breaking when branch name is too long
merge_request: 21577
author: Roman Kuba
type: fixed
---
title: 'When a forked project is less visible than its source, merge requests now target the less visible project by default.'
merge_request: 21517
author:
type: changed
...@@ -119,6 +119,7 @@ Rails.application.routes.draw do ...@@ -119,6 +119,7 @@ Rails.application.routes.draw do
draw :trial_registration draw :trial_registration
draw :country draw :country
draw :country_state draw :country_state
draw :subscription
end end
Gitlab.ee do Gitlab.ee do
......
...@@ -144,6 +144,8 @@ Read more about local state management with Apollo in the [Vue Apollo documentat ...@@ -144,6 +144,8 @@ Read more about local state management with Apollo in the [Vue Apollo documentat
### Testing ### Testing
#### Mocking response as component data
With [Vue test utils][vue-test-utils] it is easy to quickly test components that With [Vue test utils][vue-test-utils] it is easy to quickly test components that
fetch GraphQL queries. The simplest way is to use `shallowMount` and then set fetch GraphQL queries. The simplest way is to use `shallowMount` and then set
the data on the component the data on the component
...@@ -158,7 +160,100 @@ it('tests apollo component', () => { ...@@ -158,7 +160,100 @@ it('tests apollo component', () => {
}); });
``` ```
Another possible way is testing queries with mocked GraphQL schema. Read more about this way in [Vue Apollo testing documentation](https://vue-apollo.netlify.com/guide/testing.html#tests-with-mocked-graqhql-schema) #### Testing loading state
If we need to test how our component renders when results from the GraphQL API are still loading, we can mock a loading state into respective Apollo queries/mutations:
```javascript
function createComponent({
loading = false,
} = {}) {
const $apollo = {
queries: {
designs: {
loading,
},
};
wrapper = shallowMount(Index, {
sync: false,
mocks: { $apollo }
});
}
it('renders loading icon', () => {
createComponent({ loading: true });
expect(wrapper.element).toMatchSnapshot();
})
```
#### Testing Apollo components
If we use `ApolloQuery` or `ApolloMutation` in our components, in order to test their functionality we need to add a stub first:
```javascript
import { ApolloMutation } from 'vue-apollo';
function createComponent(props = {}) {
wrapper = shallowMount(MyComponent, {
sync: false,
propsData: {
...props,
},
stubs: {
ApolloMutation,
},
});
}
```
`ApolloMutation` component exposes `mutate` method via scoped slot. If we want to test this method, we need to add it to mocks:
```javascript
const mutate = jest.fn(() => Promise.resolve());
const $apollo = {
mutate,
};
function createComponent(props = {}) {
wrapper = shallowMount(MyComponent, {
sync: false,
propsData: {
...props,
},
stubs: {
ApolloMutation,
},
mocks: {
$apollo:
}
});
}
```
Then we can check if `mutate` is called with correct variables:
```javascript
const mutationVariables = {
mutation: createNoteMutation,
update: expect.anything(),
variables: {
input: {
noteableId: 'noteable-id',
body: 'test',
discussionId: '0',
},
},
};
it('calls mutation on submitting form ', () => {
createComponent()
findReplyForm().vm.$emit('submitForm');
expect(mutate).toHaveBeenCalledWith(mutationVariables);
});
```
## Usage outside of Vue ## Usage outside of Vue
......
...@@ -68,7 +68,7 @@ list. ...@@ -68,7 +68,7 @@ list.
By default, the diff shows only the parts of a file which are changed. By default, the diff shows only the parts of a file which are changed.
To view more unchanged lines above or below a change click on the To view more unchanged lines above or below a change click on the
**Expand up** or **Expand down** icons. You can also click on **Show all lines** **Expand up** or **Expand down** icons. You can also click on **Show unchanged lines**
to expand the entire file. to expand the entire file.
![Incrementally expand merge request diffs](img/incrementally_expand_merge_request_diffs_v12_2.png) ![Incrementally expand merge request diffs](img/incrementally_expand_merge_request_diffs_v12_2.png)
......
...@@ -3209,6 +3209,9 @@ msgstr "" ...@@ -3209,6 +3209,9 @@ msgstr ""
msgid "Checking username availability..." msgid "Checking username availability..."
msgstr "" msgstr ""
msgid "Checkout"
msgstr ""
msgid "Cherry-pick this commit" msgid "Cherry-pick this commit"
msgstr "" msgstr ""
...@@ -5994,7 +5997,7 @@ msgstr "" ...@@ -5994,7 +5997,7 @@ msgstr ""
msgid "Diffs|No file name available" msgid "Diffs|No file name available"
msgstr "" msgstr ""
msgid "Diffs|Show all lines" msgid "Diffs|Show unchanged lines"
msgstr "" msgstr ""
msgid "Diffs|Something went wrong while fetching diff lines." msgid "Diffs|Something went wrong while fetching diff lines."
......
...@@ -24,7 +24,7 @@ describe AbuseReportsController do ...@@ -24,7 +24,7 @@ describe AbuseReportsController do
get :new, params: { user_id: user_id } get :new, params: { user_id: user_id }
expect(response).to redirect_to root_path expect(response).to redirect_to root_path
expect(flash[:alert]).to eq('Cannot create the abuse report. The user has been deleted.') expect(flash[:alert]).to eq(_('Cannot create the abuse report. The user has been deleted.'))
end end
end end
...@@ -35,7 +35,7 @@ describe AbuseReportsController do ...@@ -35,7 +35,7 @@ describe AbuseReportsController do
get :new, params: { user_id: user.id } get :new, params: { user_id: user.id }
expect(response).to redirect_to user expect(response).to redirect_to user
expect(flash[:alert]).to eq('Cannot create the abuse report. This user has been blocked.') expect(flash[:alert]).to eq(_('Cannot create the abuse report. This user has been blocked.'))
end end
end end
end end
......
...@@ -155,7 +155,7 @@ describe Admin::UsersController do ...@@ -155,7 +155,7 @@ describe Admin::UsersController do
put :block, params: { id: user.username } put :block, params: { id: user.username }
user.reload user.reload
expect(user.blocked?).to be_truthy expect(user.blocked?).to be_truthy
expect(flash[:notice]).to eq 'Successfully blocked' expect(flash[:notice]).to eq _('Successfully blocked')
end end
end end
...@@ -171,7 +171,7 @@ describe Admin::UsersController do ...@@ -171,7 +171,7 @@ describe Admin::UsersController do
put :unblock, params: { id: user.username } put :unblock, params: { id: user.username }
user.reload user.reload
expect(user.blocked?).to be_truthy expect(user.blocked?).to be_truthy
expect(flash[:alert]).to eq 'This user cannot be unlocked manually from GitLab' expect(flash[:alert]).to eq _('This user cannot be unlocked manually from GitLab')
end end
end end
...@@ -184,7 +184,7 @@ describe Admin::UsersController do ...@@ -184,7 +184,7 @@ describe Admin::UsersController do
put :unblock, params: { id: user.username } put :unblock, params: { id: user.username }
user.reload user.reload
expect(user.blocked?).to be_falsey expect(user.blocked?).to be_falsey
expect(flash[:notice]).to eq 'Successfully unblocked' expect(flash[:notice]).to eq _('Successfully unblocked')
end end
end end
end end
...@@ -234,7 +234,7 @@ describe Admin::UsersController do ...@@ -234,7 +234,7 @@ describe Admin::UsersController do
go go
expect(flash[:notice]) expect(flash[:notice])
.to eq 'Two-factor Authentication has been disabled for this user' .to eq _('Two-factor Authentication has been disabled for this user')
end end
def go def go
...@@ -249,7 +249,9 @@ describe Admin::UsersController do ...@@ -249,7 +249,9 @@ describe Admin::UsersController do
it 'shows only one error message for an invalid email' do it 'shows only one error message for an invalid email' do
post :create, params: { user: attributes_for(:user, email: 'bogus') } post :create, params: { user: attributes_for(:user, email: 'bogus') }
expect(assigns[:user].errors).to contain_exactly("Email is invalid")
errors = assigns[:user].errors
expect(errors).to contain_exactly(errors.full_message(:email, I18n.t('errors.messages.invalid')))
end end
end end
...@@ -346,7 +348,7 @@ describe Admin::UsersController do ...@@ -346,7 +348,7 @@ describe Admin::UsersController do
it "shows a notice" do it "shows a notice" do
post :impersonate, params: { id: user.username } post :impersonate, params: { id: user.username }
expect(flash[:alert]).to eq("You cannot impersonate a blocked user") expect(flash[:alert]).to eq(_('You cannot impersonate a blocked user'))
end end
it "doesn't sign us in as the user" do it "doesn't sign us in as the user" do
......
...@@ -16,7 +16,7 @@ describe PasswordsController do ...@@ -16,7 +16,7 @@ describe PasswordsController do
post :create post :create
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(flash[:alert]).to eq 'Password authentication is unavailable.' expect(flash[:alert]).to eq _('Password authentication is unavailable.')
end end
end end
...@@ -26,7 +26,7 @@ describe PasswordsController do ...@@ -26,7 +26,7 @@ describe PasswordsController do
it 'prevents a password reset' do it 'prevents a password reset' do
post :create, params: { user: { email: user.email } } post :create, params: { user: { email: user.email } }
expect(flash[:alert]).to eq 'Password authentication is unavailable.' expect(flash[:alert]).to eq _('Password authentication is unavailable.')
end end
end end
end end
......
...@@ -37,7 +37,7 @@ describe Profiles::PreferencesController do ...@@ -37,7 +37,7 @@ describe Profiles::PreferencesController do
context 'on successful update' do context 'on successful update' do
it 'sets the flash' do it 'sets the flash' do
go go
expect(flash[:notice]).to eq 'Preferences saved.' expect(flash[:notice]).to eq _('Preferences saved.')
end end
it "changes the user's preferences" do it "changes the user's preferences" do
...@@ -62,7 +62,7 @@ describe Profiles::PreferencesController do ...@@ -62,7 +62,7 @@ describe Profiles::PreferencesController do
go go
expect(flash[:alert]).to eq('Failed to save preferences.') expect(flash[:alert]).to eq(_('Failed to save preferences.'))
end end
end end
......
...@@ -70,7 +70,7 @@ describe Profiles::TwoFactorAuthsController do ...@@ -70,7 +70,7 @@ describe Profiles::TwoFactorAuthsController do
it 'assigns error' do it 'assigns error' do
go go
expect(assigns[:error]).to eq 'Invalid pin code' expect(assigns[:error]).to eq _('Invalid pin code')
end end
it 'assigns qr_code' do it 'assigns qr_code' do
......
...@@ -118,7 +118,7 @@ describe ProfilesController, :request_store do ...@@ -118,7 +118,7 @@ describe ProfilesController, :request_store do
format: :json format: :json
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(json_response['message']).to eq('Username successfully changed') expect(json_response['message']).to eq(s_('Profiles|Username successfully changed'))
end end
it 'renders an error message when the username was not updated' do it 'renders an error message when the username was not updated' do
......
...@@ -97,7 +97,7 @@ describe Projects::ArtifactsController do ...@@ -97,7 +97,7 @@ describe Projects::ArtifactsController do
it 'sets the notice' do it 'sets the notice' do
subject subject
expect(flash[:notice]).to eq('Artifact was successfully deleted.') expect(flash[:notice]).to eq(_('Artifact was successfully deleted.'))
end end
context 'when artifact deletion fails' do context 'when artifact deletion fails' do
...@@ -114,7 +114,7 @@ describe Projects::ArtifactsController do ...@@ -114,7 +114,7 @@ describe Projects::ArtifactsController do
it 'sets the notice' do it 'sets the notice' do
subject subject
expect(flash[:notice]).to eq('Artifact could not be deleted.') expect(flash[:notice]).to eq(_('Artifact could not be deleted.'))
end end
end end
......
...@@ -86,8 +86,8 @@ describe Projects::Environments::PrometheusApiController do ...@@ -86,8 +86,8 @@ describe Projects::Environments::PrometheusApiController do
it 'returns 204 no_content' do it 'returns 204 no_content' do
get :proxy, params: environment_params get :proxy, params: environment_params
expect(json_response['status']).to eq('processing') expect(json_response['status']).to eq(_('processing'))
expect(json_response['message']).to eq('Not ready yet. Try again later.') expect(json_response['message']).to eq(_('Not ready yet. Try again later.'))
expect(response).to have_gitlab_http_status(:no_content) expect(response).to have_gitlab_http_status(:no_content)
end end
end end
......
...@@ -170,7 +170,7 @@ describe Projects::IssuesController do ...@@ -170,7 +170,7 @@ describe Projects::IssuesController do
it 'redirects to signin if not logged in' do it 'redirects to signin if not logged in' do
get :new, params: { namespace_id: project.namespace, project_id: project } get :new, params: { namespace_id: project.namespace, project_id: project }
expect(flash[:alert]).to eq 'You need to sign in or sign up before continuing.' expect(flash[:alert]).to eq I18n.t('devise.failure.unauthenticated')
expect(response).to redirect_to(new_user_session_path) expect(response).to redirect_to(new_user_session_path)
end end
...@@ -926,7 +926,7 @@ describe Projects::IssuesController do ...@@ -926,7 +926,7 @@ describe Projects::IssuesController do
it 'sets a flash message' do it 'sets a flash message' do
post_issue(title: 'Hello') post_issue(title: 'Hello')
expect(flash[:notice]).to eq('Resolved all discussions.') expect(flash[:notice]).to eq(_('Resolved all discussions.'))
end end
describe "resolving a single discussion" do describe "resolving a single discussion" do
...@@ -940,7 +940,7 @@ describe Projects::IssuesController do ...@@ -940,7 +940,7 @@ describe Projects::IssuesController do
end end
it 'sets a flash message that one discussion was resolved' do it 'sets a flash message that one discussion was resolved' do
expect(flash[:notice]).to eq('Resolved 1 discussion.') expect(flash[:notice]).to eq(_('Resolved 1 discussion.'))
end end
end end
end end
...@@ -1314,7 +1314,7 @@ describe Projects::IssuesController do ...@@ -1314,7 +1314,7 @@ describe Projects::IssuesController do
it "returns 302 for project members with developer role" do it "returns 302 for project members with developer role" do
import_csv import_csv
expect(flash[:notice]).to include('Your issues are being imported') expect(flash[:notice]).to eq(_("Your issues are being imported. Once finished, you'll get a confirmation email."))
expect(response).to redirect_to(project_issues_path(project)) expect(response).to redirect_to(project_issues_path(project))
end end
...@@ -1325,7 +1325,7 @@ describe Projects::IssuesController do ...@@ -1325,7 +1325,7 @@ describe Projects::IssuesController do
import_csv import_csv
expect(flash[:alert]).to include('File upload error.') expect(flash[:alert]).to include(_('File upload error.'))
expect(response).to redirect_to(project_issues_path(project)) expect(response).to redirect_to(project_issues_path(project))
end end
end end
......
...@@ -416,7 +416,7 @@ describe Projects::PipelineSchedulesController do ...@@ -416,7 +416,7 @@ describe Projects::PipelineSchedulesController do
end end
expect(flash.to_a.size).to eq(2) expect(flash.to_a.size).to eq(2)
expect(flash[:alert]).to eq 'You cannot play this scheduled pipeline at the moment. Please wait a minute.' expect(flash[:alert]).to eq _('You cannot play this scheduled pipeline at the moment. Please wait a minute.')
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
......
...@@ -59,7 +59,7 @@ describe Projects::RawController do ...@@ -59,7 +59,7 @@ describe Projects::RawController do
it 'prevents from accessing the raw file' do it 'prevents from accessing the raw file' do
execute_raw_requests(requests: 6, project: project, file_path: file_path) execute_raw_requests(requests: 6, project: project, file_path: file_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.') expect(flash[:alert]).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429) expect(response).to have_gitlab_http_status(429)
end end
...@@ -109,7 +109,7 @@ describe Projects::RawController do ...@@ -109,7 +109,7 @@ describe Projects::RawController do
execute_raw_requests(requests: 3, project: project, file_path: modified_path) execute_raw_requests(requests: 3, project: project, file_path: modified_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.') expect(flash[:alert]).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429) expect(response).to have_gitlab_http_status(429)
end end
end end
...@@ -137,7 +137,7 @@ describe Projects::RawController do ...@@ -137,7 +137,7 @@ describe Projects::RawController do
# Accessing downcase version of readme # Accessing downcase version of readme
execute_raw_requests(requests: 6, project: project, file_path: file_path) execute_raw_requests(requests: 6, project: project, file_path: file_path)
expect(flash[:alert]).to eq('You cannot access the raw file. Please wait a minute.') expect(flash[:alert]).to eq(_('You cannot access the raw file. Please wait a minute.'))
expect(response).to have_gitlab_http_status(429) expect(response).to have_gitlab_http_status(429)
# Accessing upcase version of readme # Accessing upcase version of readme
......
...@@ -35,7 +35,7 @@ describe Projects::UploadsController do ...@@ -35,7 +35,7 @@ describe Projects::UploadsController do
post_authorize post_authorize
expect(response).to have_gitlab_http_status(500) expect(response).to have_gitlab_http_status(500)
expect(response.body).to eq('Error uploading file') expect(response.body).to eq(_('Error uploading file'))
end end
end end
......
...@@ -114,7 +114,7 @@ describe Projects::WikisController do ...@@ -114,7 +114,7 @@ describe Projects::WikisController do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_http_status(:ok)
expect(flash[:notice]).to eq('The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.') expect(flash[:notice]).to eq(_('The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.'))
end end
end end
end end
...@@ -205,7 +205,7 @@ describe Projects::WikisController do ...@@ -205,7 +205,7 @@ describe Projects::WikisController do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_http_status(:ok)
expect(response.body).to include('Edit Page') expect(response.body).to include(s_('Wiki|Edit Page'))
end end
end end
end end
......
...@@ -506,7 +506,7 @@ describe ProjectsController do ...@@ -506,7 +506,7 @@ describe ProjectsController do
expect { update_project path: 'renamed_path' } expect { update_project path: 'renamed_path' }
.not_to change { project.reload.path } .not_to change { project.reload.path }
expect(controller).to set_flash.now[:alert].to(/container registry tags/) expect(controller).to set_flash.now[:alert].to(s_('UpdateProject|Cannot rename project because it contains container registry tags!'))
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -645,7 +645,7 @@ describe ProjectsController do ...@@ -645,7 +645,7 @@ describe ProjectsController do
expect(project.namespace).to eq(old_namespace) expect(project.namespace).to eq(old_namespace)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(flash[:alert]).to eq 'Please select a new namespace for your project.' expect(flash[:alert]).to eq s_('TransferProject|Please select a new namespace for your project.')
end end
end end
end end
...@@ -797,7 +797,7 @@ describe ProjectsController do ...@@ -797,7 +797,7 @@ describe ProjectsController do
format: :js) format: :js)
expect(forked_project.reload.forked?).to be_falsey expect(forked_project.reload.forked?).to be_falsey
expect(flash[:notice]).to eq('The fork relationship has been removed.') expect(flash[:notice]).to eq(s_('The fork relationship has been removed.'))
expect(response).to render_template(:remove_fork) expect(response).to render_template(:remove_fork)
end end
end end
......
...@@ -136,13 +136,13 @@ describe RegistrationsController do ...@@ -136,13 +136,13 @@ describe RegistrationsController do
post(:create, params: user_params) post(:create, params: user_params)
expect(response).to render_template(:new) expect(response).to render_template(:new)
expect(flash[:alert]).to include 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.' expect(flash[:alert]).to eq(_('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.'))
end end
it 'redirects to the dashboard when the recaptcha is solved' do it 'redirects to the dashboard when the recaptcha is solved' do
post(:create, params: user_params) post(:create, params: user_params)
expect(flash[:notice]).to include 'Welcome! You have signed up successfully.' expect(flash[:notice]).to eq(I18n.t('devise.registrations.signed_up'))
end end
it 'does not require reCAPTCHA if disabled by feature flag' do it 'does not require reCAPTCHA if disabled by feature flag' do
...@@ -152,7 +152,7 @@ describe RegistrationsController do ...@@ -152,7 +152,7 @@ describe RegistrationsController do
expect(controller).not_to receive(:verify_recaptcha) expect(controller).not_to receive(:verify_recaptcha)
expect(flash[:alert]).to be_nil expect(flash[:alert]).to be_nil
expect(flash[:notice]).to include 'Welcome! You have signed up successfully.' expect(flash[:notice]).to eq(I18n.t('devise.registrations.signed_up'))
end end
end end
...@@ -220,7 +220,7 @@ describe RegistrationsController do ...@@ -220,7 +220,7 @@ describe RegistrationsController do
expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once
expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count) expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count)
expect(response).to redirect_to(new_user_session_path) expect(response).to redirect_to(new_user_session_path)
expect(flash[:alert]).to include 'That was a bit too quick! Please resubmit.' expect(flash[:alert]).to eq(I18n.t('invisible_captcha.timestamp_error_message'))
end end
end end
end end
...@@ -236,7 +236,7 @@ describe RegistrationsController do ...@@ -236,7 +236,7 @@ describe RegistrationsController do
expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once
expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count) expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count)
expect(response).to redirect_to(new_user_session_path) expect(response).to redirect_to(new_user_session_path)
expect(flash[:alert]).to include 'That was a bit too quick! Please resubmit.' expect(flash[:alert]).to eq(I18n.t('invisible_captcha.timestamp_error_message'))
end end
end end
end end
...@@ -251,7 +251,7 @@ describe RegistrationsController do ...@@ -251,7 +251,7 @@ describe RegistrationsController do
it 'redirects back with a notice when the checkbox was not checked' do it 'redirects back with a notice when the checkbox was not checked' do
post :create, params: user_params post :create, params: user_params
expect(flash[:alert]).to match /you must accept our terms/i expect(flash[:alert]).to eq(_('You must accept our Terms of Service and privacy policy in order to register an account'))
end end
it 'creates the user with agreement when terms are accepted' do it 'creates the user with agreement when terms are accepted' do
...@@ -322,15 +322,15 @@ describe RegistrationsController do ...@@ -322,15 +322,15 @@ describe RegistrationsController do
end end
def expect_password_failure def expect_password_failure
expect_failure('Invalid password') expect_failure(s_('Profiles|Invalid password'))
end end
def expect_username_failure def expect_username_failure
expect_failure('Invalid username') expect_failure(s_('Profiles|Invalid username'))
end end
def expect_success def expect_success
expect(flash[:notice]).to eq 'Account scheduled for removal.' expect(flash[:notice]).to eq s_('Profiles|Account scheduled for removal.')
expect(response.status).to eq(303) expect(response.status).to eq(303)
expect(response).to redirect_to new_user_session_path expect(response).to redirect_to new_user_session_path
end end
......
...@@ -49,7 +49,7 @@ describe IssuablesHelper do ...@@ -49,7 +49,7 @@ describe IssuablesHelper do
let(:label2_entity) { LabelEntity.represent(label2).as_json } let(:label2_entity) { LabelEntity.represent(label2).as_json }
it 'returns label text with no labels' do it 'returns label text with no labels' do
expect(issuable_labels_tooltip([])).to eq("Labels") expect(issuable_labels_tooltip([])).to eq(_('Labels'))
end end
it 'returns label text with labels within max limit' do it 'returns label text with labels within max limit' do
......
...@@ -131,7 +131,7 @@ describe LabelsHelper do ...@@ -131,7 +131,7 @@ describe LabelsHelper do
context 'with a group as subject' do context 'with a group as subject' do
it 'returns "Create group label"' do it 'returns "Create group label"' do
expect(create_label_title(group)).to eq 'Create group label' expect(create_label_title(group)).to eq _('Create group label')
end end
end end
...@@ -139,13 +139,13 @@ describe LabelsHelper do ...@@ -139,13 +139,13 @@ describe LabelsHelper do
set(:project) { create(:project, namespace: group) } set(:project) { create(:project, namespace: group) }
it 'returns "Create project label"' do it 'returns "Create project label"' do
expect(create_label_title(project)).to eq 'Create project label' expect(create_label_title(project)).to eq _('Create project label')
end end
end end
context 'with no subject' do context 'with no subject' do
it 'returns "Create new label"' do it 'returns "Create new label"' do
expect(create_label_title(nil)).to eq 'Create new label' expect(create_label_title(nil)).to eq _('Create new label')
end end
end end
end end
...@@ -155,7 +155,7 @@ describe LabelsHelper do ...@@ -155,7 +155,7 @@ describe LabelsHelper do
context 'with a group as subject' do context 'with a group as subject' do
it 'returns "Manage group labels"' do it 'returns "Manage group labels"' do
expect(manage_labels_title(group)).to eq 'Manage group labels' expect(manage_labels_title(group)).to eq _('Manage group labels')
end end
end end
...@@ -163,13 +163,13 @@ describe LabelsHelper do ...@@ -163,13 +163,13 @@ describe LabelsHelper do
set(:project) { create(:project, namespace: group) } set(:project) { create(:project, namespace: group) }
it 'returns "Manage project labels"' do it 'returns "Manage project labels"' do
expect(manage_labels_title(project)).to eq 'Manage project labels' expect(manage_labels_title(project)).to eq _('Manage project labels')
end end
end end
context 'with no subject' do context 'with no subject' do
it 'returns "Manage labels"' do it 'returns "Manage labels"' do
expect(manage_labels_title(nil)).to eq 'Manage labels' expect(manage_labels_title(nil)).to eq _('Manage labels')
end end
end end
end end
...@@ -179,7 +179,7 @@ describe LabelsHelper do ...@@ -179,7 +179,7 @@ describe LabelsHelper do
context 'with a group as subject' do context 'with a group as subject' do
it 'returns "View group labels"' do it 'returns "View group labels"' do
expect(view_labels_title(group)).to eq 'View group labels' expect(view_labels_title(group)).to eq _('View group labels')
end end
end end
...@@ -187,13 +187,13 @@ describe LabelsHelper do ...@@ -187,13 +187,13 @@ describe LabelsHelper do
set(:project) { create(:project, namespace: group) } set(:project) { create(:project, namespace: group) }
it 'returns "View project labels"' do it 'returns "View project labels"' do
expect(view_labels_title(project)).to eq 'View project labels' expect(view_labels_title(project)).to eq _('View project labels')
end end
end end
context 'with no subject' do context 'with no subject' do
it 'returns "View labels"' do it 'returns "View labels"' do
expect(view_labels_title(nil)).to eq 'View labels' expect(view_labels_title(nil)).to eq _('View labels')
end end
end end
end end
......
...@@ -59,29 +59,29 @@ describe VisibilityLevelHelper do ...@@ -59,29 +59,29 @@ describe VisibilityLevelHelper do
describe "#project_visibility_level_description" do describe "#project_visibility_level_description" do
it "describes private projects" do it "describes private projects" do
expect(project_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE)) expect(project_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE))
.to eq "Project access must be granted explicitly to each user." .to eq _('Project access must be granted explicitly to each user.')
end end
it "describes public projects" do it "describes public projects" do
expect(project_visibility_level_description(Gitlab::VisibilityLevel::PUBLIC)) expect(project_visibility_level_description(Gitlab::VisibilityLevel::PUBLIC))
.to eq "The project can be accessed without any authentication." .to eq _('The project can be accessed without any authentication.')
end end
end end
describe "#snippet_visibility_level_description" do describe "#snippet_visibility_level_description" do
it 'describes visibility only for me' do it 'describes visibility only for me' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, personal_snippet)) expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, personal_snippet))
.to eq "The snippet is visible only to me." .to eq _('The snippet is visible only to me.')
end end
it 'describes visibility for project members' do it 'describes visibility for project members' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, project_snippet)) expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, project_snippet))
.to eq "The snippet is visible only to project members." .to eq _('The snippet is visible only to project members.')
end end
it 'defaults to personal snippet' do it 'defaults to personal snippet' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE)) expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE))
.to eq "The snippet is visible only to me." .to eq _('The snippet is visible only to me.')
end end
end end
......
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
DIFF_VIEW_COOKIE_NAME, DIFF_VIEW_COOKIE_NAME,
INLINE_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE,
PARALLEL_DIFF_VIEW_TYPE, PARALLEL_DIFF_VIEW_TYPE,
DIFFS_PER_PAGE,
} from '~/diffs/constants'; } from '~/diffs/constants';
import actions, { import actions, {
setBaseConfig, setBaseConfig,
...@@ -144,10 +145,11 @@ describe('DiffsStoreActions', () => { ...@@ -144,10 +145,11 @@ describe('DiffsStoreActions', () => {
}); });
describe('fetchDiffFilesBatch', () => { describe('fetchDiffFilesBatch', () => {
it('should fetch batch diff files', done => { // eslint-disable-next-line jasmine/no-focused-tests
fit('should fetch batch diff files', done => {
const endpointBatch = '/fetch/diffs_batch'; const endpointBatch = '/fetch/diffs_batch';
const batch1 = `${endpointBatch}?per_page=10`; const batch1 = `${endpointBatch}?per_page=${DIFFS_PER_PAGE}`;
const batch2 = `${endpointBatch}?per_page=10&page=2`; const batch2 = `${endpointBatch}?per_page=${DIFFS_PER_PAGE}&page=2`;
const mock = new MockAdapter(axios); const mock = new MockAdapter(axios);
const res1 = { diff_files: [], pagination: { next_page: 2 } }; const res1 = { diff_files: [], pagination: { next_page: 2 } };
const res2 = { diff_files: [], pagination: {} }; const res2 = { diff_files: [], pagination: {} };
......
...@@ -43,6 +43,7 @@ describe API::Helpers::RelatedResourcesHelpers do ...@@ -43,6 +43,7 @@ describe API::Helpers::RelatedResourcesHelpers do
describe '#expose_url' do describe '#expose_url' do
let(:path) { '/api/v4/awesome_endpoint' } let(:path) { '/api/v4/awesome_endpoint' }
subject(:url) { helpers.expose_url(path) } subject(:url) { helpers.expose_url(path) }
def stub_default_url_options(protocol: 'http', host: 'example.com', port: nil, script_name: '') def stub_default_url_options(protocol: 'http', host: 'example.com', port: nil, script_name: '')
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Backup::Repository do describe Backup::Repository do
let(:progress) { StringIO.new } let(:progress) { StringIO.new }
let!(:project) { create(:project, :wiki_repo) } let!(:project) { create(:project, :wiki_repo) }
subject { described_class.new(progress) } subject { described_class.new(progress) }
before do before do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Backup::Uploads do describe Backup::Uploads do
let(:progress) { StringIO.new } let(:progress) { StringIO.new }
subject(:backup) { described_class.new(progress) } subject(:backup) { described_class.new(progress) }
describe '#initialize' do describe '#initialize' do
......
...@@ -96,21 +96,25 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -96,21 +96,25 @@ describe Banzai::Filter::RelativeLinkFilter do
context 'with a project_wiki' do context 'with a project_wiki' do
let(:project_wiki) { double('ProjectWiki') } let(:project_wiki) { double('ProjectWiki') }
include_examples :preserve_unchanged include_examples :preserve_unchanged
end end
context 'without a repository' do context 'without a repository' do
let(:project) { create(:project) } let(:project) { create(:project) }
include_examples :preserve_unchanged include_examples :preserve_unchanged
end end
context 'with an empty repository' do context 'with an empty repository' do
let(:project) { create(:project_empty_repo) } let(:project) { create(:project_empty_repo) }
include_examples :preserve_unchanged include_examples :preserve_unchanged
end end
context 'without project repository access' do context 'without project repository access' do
let(:project) { create(:project, :repository, repository_access_level: ProjectFeature::PRIVATE) } let(:project) { create(:project, :repository, repository_access_level: ProjectFeature::PRIVATE) }
include_examples :preserve_unchanged include_examples :preserve_unchanged
end end
...@@ -269,6 +273,7 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -269,6 +273,7 @@ describe Banzai::Filter::RelativeLinkFilter do
context 'when requested path is a file in the repo' do context 'when requested path is a file in the repo' do
let(:requested_path) { 'doc/api/README.md' } let(:requested_path) { 'doc/api/README.md' }
it 'rebuilds URL relative to the containing directory' do it 'rebuilds URL relative to the containing directory' do
doc = filter(link('users.md')) doc = filter(link('users.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md"
...@@ -277,6 +282,7 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -277,6 +282,7 @@ describe Banzai::Filter::RelativeLinkFilter do
context 'when requested path is a directory in the repo' do context 'when requested path is a directory in the repo' do
let(:requested_path) { 'doc/api/' } let(:requested_path) { 'doc/api/' }
it 'rebuilds URL relative to the directory' do it 'rebuilds URL relative to the directory' do
doc = filter(link('users.md')) doc = filter(link('users.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md"
...@@ -287,6 +293,7 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -287,6 +293,7 @@ describe Banzai::Filter::RelativeLinkFilter do
let(:ref) { '100%branch' } let(:ref) { '100%branch' }
let(:commit) { project.commit('1b12f15a11fc6e62177bef08f47bc7b5ce50b141') } let(:commit) { project.commit('1b12f15a11fc6e62177bef08f47bc7b5ce50b141') }
let(:requested_path) { 'foo/bar/' } let(:requested_path) { 'foo/bar/' }
it 'correctly escapes the ref' do it 'correctly escapes the ref' do
doc = filter(link('.gitkeep')) doc = filter(link('.gitkeep'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep" expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep"
...@@ -316,6 +323,7 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -316,6 +323,7 @@ describe Banzai::Filter::RelativeLinkFilter do
let(:ref) { 'master' } let(:ref) { 'master' }
let(:commit) { project.commit('38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e') } let(:commit) { project.commit('38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e') }
let(:requested_path) { 'with space/' } let(:requested_path) { 'with space/' }
it 'does not escape the space twice' do it 'does not escape the space twice' do
doc = filter(link('README.md')) doc = filter(link('README.md'))
expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md" expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md"
...@@ -328,7 +336,9 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -328,7 +336,9 @@ describe Banzai::Filter::RelativeLinkFilter do
end end
context 'with a valid ref' do context 'with a valid ref' do
let(:commit) { nil } # force filter to use ref instead of commit # force filter to use ref instead of commit
let(:commit) { nil }
include_examples :valid_repository include_examples :valid_repository
end end
......
...@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::IssueParser do ...@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::IssueParser do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:link) { empty_html_link } let(:link) { empty_html_link }
subject { described_class.new(Banzai::RenderContext.new(project, user)) } subject { described_class.new(Banzai::RenderContext.new(project, user)) }
describe '#nodes_visible_to_user' do describe '#nodes_visible_to_user' do
......
...@@ -200,6 +200,7 @@ describe Banzai::ReferenceParser::SnippetParser do ...@@ -200,6 +200,7 @@ describe Banzai::ReferenceParser::SnippetParser do
describe '#referenced_by' do describe '#referenced_by' do
let(:snippet) { create(:snippet, project: project) } let(:snippet) { create(:snippet, project: project) }
describe 'when the link has a data-snippet attribute' do describe 'when the link has a data-snippet attribute' do
context 'using an existing snippet ID' do context 'using an existing snippet ID' do
it 'returns an Array of snippets' do it 'returns an Array of snippets' do
......
...@@ -36,6 +36,7 @@ describe Banzai::ReferenceRedactor do ...@@ -36,6 +36,7 @@ describe Banzai::ReferenceRedactor do
context 'when data-original attribute provided' do context 'when data-original attribute provided' do
let(:original_content) { '<code>foo</code>' } let(:original_content) { '<code>foo</code>' }
it 'replaces redacted reference with original content' do it 'replaces redacted reference with original content' do
doc = Nokogiri::HTML.fragment("<a class='gfm' href='https://www.gitlab.com' data-reference-type='issue' data-original='#{original_content}'>bar</a>") doc = Nokogiri::HTML.fragment("<a class='gfm' href='https://www.gitlab.com' data-reference-type='issue' data-original='#{original_content}'>bar</a>")
redactor.redact([doc]) redactor.redact([doc])
......
...@@ -37,11 +37,13 @@ describe Constraints::ProjectUrlConstrainer do ...@@ -37,11 +37,13 @@ describe Constraints::ProjectUrlConstrainer do
context 'and is a GET request' do context 'and is a GET request' do
let(:request) { build_request(namespace.full_path, old_project_path) } let(:request) { build_request(namespace.full_path, old_project_path) }
it { expect(subject.matches?(request)).to be_truthy } it { expect(subject.matches?(request)).to be_truthy }
end end
context 'and is NOT a GET request' do context 'and is NOT a GET request' do
let(:request) { build_request(namespace.full_path, old_project_path, 'POST') } let(:request) { build_request(namespace.full_path, old_project_path, 'POST') }
it { expect(subject.matches?(request)).to be_falsey } it { expect(subject.matches?(request)).to be_falsey }
end end
end end
......
...@@ -24,11 +24,13 @@ describe Constraints::UserUrlConstrainer do ...@@ -24,11 +24,13 @@ describe Constraints::UserUrlConstrainer do
context 'and is a GET request' do context 'and is a GET request' do
let(:request) { build_request(redirect_route.path) } let(:request) { build_request(redirect_route.path) }
it { expect(subject.matches?(request)).to be_truthy } it { expect(subject.matches?(request)).to be_truthy }
end end
context 'and is NOT a GET request' do context 'and is NOT a GET request' do
let(:request) { build_request(redirect_route.path, 'POST') } let(:request) { build_request(redirect_route.path, 'POST') }
it { expect(subject.matches?(request)).to be_falsey } it { expect(subject.matches?(request)).to be_falsey }
end end
end end
......
...@@ -451,6 +451,7 @@ module Gitlab ...@@ -451,6 +451,7 @@ module Gitlab
context 'with path to a binary file' do context 'with path to a binary file' do
let(:blob) { fake_blob(path: 'dk.png', binary: true) } let(:blob) { fake_blob(path: 'dk.png', binary: true) }
include_examples :invalid_include include_examples :invalid_include
end end
...@@ -500,6 +501,7 @@ module Gitlab ...@@ -500,6 +501,7 @@ module Gitlab
context 'without a commit (only ref)' do context 'without a commit (only ref)' do
let(:commit) { nil } let(:commit) { nil }
include_examples :valid_include include_examples :valid_include
end end
end end
...@@ -511,6 +513,7 @@ module Gitlab ...@@ -511,6 +513,7 @@ module Gitlab
context 'without a commit (only ref)' do context 'without a commit (only ref)' do
let(:commit) { nil } let(:commit) { nil }
include_examples :valid_include include_examples :valid_include
end end
end end
......
...@@ -253,6 +253,7 @@ describe Gitlab::Auth::OAuth::User do ...@@ -253,6 +253,7 @@ describe Gitlab::Auth::OAuth::User do
context "and LDAP user has an account already" do context "and LDAP user has an account already" do
let!(:existing_user) { create(:omniauth_user, name: 'John Doe', email: 'john@example.com', extern_uid: dn, provider: 'ldapmain', username: 'john') } let!(:existing_user) { create(:omniauth_user, name: 'John Doe', email: 'john@example.com', extern_uid: dn, provider: 'ldapmain', username: 'john') }
it "adds the omniauth identity to the LDAP account" do it "adds the omniauth identity to the LDAP account" do
allow(Gitlab::Auth::LDAP::Person).to receive(:find_by_uid).and_return(ldap_user) allow(Gitlab::Auth::LDAP::Person).to receive(:find_by_uid).and_return(ldap_user)
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Auth, :use_clean_rails_memory_store_caching do describe Gitlab::Auth, :use_clean_rails_memory_store_caching do
let(:gl_auth) { described_class } let(:gl_auth) { described_class }
set(:project) { create(:project) } set(:project) { create(:project) }
describe 'constants' do describe 'constants' do
......
...@@ -10,6 +10,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr ...@@ -10,6 +10,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr
describe described_class::Storage::HashedProject do describe described_class::Storage::HashedProject do
let(:project) { double(id: 555) } let(:project) { double(id: 555) }
subject(:project_storage) { described_class.new(project) } subject(:project_storage) { described_class.new(project) }
it 'has the correct disk_path' do it 'has the correct disk_path' do
...@@ -19,6 +20,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr ...@@ -19,6 +20,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr
describe described_class::Storage::LegacyProject do describe described_class::Storage::LegacyProject do
let(:project) { double(full_path: 'this/is/the/full/path') } let(:project) { double(full_path: 'this/is/the/full/path') }
subject(:project_storage) { described_class.new(project) } subject(:project_storage) { described_class.new(project) }
it 'has the correct disk_path' do it 'has the correct disk_path' do
...@@ -28,6 +30,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr ...@@ -28,6 +30,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr
describe described_class::Project do describe described_class::Project do
let(:project_record) { projects.create!(namespace_id: subgroup.id, name: 'baz', path: 'baz') } let(:project_record) { projects.create!(namespace_id: subgroup.id, name: 'baz', path: 'baz') }
subject(:project) { described_class.find(project_record.id) } subject(:project) { described_class.find(project_record.id) }
describe '#full_path' do describe '#full_path' do
......
...@@ -49,6 +49,7 @@ describe Gitlab::BranchPushMergeCommitAnalyzer do ...@@ -49,6 +49,7 @@ describe Gitlab::BranchPushMergeCommitAnalyzer do
context 'when relevant_commit_ids is provided' do context 'when relevant_commit_ids is provided' do
let(:relevant_commit_id) { '8a994512e8c8f0dfcf22bb16df6e876be7a61036' } let(:relevant_commit_id) { '8a994512e8c8f0dfcf22bb16df6e876be7a61036' }
subject { described_class.new(commits, relevant_commit_ids: [relevant_commit_id]) } subject { described_class.new(commits, relevant_commit_ids: [relevant_commit_id]) }
it 'returns correct merge commit' do it 'returns correct merge commit' do
......
...@@ -152,6 +152,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do ...@@ -152,6 +152,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe '#blob' do describe '#blob' do
let(:file_entry) { |example| path(example) } let(:file_entry) { |example| path(example) }
subject { file_entry.blob } subject { file_entry.blob }
it 'returns a blob representing the entry data' do it 'returns a blob representing the entry data' do
......
...@@ -31,10 +31,10 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -31,10 +31,10 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'passed' expect(status.text).to eq s_('CiStatusText|passed')
expect(status.icon).to eq 'status_success' expect(status.icon).to eq 'status_success'
expect(status.favicon).to eq 'favicon_status_success' expect(status.favicon).to eq 'favicon_status_success'
expect(status.label).to eq 'passed' expect(status.label).to eq s_('CiStatusLabel|passed')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -58,10 +58,10 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -58,10 +58,10 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'passed' expect(status.text).to eq s_('CiStatusText|passed')
expect(status.icon).to eq 'status_success' expect(status.icon).to eq 'status_success'
expect(status.favicon).to eq 'favicon_status_success' expect(status.favicon).to eq 'favicon_status_success'
expect(status.label).to eq 'passed' expect(status.label).to eq s_('CiStatusLabel|passed')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -86,11 +86,11 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -86,11 +86,11 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'failed' expect(status.text).to eq s_('CiStatusText|failed')
expect(status.icon).to eq 'status_failed' expect(status.icon).to eq 'status_failed'
expect(status.favicon).to eq 'favicon_status_failed' expect(status.favicon).to eq 'favicon_status_failed'
expect(status.label).to eq 'failed' expect(status.label).to eq s_('CiStatusLabel|failed')
expect(status.status_tooltip).to eq 'failed - (unknown failure)' expect(status.status_tooltip).to eq "#{s_('CiStatusText|failed')} - (unknown failure)"
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -115,7 +115,7 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -115,7 +115,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'failed' expect(status.text).to eq s_('CiStatusText|failed')
expect(status.icon).to eq 'status_warning' expect(status.icon).to eq 'status_warning'
expect(status.favicon).to eq 'favicon_status_failed' expect(status.favicon).to eq 'favicon_status_failed'
expect(status.label).to eq 'failed (allowed to fail)' expect(status.label).to eq 'failed (allowed to fail)'
...@@ -144,10 +144,10 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -144,10 +144,10 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'failed' expect(status.text).to eq s_('CiStatusText|failed')
expect(status.icon).to eq 'status_failed' expect(status.icon).to eq 'status_failed'
expect(status.favicon).to eq 'favicon_status_failed' expect(status.favicon).to eq 'favicon_status_failed'
expect(status.label).to eq 'failed' expect(status.label).to eq s_('CiStatusLabel|failed')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
expect(status.action_title).to include 'Retry' expect(status.action_title).to include 'Retry'
...@@ -173,11 +173,11 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -173,11 +173,11 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'canceled' expect(status.text).to eq s_('CiStatusText|canceled')
expect(status.icon).to eq 'status_canceled' expect(status.icon).to eq 'status_canceled'
expect(status.favicon).to eq 'favicon_status_canceled' expect(status.favicon).to eq 'favicon_status_canceled'
expect(status.illustration).to include(:image, :size, :title) expect(status.illustration).to include(:image, :size, :title)
expect(status.label).to eq 'canceled' expect(status.label).to eq s_('CiStatusLabel|canceled')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -200,10 +200,10 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -200,10 +200,10 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'running' expect(status.text).to eq s_('CiStatus|running')
expect(status.icon).to eq 'status_running' expect(status.icon).to eq 'status_running'
expect(status.favicon).to eq 'favicon_status_running' expect(status.favicon).to eq 'favicon_status_running'
expect(status.label).to eq 'running' expect(status.label).to eq s_('CiStatus|running')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -226,11 +226,11 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -226,11 +226,11 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'pending' expect(status.text).to eq s_('CiStatusText|pending')
expect(status.icon).to eq 'status_pending' expect(status.icon).to eq 'status_pending'
expect(status.favicon).to eq 'favicon_status_pending' expect(status.favicon).to eq 'favicon_status_pending'
expect(status.illustration).to include(:image, :size, :title, :content) expect(status.illustration).to include(:image, :size, :title, :content)
expect(status.label).to eq 'pending' expect(status.label).to eq s_('CiStatusLabel|pending')
expect(status).to have_details expect(status).to have_details
expect(status).to have_action expect(status).to have_action
end end
...@@ -252,11 +252,11 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -252,11 +252,11 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'skipped' expect(status.text).to eq s_('CiStatusText|skipped')
expect(status.icon).to eq 'status_skipped' expect(status.icon).to eq 'status_skipped'
expect(status.favicon).to eq 'favicon_status_skipped' expect(status.favicon).to eq 'favicon_status_skipped'
expect(status.illustration).to include(:image, :size, :title) expect(status.illustration).to include(:image, :size, :title)
expect(status.label).to eq 'skipped' expect(status.label).to eq s_('CiStatusLabel|skipped')
expect(status).to have_details expect(status).to have_details
expect(status).not_to have_action expect(status).not_to have_action
end end
...@@ -282,7 +282,7 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -282,7 +282,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'manual' expect(status.text).to eq s_('CiStatusText|manual')
expect(status.group).to eq 'manual' expect(status.group).to eq 'manual'
expect(status.icon).to eq 'status_manual' expect(status.icon).to eq 'status_manual'
expect(status.favicon).to eq 'favicon_status_manual' expect(status.favicon).to eq 'favicon_status_manual'
...@@ -339,7 +339,7 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -339,7 +339,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'manual' expect(status.text).to eq s_('CiStatusText|manual')
expect(status.group).to eq 'manual' expect(status.group).to eq 'manual'
expect(status.icon).to eq 'status_manual' expect(status.icon).to eq 'status_manual'
expect(status.favicon).to eq 'favicon_status_manual' expect(status.favicon).to eq 'favicon_status_manual'
...@@ -370,7 +370,7 @@ describe Gitlab::Ci::Status::Build::Factory do ...@@ -370,7 +370,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end end
it 'fabricates status with correct details' do it 'fabricates status with correct details' do
expect(status.text).to eq 'delayed' expect(status.text).to eq s_('CiStatusText|delayed')
expect(status.group).to eq 'scheduled' expect(status.group).to eq 'scheduled'
expect(status.icon).to eq 'status_scheduled' expect(status.icon).to eq 'status_scheduled'
expect(status.favicon).to eq 'favicon_status_scheduled' expect(status.favicon).to eq 'favicon_status_scheduled'
......
...@@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Blocked do ...@@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Blocked do
describe '.matches?' do describe '.matches?' do
let(:user) { double('user') } let(:user) { double('user') }
subject { described_class.matches?(pipeline, user) } subject { described_class.matches?(pipeline, user) }
context 'when pipeline is blocked' do context 'when pipeline is blocked' do
......
...@@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Delayed do ...@@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Delayed do
describe '.matches?' do describe '.matches?' do
let(:user) { double('user') } let(:user) { double('user') }
subject { described_class.matches?(pipeline, user) } subject { described_class.matches?(pipeline, user) }
context 'when pipeline is scheduled' do context 'when pipeline is scheduled' do
......
...@@ -21,6 +21,7 @@ describe Gitlab::Ci::Trace::SectionParser do ...@@ -21,6 +21,7 @@ describe Gitlab::Ci::Trace::SectionParser do
end end
let(:lines) { build_lines('') } let(:lines) { build_lines('') }
subject { described_class.new(lines) } subject { described_class.new(lines) }
describe '#sections' do describe '#sections' do
......
...@@ -1723,6 +1723,7 @@ module Gitlab ...@@ -1723,6 +1723,7 @@ module Gitlab
describe "Hidden jobs" do describe "Hidden jobs" do
let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) } let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) }
subject { config_processor.stage_builds_attributes("test") } subject { config_processor.stage_builds_attributes("test") }
shared_examples 'hidden_job_handling' do shared_examples 'hidden_job_handling' do
...@@ -1767,6 +1768,7 @@ module Gitlab ...@@ -1767,6 +1768,7 @@ module Gitlab
describe "YAML Alias/Anchor" do describe "YAML Alias/Anchor" do
let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) } let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) }
subject { config_processor.stage_builds_attributes("build") } subject { config_processor.stage_builds_attributes("build") }
shared_examples 'job_templates_handling' do shared_examples 'job_templates_handling' do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Cleanup::OrphanJobArtifactFiles do describe Gitlab::Cleanup::OrphanJobArtifactFiles do
let(:null_logger) { Logger.new('/dev/null') } let(:null_logger) { Logger.new('/dev/null') }
subject(:cleanup) { described_class.new(logger: null_logger) } subject(:cleanup) { described_class.new(logger: null_logger) }
before do before do
......
...@@ -83,6 +83,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete ...@@ -83,6 +83,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete
describe '#rename_path_for_routable' do describe '#rename_path_for_routable' do
context 'for namespaces' do context 'for namespaces' do
let(:namespace) { create(:namespace, path: 'the-path') } let(:namespace) { create(:namespace, path: 'the-path') }
it "renames namespaces called the-path" do it "renames namespaces called the-path" do
subject.rename_path_for_routable(migration_namespace(namespace)) subject.rename_path_for_routable(migration_namespace(namespace))
...@@ -159,6 +160,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete ...@@ -159,6 +160,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete
describe '#perform_rename' do describe '#perform_rename' do
describe 'for namespaces' do describe 'for namespaces' do
let(:namespace) { create(:namespace, path: 'the-path') } let(:namespace) { create(:namespace, path: 'the-path') }
it 'renames the path' do it 'renames the path' do
subject.perform_rename(migration_namespace(namespace), 'the-path', 'renamed') subject.perform_rename(migration_namespace(namespace), 'the-path', 'renamed')
......
...@@ -95,6 +95,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, : ...@@ -95,6 +95,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :
describe '#move_repositories' do describe '#move_repositories' do
let(:namespace) { create(:group, name: 'hello-group') } let(:namespace) { create(:group, name: 'hello-group') }
it 'moves a project for a namespace' do it 'moves a project for a namespace' do
create(:project, :repository, :legacy_storage, namespace: namespace, path: 'hello-project') create(:project, :repository, :legacy_storage, namespace: namespace, path: 'hello-project')
expected_path = File.join(TestEnv.repos_path, 'bye-group', 'hello-project.git') expected_path = File.join(TestEnv.repos_path, 'bye-group', 'hello-project.git')
......
...@@ -7,6 +7,7 @@ describe Gitlab::Diff::DiffRefs do ...@@ -7,6 +7,7 @@ describe Gitlab::Diff::DiffRefs do
describe '#==' do describe '#==' do
let(:commit) { project.commit('1a0b36b3cdad1d2ee32457c102a8c0b7056fa863') } let(:commit) { project.commit('1a0b36b3cdad1d2ee32457c102a8c0b7056fa863') }
subject { commit.diff_refs } subject { commit.diff_refs }
context 'when shas are missing' do context 'when shas are missing' do
...@@ -63,6 +64,7 @@ describe Gitlab::Diff::DiffRefs do ...@@ -63,6 +64,7 @@ describe Gitlab::Diff::DiffRefs do
describe '#compare_in' do describe '#compare_in' do
context 'with diff refs for the initial commit' do context 'with diff refs for the initial commit' do
let(:commit) { project.commit('1a0b36b3cdad1d2ee32457c102a8c0b7056fa863') } let(:commit) { project.commit('1a0b36b3cdad1d2ee32457c102a8c0b7056fa863') }
subject { commit.diff_refs } subject { commit.diff_refs }
it 'returns an appropriate comparison' do it 'returns an appropriate comparison' do
...@@ -74,6 +76,7 @@ describe Gitlab::Diff::DiffRefs do ...@@ -74,6 +76,7 @@ describe Gitlab::Diff::DiffRefs do
context 'with diff refs for a commit' do context 'with diff refs for a commit' do
let(:commit) { project.commit('6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') } let(:commit) { project.commit('6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') }
subject { commit.diff_refs } subject { commit.diff_refs }
it 'returns an appropriate comparison' do it 'returns an appropriate comparison' do
......
...@@ -11,6 +11,7 @@ describe Gitlab::Diff::LineMapper do ...@@ -11,6 +11,7 @@ describe Gitlab::Diff::LineMapper do
let(:diffs) { commit.raw_diffs } let(:diffs) { commit.raw_diffs }
let(:diff) { diffs.first } let(:diff) { diffs.first }
let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: repository) } let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: repository) }
subject { described_class.new(diff_file) } subject { described_class.new(diff_file) }
describe '#old_to_new' do describe '#old_to_new' do
......
...@@ -11,6 +11,7 @@ describe Gitlab::Diff::ParallelDiff do ...@@ -11,6 +11,7 @@ describe Gitlab::Diff::ParallelDiff do
let(:diffs) { commit.raw_diffs } let(:diffs) { commit.raw_diffs }
let(:diff) { diffs.first } let(:diff) { diffs.first }
let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: repository) } let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: repository) }
subject { described_class.new(diff_file) } subject { described_class.new(diff_file) }
describe '#parallelize' do describe '#parallelize' do
......
...@@ -191,6 +191,7 @@ describe Gitlab::Email::Handler::CreateMergeRequestHandler do ...@@ -191,6 +191,7 @@ describe Gitlab::Email::Handler::CreateMergeRequestHandler do
describe '#patch_attachments' do describe '#patch_attachments' do
let(:email_raw) { email_fixture('emails/merge_request_multiple_patches.eml') } let(:email_raw) { email_fixture('emails/merge_request_multiple_patches.eml') }
let(:mail) { Mail::Message.new(email_raw) } let(:mail) { Mail::Message.new(email_raw) }
subject(:handler) { described_class.new(mail, mail_key) } subject(:handler) { described_class.new(mail, mail_key) }
it 'orders attachments ending in `.patch` by name' do it 'orders attachments ending in `.patch` by name' do
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::ExternalAuthorization::Client do describe Gitlab::ExternalAuthorization::Client do
let(:user) { build(:user, email: 'dummy_user@example.com') } let(:user) { build(:user, email: 'dummy_user@example.com') }
let(:dummy_url) { 'https://dummy.net/' } let(:dummy_url) { 'https://dummy.net/' }
subject(:client) { described_class.new(user, 'dummy_label') } subject(:client) { described_class.new(user, 'dummy_label') }
before do before do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::ExternalAuthorization::Response do describe Gitlab::ExternalAuthorization::Response do
let(:excon_response) { double } let(:excon_response) { double }
subject(:response) { described_class.new(excon_response) } subject(:response) { described_class.new(excon_response) }
describe '#valid?' do describe '#valid?' do
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::FileFinder do describe Gitlab::FileFinder do
describe '#find' do describe '#find' do
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
subject { described_class.new(project, project.default_branch) } subject { described_class.new(project, project.default_branch) }
it_behaves_like 'file finder' do it_behaves_like 'file finder' do
......
...@@ -54,11 +54,13 @@ describe Gitlab::Gfm::ReferenceRewriter do ...@@ -54,11 +54,13 @@ describe Gitlab::Gfm::ReferenceRewriter do
context 'code' do context 'code' do
let(:text) { "#1, but not `[#1]`" } let(:text) { "#1, but not `[#1]`" }
it { is_expected.to eq "#{issue_first.to_reference(new_project)}, but not `[#1]`" } it { is_expected.to eq "#{issue_first.to_reference(new_project)}, but not `[#1]`" }
end end
context 'code reverse' do context 'code reverse' do
let(:text) { "not `#1`, but #1" } let(:text) { "not `#1`, but #1" }
it { is_expected.to eq "not `#1`, but #{issue_first.to_reference(new_project)}" } it { is_expected.to eq "not `#1`, but #{issue_first.to_reference(new_project)}" }
end end
...@@ -74,11 +76,13 @@ describe Gitlab::Gfm::ReferenceRewriter do ...@@ -74,11 +76,13 @@ describe Gitlab::Gfm::ReferenceRewriter do
context 'label referenced by id' do context 'label referenced by id' do
let(:text) { '#1 and ~123' } let(:text) { '#1 and ~123' }
it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~123} } it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~123} }
end end
context 'label referenced by text' do context 'label referenced by text' do
let(:text) { '#1 and ~"test"' } let(:text) { '#1 and ~"test"' }
it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~123} } it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~123} }
end end
end end
...@@ -93,11 +97,13 @@ describe Gitlab::Gfm::ReferenceRewriter do ...@@ -93,11 +97,13 @@ describe Gitlab::Gfm::ReferenceRewriter do
context 'label referenced by id' do context 'label referenced by id' do
let(:text) { '#1 and ~321' } let(:text) { '#1 and ~321' }
it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~321} } it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~321} }
end end
context 'label referenced by text' do context 'label referenced by text' do
let(:text) { '#1 and ~"group label"' } let(:text) { '#1 and ~"group label"' }
it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~321} } it { is_expected.to eq %Q{#{old_project_ref}#1 and #{old_project_ref}~321} }
end end
end end
......
...@@ -542,6 +542,7 @@ describe Gitlab::Git::Commit, :seed_helper do ...@@ -542,6 +542,7 @@ describe Gitlab::Git::Commit, :seed_helper do
skip 'move this test to gitaly-ruby' do skip 'move this test to gitaly-ruby' do
describe '#init_from_rugged' do describe '#init_from_rugged' do
let(:gitlab_commit) { described_class.new(repository, rugged_commit) } let(:gitlab_commit) { described_class.new(repository, rugged_commit) }
subject { gitlab_commit } subject { gitlab_commit }
describe '#id' do describe '#id' do
...@@ -553,6 +554,7 @@ describe Gitlab::Git::Commit, :seed_helper do ...@@ -553,6 +554,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe '#init_from_hash' do describe '#init_from_hash' do
let(:commit) { described_class.new(repository, sample_commit_hash) } let(:commit) { described_class.new(repository, sample_commit_hash) }
subject { commit } subject { commit }
describe '#id' do describe '#id' do
...@@ -608,6 +610,7 @@ describe Gitlab::Git::Commit, :seed_helper do ...@@ -608,6 +610,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe '#to_hash' do describe '#to_hash' do
let(:hash) { commit.to_hash } let(:hash) { commit.to_hash }
subject { hash } subject { hash }
it { is_expected.to be_kind_of Hash } it { is_expected.to be_kind_of Hash }
...@@ -629,6 +632,7 @@ describe Gitlab::Git::Commit, :seed_helper do ...@@ -629,6 +632,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe '#ref_names' do describe '#ref_names' do
let(:commit) { described_class.find(repository, 'master') } let(:commit) { described_class.find(repository, 'master') }
subject { commit.ref_names(repository) } subject { commit.ref_names(repository) }
it 'has 2 element' do it 'has 2 element' do
......
...@@ -149,6 +149,7 @@ EOT ...@@ -149,6 +149,7 @@ EOT
describe '.between' do describe '.between' do
let(:diffs) { described_class.between(repository, 'feature', 'master') } let(:diffs) { described_class.between(repository, 'feature', 'master') }
subject { diffs } subject { diffs }
it { is_expected.to be_kind_of Gitlab::Git::DiffCollection } it { is_expected.to be_kind_of Gitlab::Git::DiffCollection }
......
...@@ -57,6 +57,7 @@ describe Gitlab::Git::HookEnv do ...@@ -57,6 +57,7 @@ describe Gitlab::Git::HookEnv do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:key) { 'GIT_OBJECT_DIRECTORY_RELATIVE' } let(:key) { 'GIT_OBJECT_DIRECTORY_RELATIVE' }
subject { described_class.to_env_hash(gl_repository) } subject { described_class.to_env_hash(gl_repository) }
where(:input, :output) do where(:input, :output) do
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::Git::MergeBase do describe Gitlab::Git::MergeBase do
set(:project) { create(:project, :repository) } set(:project) { create(:project, :repository) }
let(:repository) { project.repository } let(:repository) { project.repository }
subject(:merge_base) { described_class.new(repository, refs) } subject(:merge_base) { described_class.new(repository, refs) }
shared_context 'existing refs with a merge base', :existing_refs do shared_context 'existing refs with a merge base', :existing_refs do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Git::RemoteRepository, :seed_helper do describe Gitlab::Git::RemoteRepository, :seed_helper do
let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') }
subject { described_class.new(repository) } subject { described_class.new(repository) }
describe '#empty?' do describe '#empty?' do
......
...@@ -212,6 +212,7 @@ describe Gitlab::Git::Repository, :seed_helper do ...@@ -212,6 +212,7 @@ describe Gitlab::Git::Repository, :seed_helper do
describe '#ref_names' do describe '#ref_names' do
let(:ref_names) { repository.ref_names } let(:ref_names) { repository.ref_names }
subject { ref_names } subject { ref_names }
it { is_expected.to be_kind_of Array } it { is_expected.to be_kind_of Array }
......
...@@ -26,6 +26,7 @@ describe Gitlab::Git::User do ...@@ -26,6 +26,7 @@ describe Gitlab::Git::User do
describe '.from_gitlab' do describe '.from_gitlab' do
context 'when no commit_email has been set' do context 'when no commit_email has been set' do
let(:user) { build(:user, email: 'alice@example.com', commit_email: nil) } let(:user) { build(:user, email: 'alice@example.com', commit_email: nil) }
subject { described_class.from_gitlab(user) } subject { described_class.from_gitlab(user) }
it { expect(subject).to eq(described_class.new(user.username, user.name, user.email, 'user-')) } it { expect(subject).to eq(described_class.new(user.username, user.name, user.email, 'user-')) }
...@@ -33,6 +34,7 @@ describe Gitlab::Git::User do ...@@ -33,6 +34,7 @@ describe Gitlab::Git::User do
context 'when commit_email has been set' do context 'when commit_email has been set' do
let(:user) { build(:user, email: 'alice@example.com', commit_email: 'bob@example.com') } let(:user) { build(:user, email: 'alice@example.com', commit_email: 'bob@example.com') }
subject { described_class.from_gitlab(user) } subject { described_class.from_gitlab(user) }
it { expect(subject).to eq(described_class.new(user.username, user.name, user.commit_email, 'user-')) } it { expect(subject).to eq(described_class.new(user.username, user.name, user.commit_email, 'user-')) }
......
...@@ -188,6 +188,7 @@ describe Gitlab::GitalyClient::CommitService do ...@@ -188,6 +188,7 @@ describe Gitlab::GitalyClient::CommitService do
describe '#find_commit' do describe '#find_commit' do
let(:revision) { Gitlab::Git::EMPTY_TREE_ID } let(:revision) { Gitlab::Git::EMPTY_TREE_ID }
it 'sends an RPC request' do it 'sends an RPC request' do
request = Gitaly::FindCommitRequest.new( request = Gitaly::FindCommitRequest.new(
repository: repository_message, revision: revision repository: repository_message, revision: revision
......
...@@ -22,6 +22,7 @@ describe Gitlab::GitalyClient::RefService do ...@@ -22,6 +22,7 @@ describe Gitlab::GitalyClient::RefService do
describe '#remote_branches' do describe '#remote_branches' do
let(:remote_name) { 'my_remote' } let(:remote_name) { 'my_remote' }
subject { client.remote_branches(remote_name) } subject { client.remote_branches(remote_name) }
it 'sends a find_all_remote_branches message' do it 'sends a find_all_remote_branches message' do
......
...@@ -4,6 +4,7 @@ require "spec_helper" ...@@ -4,6 +4,7 @@ require "spec_helper"
describe Gitlab::GoogleCodeImport::Client do describe Gitlab::GoogleCodeImport::Client do
let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) } let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
subject { described_class.new(raw_data) } subject { described_class.new(raw_data) }
describe "#valid?" do describe "#valid?" do
......
...@@ -25,6 +25,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeFieldService do ...@@ -25,6 +25,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeFieldService do
end end
let(:current_user) { double(:current_user) } let(:current_user) { double(:current_user) }
subject(:service) { described_class.new(field) } subject(:service) { described_class.new(field) }
describe '#authorized_resolve' do describe '#authorized_resolve' do
...@@ -34,6 +35,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeFieldService do ...@@ -34,6 +35,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeFieldService do
let(:schema) { GraphQL::Schema.define(query: query_type, mutation: nil)} let(:schema) { GraphQL::Schema.define(query: query_type, mutation: nil)}
let(:query_context) { OpenStruct.new(schema: schema) } let(:query_context) { OpenStruct.new(schema: schema) }
let(:context) { GraphQL::Query::Context.new(query: OpenStruct.new(schema: schema, context: query_context), values: { current_user: current_user }, object: nil) } let(:context) { GraphQL::Query::Context.new(query: OpenStruct.new(schema: schema, context: query_context), values: { current_user: current_user }, object: nil) }
subject(:resolved) { service.authorized_resolve.call(presented_type, {}, context) } subject(:resolved) { service.authorized_resolve.call(presented_type, {}, context) }
context 'scalar types' do context 'scalar types' do
......
...@@ -27,6 +27,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeResource do ...@@ -27,6 +27,7 @@ describe Gitlab::Graphql::Authorize::AuthorizeResource do
let(:user) { build(:user) } let(:user) { build(:user) }
let(:project) { build(:project) } let(:project) { build(:project) }
subject(:loading_resource) { fake_class.new(user, project) } subject(:loading_resource) { fake_class.new(user, project) }
context 'when the user is allowed to perform the action' do context 'when the user is allowed to perform the action' do
......
...@@ -6,6 +6,7 @@ describe Gitlab::Graphql::Connections::FilterableArrayConnection do ...@@ -6,6 +6,7 @@ describe Gitlab::Graphql::Connections::FilterableArrayConnection do
let(:callback) { proc { |nodes| nodes } } let(:callback) { proc { |nodes| nodes } }
let(:all_nodes) { Gitlab::Graphql::FilterableArray.new(callback, 1, 2, 3, 4, 5) } let(:all_nodes) { Gitlab::Graphql::FilterableArray.new(callback, 1, 2, 3, 4, 5) }
let(:arguments) { {} } let(:arguments) { {} }
subject(:connection) do subject(:connection) do
described_class.new(all_nodes, arguments, max_page_size: 3) described_class.new(all_nodes, arguments, max_page_size: 3)
end end
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::Graphql::Connections::Keyset::Connection do describe Gitlab::Graphql::Connections::Keyset::Connection do
let(:nodes) { Project.all.order(id: :asc) } let(:nodes) { Project.all.order(id: :asc) }
let(:arguments) { {} } let(:arguments) { {} }
subject(:connection) do subject(:connection) do
described_class.new(nodes, arguments, max_page_size: 3) described_class.new(nodes, arguments, max_page_size: 3)
end end
......
...@@ -15,6 +15,7 @@ describe Gitlab::HookData::BaseBuilder do ...@@ -15,6 +15,7 @@ describe Gitlab::HookData::BaseBuilder do
context 'with an upload prefix specified' do context 'with an upload prefix specified' do
let(:project_with_path) { double(full_path: 'baz/bar') } let(:project_with_path) { double(full_path: 'baz/bar') }
let(:object_with_project) { double(project: project_with_path) } let(:object_with_project) { double(project: project_with_path) }
subject { subclass.new(object_with_project) } subject { subclass.new(object_with_project) }
where do where do
......
...@@ -136,6 +136,7 @@ describe Gitlab::I18n::TranslationEntry do ...@@ -136,6 +136,7 @@ describe Gitlab::I18n::TranslationEntry do
describe '#contains_unescaped_chars' do describe '#contains_unescaped_chars' do
let(:data) { { msgid: '' } } let(:data) { { msgid: '' } }
let(:entry) { described_class.new(data, 2) } let(:entry) { described_class.new(data, 2) }
it 'is true when the msgid is an array' do it 'is true when the msgid is an array' do
string = '「100%確定」' string = '「100%確定」'
......
...@@ -9,6 +9,7 @@ describe Gitlab::ImportExport::LfsRestorer do ...@@ -9,6 +9,7 @@ describe Gitlab::ImportExport::LfsRestorer do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:shared) { project.import_export_shared } let(:shared) { project.import_export_shared }
let(:saver) { Gitlab::ImportExport::LfsSaver.new(project: project, shared: shared) } let(:saver) { Gitlab::ImportExport::LfsSaver.new(project: project, shared: shared) }
subject(:restorer) { described_class.new(project: project, shared: shared) } subject(:restorer) { described_class.new(project: project, shared: shared) }
before do before do
......
...@@ -7,6 +7,7 @@ describe Gitlab::ImportExport::Saver do ...@@ -7,6 +7,7 @@ describe Gitlab::ImportExport::Saver do
let!(:project) { create(:project, :public, name: 'project') } let!(:project) { create(:project, :public, name: 'project') }
let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
let(:shared) { project.import_export_shared } let(:shared) { project.import_export_shared }
subject { described_class.new(exportable: project, shared: shared) } subject { described_class.new(exportable: project, shared: shared) }
before do before do
......
...@@ -5,6 +5,7 @@ require 'fileutils' ...@@ -5,6 +5,7 @@ require 'fileutils'
describe Gitlab::ImportExport::Shared do describe Gitlab::ImportExport::Shared do
let(:project) { build(:project) } let(:project) { build(:project) }
subject { project.import_export_shared } subject { project.import_export_shared }
context 'with a repository on disk' do context 'with a repository on disk' do
......
...@@ -7,6 +7,7 @@ describe Gitlab::JsonCache do ...@@ -7,6 +7,7 @@ describe Gitlab::JsonCache do
let(:namespace) { 'geo' } let(:namespace) { 'geo' }
let(:key) { 'foo' } let(:key) { 'foo' }
let(:expanded_key) { "#{namespace}:#{key}:#{Gitlab::VERSION}:#{Rails.version}" } let(:expanded_key) { "#{namespace}:#{key}:#{Gitlab::VERSION}:#{Rails.version}" }
set(:broadcast_message) { create(:broadcast_message) } set(:broadcast_message) { create(:broadcast_message) }
subject(:cache) { described_class.new(namespace: namespace, backend: backend) } subject(:cache) { described_class.new(namespace: namespace, backend: backend) }
......
...@@ -18,6 +18,7 @@ describe Gitlab::Kubernetes::ConfigMap do ...@@ -18,6 +18,7 @@ describe Gitlab::Kubernetes::ConfigMap do
describe '#generate' do describe '#generate' do
let(:resource) { ::Kubeclient::Resource.new(metadata: metadata, data: application.files) } let(:resource) { ::Kubeclient::Resource.new(metadata: metadata, data: application.files) }
subject { config_map.generate } subject { config_map.generate }
it 'builds a Kubeclient Resource' do it 'builds a Kubeclient Resource' do
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::Kubernetes::Namespace do describe Gitlab::Kubernetes::Namespace do
let(:name) { 'a_namespace' } let(:name) { 'a_namespace' }
let(:client) { double('kubernetes client') } let(:client) { double('kubernetes client') }
subject { described_class.new(name, client) } subject { described_class.new(name, client) }
it { expect(subject.name).to eq(name) } it { expect(subject.name).to eq(name) }
......
...@@ -27,6 +27,7 @@ describe Gitlab::Kubernetes do ...@@ -27,6 +27,7 @@ describe Gitlab::Kubernetes do
context 'with a path prefix in the API URL' do context 'with a path prefix in the API URL' do
let(:api_url) { 'https://example.com/prefix/' } let(:api_url) { 'https://example.com/prefix/' }
it { expect(result.path).to eq('/prefix/api/v1/namespaces/default/pods/pod1/exec') } it { expect(result.path).to eq('/prefix/api/v1/namespaces/default/pods/pod1/exec') }
end end
......
...@@ -265,6 +265,7 @@ describe Gitlab::LegacyGithubImport::Importer do ...@@ -265,6 +265,7 @@ describe Gitlab::LegacyGithubImport::Importer do
context 'when importing a GitHub project' do context 'when importing a GitHub project' do
let(:api_root) { 'https://api.github.com' } let(:api_root) { 'https://api.github.com' }
let(:repo_root) { 'https://github.com' } let(:repo_root) { 'https://github.com' }
subject { described_class.new(project) } subject { described_class.new(project) }
it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute' it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute'
...@@ -287,6 +288,7 @@ describe Gitlab::LegacyGithubImport::Importer do ...@@ -287,6 +288,7 @@ describe Gitlab::LegacyGithubImport::Importer do
context 'when importing a Gitea project' do context 'when importing a Gitea project' do
let(:api_root) { 'https://try.gitea.io/api/v1' } let(:api_root) { 'https://try.gitea.io/api/v1' }
let(:repo_root) { 'https://try.gitea.io' } let(:repo_root) { 'https://try.gitea.io' }
subject { described_class.new(project) } subject { described_class.new(project) }
before do before do
......
...@@ -89,6 +89,7 @@ describe Gitlab::LegacyGithubImport::MilestoneFormatter do ...@@ -89,6 +89,7 @@ describe Gitlab::LegacyGithubImport::MilestoneFormatter do
context 'when importing a Gitea project' do context 'when importing a Gitea project' do
let(:iid_attr) { :id } let(:iid_attr) { :id }
before do before do
project.update(import_type: 'gitea') project.update(import_type: 'gitea')
end end
......
...@@ -86,6 +86,7 @@ describe ::Gitlab::LetsEncrypt::Client do ...@@ -86,6 +86,7 @@ describe ::Gitlab::LetsEncrypt::Client do
describe '#load_order' do describe '#load_order' do
let(:url) { 'https://example.com/order' } let(:url) { 'https://example.com/order' }
subject { client.load_order(url) } subject { client.load_order(url) }
before do before do
...@@ -102,6 +103,7 @@ describe ::Gitlab::LetsEncrypt::Client do ...@@ -102,6 +103,7 @@ describe ::Gitlab::LetsEncrypt::Client do
describe '#load_challenge' do describe '#load_challenge' do
let(:url) { 'https://example.com/challenge' } let(:url) { 'https://example.com/challenge' }
subject { client.load_challenge(url) } subject { client.load_challenge(url) }
before do before do
......
...@@ -126,6 +126,7 @@ describe Gitlab::MarkdownCache::ActiveRecord::Extension do ...@@ -126,6 +126,7 @@ describe Gitlab::MarkdownCache::ActiveRecord::Extension do
describe '#cached_html_up_to_date?' do describe '#cached_html_up_to_date?' do
let(:thing) { klass.create(title: updated_markdown, title_html: html, cached_markdown_version: nil) } let(:thing) { klass.create(title: updated_markdown, title_html: html, cached_markdown_version: nil) }
subject { thing.cached_html_up_to_date?(:title) } subject { thing.cached_html_up_to_date?(:title) }
it 'returns false if markdown has been changed but html has not' do it 'returns false if markdown has been changed but html has not' do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Metrics::RequestsRackMiddleware do describe Gitlab::Metrics::RequestsRackMiddleware do
let(:app) { double('app') } let(:app) { double('app') }
subject { described_class.new(app) } subject { described_class.new(app) }
describe '#call' do describe '#call' do
......
...@@ -52,6 +52,7 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do ...@@ -52,6 +52,7 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do
context 'unicorn listens on tcp sockets' do context 'unicorn listens on tcp sockets' do
let(:tcp_socket_address) { '0.0.0.0:8080' } let(:tcp_socket_address) { '0.0.0.0:8080' }
let(:tcp_sockets) { [tcp_socket_address] } let(:tcp_sockets) { [tcp_socket_address] }
before do before do
allow(unicorn).to receive(:listener_names).and_return(tcp_sockets) allow(unicorn).to receive(:listener_names).and_return(tcp_sockets)
end end
......
...@@ -49,6 +49,7 @@ describe Gitlab::Pagination::Keyset do ...@@ -49,6 +49,7 @@ describe Gitlab::Pagination::Keyset do
context 'with other order-by columns' do context 'with other order-by columns' do
let(:order_by) { { created_at: :desc, id: :desc } } let(:order_by) { { created_at: :desc, id: :desc } }
it 'returns false for Project' do it 'returns false for Project' do
expect(subject.available?(request_context, Project.all)).to be_falsey expect(subject.available?(request_context, Project.all)).to be_falsey
end end
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::PhabricatorImport::Cache::Map, :clean_gitlab_redis_cache do describe Gitlab::PhabricatorImport::Cache::Map, :clean_gitlab_redis_cache do
set(:project) { create(:project) } set(:project) { create(:project) }
let(:redis) { Gitlab::Redis::Cache } let(:redis) { Gitlab::Redis::Cache }
subject(:map) { described_class.new(project) } subject(:map) { described_class.new(project) }
describe '#get_gitlab_model' do describe '#get_gitlab_model' do
......
...@@ -11,6 +11,7 @@ describe Gitlab::PhabricatorImport::Importer do ...@@ -11,6 +11,7 @@ describe Gitlab::PhabricatorImport::Importer do
describe '#execute' do describe '#execute' do
let(:project) { create(:project, :import_scheduled) } let(:project) { create(:project, :import_scheduled) }
subject(:importer) { described_class.new(project) } subject(:importer) { described_class.new(project) }
it 'sets a custom jid that will be kept up to date' do it 'sets a custom jid that will be kept up to date' do
......
...@@ -8,6 +8,7 @@ describe Gitlab::PhabricatorImport::ProjectCreator do ...@@ -8,6 +8,7 @@ describe Gitlab::PhabricatorImport::ProjectCreator do
phabricator_server_url: 'http://phab.example.com', phabricator_server_url: 'http://phab.example.com',
api_token: 'the-token' } api_token: 'the-token' }
end end
subject(:creator) { described_class.new(user, params) } subject(:creator) { described_class.new(user, params) }
describe '#execute' do describe '#execute' do
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do
let(:project) { create(:project, namespace: create(:group)) } let(:project) { create(:project, namespace: create(:group)) }
subject(:finder) { described_class.new(project, ['first-phid', 'second-phid']) } subject(:finder) { described_class.new(project, ['first-phid', 'second-phid']) }
before do before do
......
...@@ -53,6 +53,7 @@ describe Gitlab::ProjectSearchResults do ...@@ -53,6 +53,7 @@ describe Gitlab::ProjectSearchResults do
context "when #{entity_type} is disabled" do context "when #{entity_type} is disabled" do
let(:project) { disabled_project } let(:project) { disabled_project }
it "hides #{blob_kind} from members" do it "hides #{blob_kind} from members" do
project.add_reporter(user) project.add_reporter(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.
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