Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
00608acc
Commit
00608acc
authored
Jan 24, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into 4163-move-uploads-to-object-storage
parents
f74c90f6
e499bc7d
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
219 additions
and
163 deletions
+219
-163
.gitlab-ci.yml
.gitlab-ci.yml
+63
-63
app/assets/javascripts/issuable/related_issues/components/related_issues_block.vue
...suable/related_issues/components/related_issues_block.vue
+7
-21
changelogs/unreleased-ee/4627-fix-epic-issue-reordering.yml
changelogs/unreleased-ee/4627-fix-epic-issue-reordering.yml
+5
-0
changelogs/unreleased-ee/da-fix-openssh-expected-command.yml
changelogs/unreleased-ee/da-fix-openssh-expected-command.yml
+5
-0
changelogs/unreleased-ee/dm-issue-move-transaction-error-ee.yml
...logs/unreleased-ee/dm-issue-move-transaction-error-ee.yml
+5
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+4
-2
ee/lib/system_check/geo/authorized_keys_check.rb
ee/lib/system_check/geo/authorized_keys_check.rb
+1
-1
features/support/db_cleaner.rb
features/support/db_cleaner.rb
+1
-1
spec/ee/fixtures/system_check/sshd_config
spec/ee/fixtures/system_check/sshd_config
+1
-1
spec/ee/fixtures/system_check/sshd_config_invalid_user
spec/ee/fixtures/system_check/sshd_config_invalid_user
+1
-1
spec/ee/fixtures/system_check/sshd_config_no_user
spec/ee/fixtures/system_check/sshd_config_no_user
+1
-1
spec/ee/spec/lib/gitlab/geo/file_transfer_spec.rb
spec/ee/spec/lib/gitlab/geo/file_transfer_spec.rb
+1
-1
spec/ee/spec/lib/system_check/geo/authorized_keys_check_spec.rb
...e/spec/lib/system_check/geo/authorized_keys_check_spec.rb
+1
-1
spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
.../user_resolves_diff_notes_and_discussions_resolve_spec.rb
+1
-1
spec/javascripts/commit/pipelines/pipelines_spec.js
spec/javascripts/commit/pipelines/pipelines_spec.js
+3
-2
spec/javascripts/issuable/related_issues/components/related_issues_block_spec.js
...le/related_issues/components/related_issues_block_spec.js
+23
-6
spec/javascripts/pipelines/pipelines_table_row_spec.js
spec/javascripts/pipelines/pipelines_table_row_spec.js
+4
-3
spec/javascripts/pipelines/pipelines_table_spec.js
spec/javascripts/pipelines/pipelines_table_spec.js
+3
-2
spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb
...ation/deserialize_merge_request_diffs_and_commits_spec.rb
+1
-1
spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb
...nd_migration/migrate_system_uploads_to_new_folder_spec.rb
+2
-2
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
...se/rename_reserved_paths_migration/v1/rename_base_spec.rb
+1
-1
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb
...ame_reserved_paths_migration/v1/rename_namespaces_spec.rb
+1
-1
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb
...ename_reserved_paths_migration/v1/rename_projects_spec.rb
+1
-1
spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
...itlab/database/rename_reserved_paths_migration/v1_spec.rb
+1
-1
spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb
...grations/add_head_pipeline_for_each_merge_request_spec.rb
+1
-1
spec/migrations/calculate_conv_dev_index_percentages_spec.rb
spec/migrations/calculate_conv_dev_index_percentages_spec.rb
+1
-1
spec/migrations/fix_wrongly_renamed_routes_spec.rb
spec/migrations/fix_wrongly_renamed_routes_spec.rb
+1
-1
spec/migrations/migrate_issues_to_ghost_user_spec.rb
spec/migrations/migrate_issues_to_ghost_user_spec.rb
+3
-3
spec/migrations/migrate_user_activities_to_users_last_activity_on_spec.rb
...migrate_user_activities_to_users_last_activity_on_spec.rb
+1
-1
spec/migrations/migrate_user_project_view_spec.rb
spec/migrations/migrate_user_project_view_spec.rb
+1
-1
spec/migrations/remove_duplicate_mr_events_spec.rb
spec/migrations/remove_duplicate_mr_events_spec.rb
+1
-1
spec/migrations/rename_more_reserved_project_names_spec.rb
spec/migrations/rename_more_reserved_project_names_spec.rb
+2
-2
spec/migrations/rename_reserved_project_names_spec.rb
spec/migrations/rename_reserved_project_names_spec.rb
+2
-2
spec/migrations/rename_users_with_renamed_namespace_spec.rb
spec/migrations/rename_users_with_renamed_namespace_spec.rb
+1
-1
spec/migrations/update_retried_for_ci_build_spec.rb
spec/migrations/update_retried_for_ci_build_spec.rb
+1
-1
spec/models/concerns/avatarable_spec.rb
spec/models/concerns/avatarable_spec.rb
+21
-18
spec/models/member_spec.rb
spec/models/member_spec.rb
+2
-2
spec/models/project_group_link_spec.rb
spec/models/project_group_link_spec.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-1
spec/services/issues/move_service_spec.rb
spec/services/issues/move_service_spec.rb
+18
-2
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+19
-7
spec/support/features/discussion_comments_shared_example.rb
spec/support/features/discussion_comments_shared_example.rb
+4
-2
spec/uploaders/job_artifact_uploader_spec.rb
spec/uploaders/job_artifact_uploader_spec.rb
+1
-1
No files found.
.gitlab-ci.yml
View file @
00608acc
...
...
@@ -347,69 +347,69 @@ setup-test-env:
rspec-pg geo
:
*rspec-metadata-pg-geo
rspec-pg 0 2
6
:
*rspec-metadata-pg
rspec-pg 1 2
6
:
*rspec-metadata-pg
rspec-pg 2 2
6
:
*rspec-metadata-pg
rspec-pg 3 2
6
:
*rspec-metadata-pg
rspec-pg 4 2
6
:
*rspec-metadata-pg
rspec-pg 5 2
6
:
*rspec-metadata-pg
rspec-pg 6 2
6
:
*rspec-metadata-pg
rspec-pg 7 2
6
:
*rspec-metadata-pg
rspec-pg 8 2
6
:
*rspec-metadata-pg
rspec-pg 9 2
6
:
*rspec-metadata-pg
rspec-pg 10 2
6
:
*rspec-metadata-pg
rspec-pg 11 2
6
:
*rspec-metadata-pg
rspec-pg 12 2
6
:
*rspec-metadata-pg
rspec-pg 13 2
6
:
*rspec-metadata-pg
rspec-pg 14 2
6
:
*rspec-metadata-pg
rspec-pg 15 2
6
:
*rspec-metadata-pg
rspec-pg 16 2
6
:
*rspec-metadata-pg
rspec-pg 17 2
6
:
*rspec-metadata-pg
rspec-pg 18 2
6
:
*rspec-metadata-pg
rspec-pg 19 2
6
:
*rspec-metadata-pg
rspec-pg 20 2
6
:
*rspec-metadata-pg
rspec-pg 21 2
6
:
*rspec-metadata-pg
rspec-pg 22 2
6
:
*rspec-metadata-pg
rspec-pg 23 2
6
:
*rspec-metadata-pg
rspec-pg 24 2
6
:
*rspec-metadata-pg
rspec-pg 25 2
6
:
*rspec-metadata-pg
rspec-mysql 0 26
:
*rspec-metadata-mysql
rspec-mysql
1 26
:
*rspec-metadata-mysql
rspec-mysql
2 26
:
*rspec-metadata-mysql
rspec-mysql
3 26
:
*rspec-metadata-mysql
rspec-mysql
4 26
:
*rspec-metadata-mysql
rspec-mysql
5 26
:
*rspec-metadata-mysql
rspec-mysql
6 26
:
*rspec-metadata-mysql
rspec-mysql
7 26
:
*rspec-metadata-mysql
rspec-mysql
8 26
:
*rspec-metadata-mysql
rspec-mysql
9 26
:
*rspec-metadata-mysql
rspec-mysql
10 26
:
*rspec-metadata-mysql
rspec-mysql 1
1 26
:
*rspec-metadata-mysql
rspec-mysql 1
2 26
:
*rspec-metadata-mysql
rspec-mysql 1
3 26
:
*rspec-metadata-mysql
rspec-mysql 1
4 26
:
*rspec-metadata-mysql
rspec-mysql 1
5 26
:
*rspec-metadata-mysql
rspec-mysql 1
6 26
:
*rspec-metadata-mysql
rspec-mysql 1
7 26
:
*rspec-metadata-mysql
rspec-mysql 1
8 26
:
*rspec-metadata-mysql
rspec-mysql 1
9 26
:
*rspec-metadata-mysql
rspec-mysql
20 26
:
*rspec-metadata-mysql
rspec-mysql 2
1 26
:
*rspec-metadata-mysql
rspec-mysql 2
2 26
:
*rspec-metadata-mysql
rspec-mysql 2
3 26
:
*rspec-metadata-mysql
rspec-mysql 2
4 26
:
*rspec-metadata-mysql
rspec-mysql 2
5 26
:
*rspec-metadata-mysql
spinach-pg 0 4
:
*spinach-metadata-pg
spinach-pg 1 4
:
*spinach-metadata-pg
spinach-pg
2 4
:
*spinach-metadata-pg
spinach-pg
3 4
:
*spinach-metadata-pg
spinach-mysql 0 4
:
*spinach-metadata-mysql
spinach-mysql
1 4
:
*spinach-metadata-mysql
spinach-mysql
2 4
:
*spinach-metadata-mysql
spinach-mysql
3 4
:
*spinach-metadata-mysql
rspec-pg 0 2
7
:
*rspec-metadata-pg
rspec-pg 1 2
7
:
*rspec-metadata-pg
rspec-pg 2 2
7
:
*rspec-metadata-pg
rspec-pg 3 2
7
:
*rspec-metadata-pg
rspec-pg 4 2
7
:
*rspec-metadata-pg
rspec-pg 5 2
7
:
*rspec-metadata-pg
rspec-pg 6 2
7
:
*rspec-metadata-pg
rspec-pg 7 2
7
:
*rspec-metadata-pg
rspec-pg 8 2
7
:
*rspec-metadata-pg
rspec-pg 9 2
7
:
*rspec-metadata-pg
rspec-pg 10 2
7
:
*rspec-metadata-pg
rspec-pg 11 2
7
:
*rspec-metadata-pg
rspec-pg 12 2
7
:
*rspec-metadata-pg
rspec-pg 13 2
7
:
*rspec-metadata-pg
rspec-pg 14 2
7
:
*rspec-metadata-pg
rspec-pg 15 2
7
:
*rspec-metadata-pg
rspec-pg 16 2
7
:
*rspec-metadata-pg
rspec-pg 17 2
7
:
*rspec-metadata-pg
rspec-pg 18 2
7
:
*rspec-metadata-pg
rspec-pg 19 2
7
:
*rspec-metadata-pg
rspec-pg 20 2
7
:
*rspec-metadata-pg
rspec-pg 21 2
7
:
*rspec-metadata-pg
rspec-pg 22 2
7
:
*rspec-metadata-pg
rspec-pg 23 2
7
:
*rspec-metadata-pg
rspec-pg 24 2
7
:
*rspec-metadata-pg
rspec-pg 25 2
7
:
*rspec-metadata-pg
rspec-pg 26 27
:
*rspec-metadata-pg
rspec-mysql
0 27
:
*rspec-metadata-mysql
rspec-mysql
1 27
:
*rspec-metadata-mysql
rspec-mysql
2 27
:
*rspec-metadata-mysql
rspec-mysql
3 27
:
*rspec-metadata-mysql
rspec-mysql
4 27
:
*rspec-metadata-mysql
rspec-mysql
5 27
:
*rspec-metadata-mysql
rspec-mysql
6 27
:
*rspec-metadata-mysql
rspec-mysql
7 27
:
*rspec-metadata-mysql
rspec-mysql
8 27
:
*rspec-metadata-mysql
rspec-mysql
9 27
:
*rspec-metadata-mysql
rspec-mysql 1
0 27
:
*rspec-metadata-mysql
rspec-mysql 1
1 27
:
*rspec-metadata-mysql
rspec-mysql 1
2 27
:
*rspec-metadata-mysql
rspec-mysql 1
3 27
:
*rspec-metadata-mysql
rspec-mysql 1
4 27
:
*rspec-metadata-mysql
rspec-mysql 1
5 27
:
*rspec-metadata-mysql
rspec-mysql 1
6 27
:
*rspec-metadata-mysql
rspec-mysql 1
7 27
:
*rspec-metadata-mysql
rspec-mysql 1
8 27
:
*rspec-metadata-mysql
rspec-mysql
19 27
:
*rspec-metadata-mysql
rspec-mysql 2
0 27
:
*rspec-metadata-mysql
rspec-mysql 2
1 27
:
*rspec-metadata-mysql
rspec-mysql 2
2 27
:
*rspec-metadata-mysql
rspec-mysql 2
3 27
:
*rspec-metadata-mysql
rspec-mysql 2
4 27
:
*rspec-metadata-mysql
rspec-mysql 25 27
:
*rspec-metadata-mysql
rspec-mysql 26 27
:
*rspec-metadata-mysql
spinach-pg
0 3
:
*spinach-metadata-pg
spinach-pg
1 3
:
*spinach-metadata-pg
spinach-pg 2 3
:
*spinach-metadata-pg
spinach-mysql
0 3
:
*spinach-metadata-mysql
spinach-mysql
1 3
:
*spinach-metadata-mysql
spinach-mysql
2 3
:
*spinach-metadata-mysql
# Static analysis jobs
.ruby-static-analysis
:
&ruby-static-analysis
...
...
app/assets/javascripts/issuable/related_issues/components/related_issues_block.vue
View file @
00608acc
...
...
@@ -103,33 +103,18 @@ export default {
toggleAddRelatedIssuesForm
()
{
eventHub
.
$emit
(
'
toggleAddRelatedIssuesForm
'
);
},
getBeforeAfterId
(
newIndex
,
lastIndex
)
{
let
beforeId
=
null
;
let
afterId
=
null
;
if
(
newIndex
===
0
)
{
// newIndex is 0, item was moved to top => send only afterId
afterId
=
this
.
relatedIssues
[
newIndex
].
epic_issue_id
;
}
else
if
(
newIndex
===
lastIndex
)
{
// newIndex is lastIndex, item was moved to bottom => send only beforeId
beforeId
=
this
.
relatedIssues
[
newIndex
].
epic_issue_id
;
}
else
{
// leave default
beforeId
=
this
.
relatedIssues
[
newIndex
-
1
].
epic_issue_id
;
afterId
=
this
.
relatedIssues
[
newIndex
].
epic_issue_id
;
}
getBeforeAfterId
(
itemEl
)
{
const
prevItemEl
=
itemEl
.
previousElementSibling
;
const
nextItemEl
=
itemEl
.
nextElementSibling
;
return
{
beforeId
,
afterId
,
beforeId
:
prevItemEl
&&
parseInt
(
prevItemEl
.
dataset
.
epicIssueId
,
0
)
,
afterId
:
nextItemEl
&&
parseInt
(
nextItemEl
.
dataset
.
epicIssueId
,
0
)
,
};
},
reordered
(
event
)
{
this
.
removeDraggingCursor
();
const
{
beforeId
,
afterId
,
}
=
this
.
getBeforeAfterId
(
event
.
newIndex
,
this
.
relatedIssues
.
length
-
1
);
const
{
beforeId
,
afterId
}
=
this
.
getBeforeAfterId
(
event
.
item
);
this
.
$emit
(
'
saveReorder
'
,
{
issueId
:
parseInt
(
event
.
item
.
dataset
.
key
,
10
),
...
...
@@ -240,6 +225,7 @@ issue-count-badge-add-button btn btn-sm btn-default"
card: canReorder
}"
:data-key="issue.id"
:data-epic-issue-id="issue.epic_issue_id"
>
<issue-item
event-namespace=
"relatedIssue"
...
...
changelogs/unreleased-ee/4627-fix-epic-issue-reordering.yml
0 → 100644
View file @
00608acc
---
title
:
Fix Epic issue item reordering to handle different scenarios
merge_request
:
4142
author
:
type
:
fixed
changelogs/unreleased-ee/da-fix-openssh-expected-command.yml
0 → 100644
View file @
00608acc
---
title
:
Geo - Fix OPENSSH_EXPECTED_COMMAND in the geo:check rake task
merge_request
:
author
:
type
:
fixed
changelogs/unreleased-ee/dm-issue-move-transaction-error-ee.yml
0 → 100644
View file @
00608acc
---
title
:
Execute group hooks after-commit when moving an issue
merge_request
:
author
:
type
:
fixed
ee/app/models/ee/project.rb
View file @
00608acc
...
...
@@ -268,8 +268,10 @@ module EE
super
if
group
&&
feature_available?
(
:group_webhooks
)
group
.
hooks
.
__send__
(
hooks_scope
).
each
do
|
hook
|
# rubocop:disable GitlabSecurity/PublicSend
hook
.
async_execute
(
data
,
hooks_scope
.
to_s
)
run_after_commit_or_now
do
group
.
hooks
.
hooks_for
(
hooks_scope
).
each
do
|
hook
|
hook
.
async_execute
(
data
,
hooks_scope
.
to_s
)
end
end
end
end
...
...
ee/lib/system_check/geo/authorized_keys_check.rb
View file @
00608acc
...
...
@@ -22,7 +22,7 @@ module SystemCheck
\s
* # optional any amount of space character
(?:
\#
.*)?$ # optional start-comment symbol followed by optionally any character until end of line
}x
OPENSSH_EXPECTED_COMMAND
=
'/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check %u %k'
.
freeze
OPENSSH_EXPECTED_COMMAND
=
'/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
git
%u %k'
.
freeze
def
multi_check
unless
openssh_config_exists?
...
...
features/support/db_cleaner.rb
View file @
00608acc
require
'database_cleaner'
DatabaseCleaner
[
:active_record
].
strategy
=
:
trunca
tion
,
{
except:
[
'licenses'
]
}
DatabaseCleaner
[
:active_record
].
strategy
=
:
dele
tion
,
{
except:
[
'licenses'
]
}
Spinach
.
hooks
.
before_scenario
do
DatabaseCleaner
.
start
...
...
spec/ee/fixtures/system_check/sshd_config
View file @
00608acc
...
...
@@ -32,7 +32,7 @@ RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
#AuthorizedKeysCommand /opt/gitlab-shell/invalid_authorized_keys %u %k
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check %u %k
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
git
%u %k
AuthorizedKeysCommandUser git
# Don't read the user's ~/.rhosts and ~/.shosts files
...
...
spec/ee/fixtures/system_check/sshd_config_invalid_user
View file @
00608acc
...
...
@@ -4,5 +4,5 @@
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check %u %k # comment
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
git
%u %k # comment
AuthorizedKeysCommandUser anotheruser #comment with more stuff#
spec/ee/fixtures/system_check/sshd_config_no_user
View file @
00608acc
...
...
@@ -5,5 +5,5 @@ RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
#AuthorizedKeysCommand /opt/gitlab-shell/invalid_authorized_keys %u %k
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check %u %k
AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
git
%u %k
#AuthorizedKeysCommandUser git
spec/ee/spec/lib/gitlab/geo/file_transfer_spec.rb
View file @
00608acc
...
...
@@ -13,7 +13,7 @@ describe Gitlab::Geo::FileTransfer do
expect
(
subject
.
file_id
).
to
eq
(
upload
.
id
)
expect
(
subject
.
filename
).
to
eq
(
upload
.
absolute_path
)
expect
(
Pathname
.
new
(
subject
.
filename
).
absolute?
).
to
be_truthy
expect
(
subject
.
request_data
).
to
eq
({
id:
upload
.
id
,
expect
(
subject
.
request_data
).
to
eq
({
id:
upload
.
model_
id
,
type:
'User'
,
checksum:
upload
.
checksum
})
end
...
...
spec/ee/spec/lib/system_check/geo/authorized_keys_check_spec.rb
View file @
00608acc
...
...
@@ -106,7 +106,7 @@ describe SystemCheck::Geo::AuthorizedKeysCheck do
it
'returns correct (uncommented) command'
do
override_sshd_config
(
'system_check/sshd_config'
)
expect
(
subject
.
extract_authorized_keys_command
).
to
eq
(
'/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check %u %k'
)
expect
(
subject
.
extract_authorized_keys_command
).
to
eq
(
'/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check
git
%u %k'
)
end
it
'returns command without comments and without quotes'
do
...
...
spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb
View file @
00608acc
...
...
@@ -108,7 +108,7 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
it
'shows resolved discussion when toggled'
do
find
(
".timeline-content .discussion[data-discussion-id='
#{
note
.
discussion_id
}
'] .discussion-toggle-button"
).
click
expect
(
page
.
find
(
".timeline-content #note_
#{
note
.
noteable_
id
}
"
)).
to
be_visible
expect
(
page
.
find
(
".timeline-content #note_
#{
note
.
id
}
"
)).
to
be_visible
end
end
...
...
spec/javascripts/commit/pipelines/pipelines_spec.js
View file @
00608acc
...
...
@@ -10,9 +10,10 @@ describe('Pipelines table in Commits and Merge requests', () => {
preloadFixtures
(
jsonFixtureName
);
beforeEach
(()
=>
{
PipelinesTable
=
Vue
.
extend
(
pipelinesTable
);
const
pipelines
=
getJSONFixture
(
jsonFixtureName
).
pipelines
;
pipeline
=
pipelines
.
find
(
p
=>
p
.
id
===
1
);
PipelinesTable
=
Vue
.
extend
(
pipelinesTable
);
pipeline
=
pipelines
.
find
(
p
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
});
describe
(
'
successful request
'
,
()
=>
{
...
...
spec/javascripts/issuable/related_issues/components/related_issues_block_spec.js
View file @
00608acc
...
...
@@ -42,6 +42,16 @@ const issuable4 = {
state
:
'
opened
'
,
};
const
issuable5
=
{
id
:
204
,
epic_issue_id
:
5
,
reference
:
'
foo/bar#127
'
,
displayReference
:
'
#127
'
,
title
:
'
some other other other thing
'
,
path
:
'
/foo/bar/issues/127
'
,
state
:
'
opened
'
,
};
describe
(
'
RelatedIssuesBlock
'
,
()
=>
{
let
RelatedIssuesBlock
;
let
vm
;
...
...
@@ -148,6 +158,7 @@ describe('RelatedIssuesBlock', () => {
issuable2
,
issuable3
,
issuable4
,
issuable5
,
],
},
}).
$mount
();
...
...
@@ -160,21 +171,27 @@ describe('RelatedIssuesBlock', () => {
});
it
(
'
reorder item correctly when an item is moved to the top
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
0
,
3
);
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:first-child
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBeNull
();
expect
(
beforeAfterIds
.
afterId
).
toBe
(
1
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
2
);
});
it
(
'
reorder item correctly when an item is moved to the bottom
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
3
,
3
);
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:last-child
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
4
);
expect
(
beforeAfterIds
.
afterId
).
toBeNull
();
});
it
(
'
reorder item correctly when an item is
moved somewhere in the middle
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
2
,
3
);
it
(
'
reorder item correctly when an item is
swapped with adjecent item
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:nth-child(3)
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
2
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
3
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
4
);
});
it
(
'
reorder item correctly when an item is moved somewhere in the middle
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:nth-child(4)
'
));
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
3
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
5
);
});
it
(
'
when expanding add related issue form
'
,
()
=>
{
...
...
spec/javascripts/pipelines/pipelines_table_row_spec.js
View file @
00608acc
...
...
@@ -24,9 +24,10 @@ describe('Pipelines Table Row', () => {
beforeEach
(()
=>
{
const
pipelines
=
getJSONFixture
(
jsonFixtureName
).
pipelines
;
pipeline
=
pipelines
.
find
(
p
=>
p
.
id
===
1
);
pipelineWithoutAuthor
=
pipelines
.
find
(
p
=>
p
.
id
===
2
);
pipelineWithoutCommit
=
pipelines
.
find
(
p
=>
p
.
id
===
3
);
pipeline
=
pipelines
.
find
(
p
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
pipelineWithoutAuthor
=
pipelines
.
find
(
p
=>
p
.
user
==
null
&&
p
.
commit
!==
null
);
pipelineWithoutCommit
=
pipelines
.
find
(
p
=>
p
.
user
==
null
&&
p
.
commit
==
null
);
});
afterEach
(()
=>
{
...
...
spec/javascripts/pipelines/pipelines_table_spec.js
View file @
00608acc
...
...
@@ -11,9 +11,10 @@ describe('Pipelines Table', () => {
preloadFixtures
(
jsonFixtureName
);
beforeEach
(()
=>
{
PipelinesTableComponent
=
Vue
.
extend
(
pipelinesTableComp
);
const
pipelines
=
getJSONFixture
(
jsonFixtureName
).
pipelines
;
pipeline
=
pipelines
.
find
(
p
=>
p
.
id
===
1
);
PipelinesTableComponent
=
Vue
.
extend
(
pipelinesTableComp
);
pipeline
=
pipelines
.
find
(
p
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
});
describe
(
'
table
'
,
()
=>
{
...
...
spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
DeserializeMergeRequestDiffsAndCommits
,
:
truncate
,
:
migration
,
schema:
20171114162227
do
describe
Gitlab
::
BackgroundMigration
::
DeserializeMergeRequestDiffsAndCommits
,
:migration
,
schema:
20171114162227
do
let
(
:merge_request_diffs
)
{
table
(
:merge_request_diffs
)
}
let
(
:merge_requests
)
{
table
(
:merge_requests
)
}
...
...
spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
MigrateSystemUploadsToNewFolder
do
describe
Gitlab
::
BackgroundMigration
::
MigrateSystemUploadsToNewFolder
,
:delete
do
let
(
:migration
)
{
described_class
.
new
}
before
do
...
...
@@ -8,7 +8,7 @@ describe Gitlab::BackgroundMigration::MigrateSystemUploadsToNewFolder do
end
describe
'#perform'
do
it
'renames the path of system-uploads'
,
:truncate
do
it
'renames the path of system-uploads'
do
upload
=
create
(
:upload
,
model:
create
(
:project
),
path:
'uploads/system/project/avatar.jpg'
)
migration
.
perform
(
'uploads/system/'
,
'uploads/-/system/'
)
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameBase
,
:
trunca
te
do
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameBase
,
:
dele
te
do
let
(
:migration
)
{
FakeRenameReservedPathMigrationV1
.
new
}
let
(
:subject
)
{
described_class
.
new
([
'the-path'
],
migration
)
}
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameNamespaces
,
:
trunca
te
do
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameNamespaces
,
:
dele
te
do
let
(
:migration
)
{
FakeRenameReservedPathMigrationV1
.
new
}
let
(
:subject
)
{
described_class
.
new
([
'the-path'
],
migration
)
}
let
(
:namespace
)
{
create
(
:group
,
name:
'the-path'
)
}
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameProjects
,
:
trunca
te
do
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
::
RenameProjects
,
:
dele
te
do
let
(
:migration
)
{
FakeRenameReservedPathMigrationV1
.
new
}
let
(
:subject
)
{
described_class
.
new
([
'the-path'
],
migration
)
}
let
(
:project
)
do
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
View file @
00608acc
...
...
@@ -13,7 +13,7 @@ shared_examples 'renames child namespaces' do |type|
end
end
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
,
:
trunca
te
do
describe
Gitlab
::
Database
::
RenameReservedPathsMigration
::
V1
,
:
dele
te
do
let
(
:subject
)
{
FakeRenameReservedPathMigrationV1
.
new
}
before
do
...
...
spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb
View file @
00608acc
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170508170547_add_head_pipeline_for_each_merge_request.rb'
)
describe
AddHeadPipelineForEachMergeRequest
,
:
trunca
te
do
describe
AddHeadPipelineForEachMergeRequest
,
:
dele
te
do
include
ProjectForksHelper
let
(
:migration
)
{
described_class
.
new
}
...
...
spec/migrations/calculate_conv_dev_index_percentages_spec.rb
View file @
00608acc
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170803090603_calculate_conv_dev_index_percentages.rb'
)
describe
CalculateConvDevIndexPercentages
,
truncate:
tru
e
do
describe
CalculateConvDevIndexPercentages
,
:delet
e
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:conv_dev_index
)
do
create
(
:conversational_development_index_metric
,
...
...
spec/migrations/fix_wrongly_renamed_routes_spec.rb
View file @
00608acc
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170518231126_fix_wrongly_renamed_routes.rb'
)
describe
FixWronglyRenamedRoutes
,
:
truncate
,
:
migration
do
describe
FixWronglyRenamedRoutes
,
:migration
do
let
(
:subject
)
{
described_class
.
new
}
let
(
:namespaces_table
)
{
table
(
:namespaces
)
}
let
(
:projects_table
)
{
table
(
:projects
)
}
...
...
spec/migrations/migrate_issues_to_ghost_user_spec.rb
View file @
00608acc
...
...
@@ -8,10 +8,10 @@ describe MigrateIssuesToGhostUser, :migration do
let
(
:users
)
{
table
(
:users
)
}
before
do
projects
.
create!
(
name:
'gitlab'
)
project
=
project
s
.
create!
(
name:
'gitlab'
)
user
=
users
.
create
(
email:
'test@example.com'
)
issues
.
create
(
title:
'Issue 1'
,
author_id:
nil
,
project_id:
1
)
issues
.
create
(
title:
'Issue 2'
,
author_id:
user
.
id
,
project_id:
1
)
issues
.
create
(
title:
'Issue 1'
,
author_id:
nil
,
project_id:
project
.
id
)
issues
.
create
(
title:
'Issue 2'
,
author_id:
user
.
id
,
project_id:
project
.
id
)
end
context
'when ghost user exists'
do
...
...
spec/migrations/migrate_user_activities_to_users_last_activity_on_spec.rb
View file @
00608acc
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170324160416_migrate_user_activities_to_users_last_activity_on.rb'
)
describe
MigrateUserActivitiesToUsersLastActivityOn
,
:clean_gitlab_redis_shared_state
,
:
trunca
te
do
describe
MigrateUserActivitiesToUsersLastActivityOn
,
:clean_gitlab_redis_shared_state
,
:
dele
te
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:user_active_1
)
{
create
(
:user
)
}
let!
(
:user_active_2
)
{
create
(
:user
)
}
...
...
spec/migrations/migrate_user_project_view_spec.rb
View file @
00608acc
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170406142253_migrate_user_project_view.rb'
)
describe
MigrateUserProjectView
,
:
trunca
te
do
describe
MigrateUserProjectView
,
:
dele
te
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:user
)
{
create
(
:user
,
project_view:
'readme'
)
}
...
...
spec/migrations/remove_duplicate_mr_events_spec.rb
View file @
00608acc
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170815060945_remove_duplicate_mr_events.rb'
)
describe
RemoveDuplicateMrEvents
,
truncate:
tru
e
do
describe
RemoveDuplicateMrEvents
,
:delet
e
do
let
(
:migration
)
{
described_class
.
new
}
describe
'#up'
do
...
...
spec/migrations/rename_more_reserved_project_names_spec.rb
View file @
00608acc
...
...
@@ -5,8 +5,8 @@ require Rails.root.join('db', 'post_migrate', '20170313133418_rename_more_reserv
# This migration uses multiple threads, and thus different transactions. This
# means data created in this spec may not be visible to some threads. To work
# around this we use the
TRUNCA
TE cleaning strategy.
describe
RenameMoreReservedProjectNames
,
truncate:
tru
e
do
# around this we use the
DELE
TE cleaning strategy.
describe
RenameMoreReservedProjectNames
,
:delet
e
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:project
)
{
create
(
:project
)
}
...
...
spec/migrations/rename_reserved_project_names_spec.rb
View file @
00608acc
...
...
@@ -5,8 +5,8 @@ require Rails.root.join('db', 'post_migrate', '20161221153951_rename_reserved_pr
# This migration uses multiple threads, and thus different transactions. This
# means data created in this spec may not be visible to some threads. To work
# around this we use the
TRUNCA
TE cleaning strategy.
describe
RenameReservedProjectNames
,
truncate:
tru
e
do
# around this we use the
DELE
TE cleaning strategy.
describe
RenameReservedProjectNames
,
:delet
e
do
let
(
:migration
)
{
described_class
.
new
}
let!
(
:project
)
{
create
(
:project
)
}
...
...
spec/migrations/rename_users_with_renamed_namespace_spec.rb
View file @
00608acc
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170518200835_rename_users_with_renamed_namespace.rb'
)
describe
RenameUsersWithRenamedNamespace
,
truncate:
tru
e
do
describe
RenameUsersWithRenamedNamespace
,
:delet
e
do
it
'renames a user that had their namespace renamed to the namespace path'
do
other_user
=
create
(
:user
,
username:
'kodingu'
)
other_user1
=
create
(
:user
,
username:
'api0'
)
...
...
spec/migrations/update_retried_for_ci_build_spec.rb
View file @
00608acc
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170503004427_update_retried_for_ci_build.rb'
)
describe
UpdateRetriedForCiBuild
,
truncate:
tru
e
do
describe
UpdateRetriedForCiBuild
,
:delet
e
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let!
(
:build_old
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'test'
)
}
let!
(
:build_new
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'test'
)
}
...
...
spec/models/concerns/avatarable_spec.rb
View file @
00608acc
require
'spec_helper'
describe
Avatarable
do
s
ubject
{
create
(
:project
,
avatar:
fixture_file_upload
(
File
.
join
(
Rails
.
root
,
'spec/fixtures/dk.png'
)))
}
s
et
(
:project
)
{
create
(
:project
,
avatar:
fixture_file_upload
(
File
.
join
(
Rails
.
root
,
'spec/fixtures/dk.png'
)))
}
let
(
:gitlab_host
)
{
"https://gitlab.example.com"
}
let
(
:relative_url_root
)
{
"/gitlab"
}
let
(
:asset_host
)
{
"https://gitlab-assets.example.com"
}
let
(
:asset_host
)
{
'https://gitlab-assets.example.com'
}
before
do
stub_config_setting
(
base_url:
gitlab_host
)
...
...
@@ -15,29 +15,32 @@ describe Avatarable do
describe
'#avatar_path'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:has_asset_host
,
:visibility_level
,
:only_path
,
:avatar_path
)
do
true
|
Project
::
PRIVATE
|
true
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
true
|
Project
::
PRIVATE
|
false
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
true
|
Project
::
INTERNAL
|
true
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
true
|
Project
::
INTERNAL
|
false
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
true
|
Project
::
PUBLIC
|
true
|
[
subject
.
avatar
.
url
]
true
|
Project
::
PUBLIC
|
false
|
[
asset_host
,
subject
.
avatar
.
url
]
false
|
Project
::
PRIVATE
|
true
|
[
relative_url_root
,
subject
.
avatar
.
url
]
false
|
Project
::
PRIVATE
|
false
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
false
|
Project
::
INTERNAL
|
true
|
[
relative_url_root
,
subject
.
avatar
.
url
]
false
|
Project
::
INTERNAL
|
false
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
false
|
Project
::
PUBLIC
|
true
|
[
relative_url_root
,
subject
.
avatar
.
url
]
false
|
Project
::
PUBLIC
|
false
|
[
gitlab_host
,
relative_url_root
,
subject
.
avatar
.
url
]
where
(
:has_asset_host
,
:visibility_level
,
:only_path
,
:avatar_path
_prefix
)
do
true
|
Project
::
PRIVATE
|
true
|
[
gitlab_host
,
relative_url_root
]
true
|
Project
::
PRIVATE
|
false
|
[
gitlab_host
,
relative_url_root
]
true
|
Project
::
INTERNAL
|
true
|
[
gitlab_host
,
relative_url_root
]
true
|
Project
::
INTERNAL
|
false
|
[
gitlab_host
,
relative_url_root
]
true
|
Project
::
PUBLIC
|
true
|
[]
true
|
Project
::
PUBLIC
|
false
|
[
asset_host
]
false
|
Project
::
PRIVATE
|
true
|
[
relative_url_root
]
false
|
Project
::
PRIVATE
|
false
|
[
gitlab_host
,
relative_url_root
]
false
|
Project
::
INTERNAL
|
true
|
[
relative_url_root
]
false
|
Project
::
INTERNAL
|
false
|
[
gitlab_host
,
relative_url_root
]
false
|
Project
::
PUBLIC
|
true
|
[
relative_url_root
]
false
|
Project
::
PUBLIC
|
false
|
[
gitlab_host
,
relative_url_root
]
end
with_them
do
before
do
allow
(
ActionController
::
Base
).
to
receive
(
:asset_host
).
and_return
(
has_asset_host
?
asset_host
:
nil
)
subject
.
visibility_level
=
visibility_level
allow
(
ActionController
::
Base
).
to
receive
(
:asset_host
)
{
has_asset_host
&&
asset_host
}
project
.
visibility_level
=
visibility_level
end
let
(
:avatar_path
)
{
(
avatar_path_prefix
+
[
project
.
avatar
.
url
]).
join
}
it
'returns the expected avatar path'
do
expect
(
subject
.
avatar_path
(
only_path:
only_path
)).
to
eq
(
avatar_path
.
join
)
expect
(
project
.
avatar_path
(
only_path:
only_path
)).
to
eq
(
avatar_path
)
end
end
end
...
...
spec/models/member_spec.rb
View file @
00608acc
...
...
@@ -488,7 +488,7 @@ describe Member do
member
.
accept_invite!
(
user
)
end
it
"refreshes user's authorized projects"
,
:
trunca
te
do
it
"refreshes user's authorized projects"
,
:
dele
te
do
project
=
member
.
source
expect
(
user
.
authorized_projects
).
not_to
include
(
project
)
...
...
@@ -523,7 +523,7 @@ describe Member do
end
end
describe
"destroying a record"
,
:
trunca
te
do
describe
"destroying a record"
,
:
dele
te
do
it
"refreshes user's authorized projects"
do
project
=
create
(
:project
,
:private
)
user
=
create
(
:user
)
...
...
spec/models/project_group_link_spec.rb
View file @
00608acc
...
...
@@ -30,7 +30,7 @@ describe ProjectGroupLink do
end
end
describe
"destroying a record"
,
:
trunca
te
do
describe
"destroying a record"
,
:
dele
te
do
it
"refreshes group users' authorized projects"
do
project
=
create
(
:project
,
:private
)
group
=
create
(
:group
)
...
...
spec/models/user_spec.rb
View file @
00608acc
...
...
@@ -1618,7 +1618,7 @@ describe User do
it
{
is_expected
.
to
eq
([
private_group
])
}
end
describe
'#authorized_projects'
,
:
trunca
te
do
describe
'#authorized_projects'
,
:
dele
te
do
context
'with a minimum access level'
do
it
'includes projects for which the user is an owner'
do
user
=
create
(
:user
)
...
...
spec/services/issues/move_service_spec.rb
View file @
00608acc
...
...
@@ -6,7 +6,7 @@ describe Issues::MoveService do
let
(
:title
)
{
'Some issue'
}
let
(
:description
)
{
'Some issue description'
}
let
(
:old_project
)
{
create
(
:project
)
}
let
(
:new_project
)
{
create
(
:project
)
}
let
(
:new_project
)
{
create
(
:project
,
group:
create
(
:group
)
)
}
let
(
:milestone1
)
{
create
(
:milestone
,
project_id:
old_project
.
id
,
title:
'v9.0'
)
}
let
(
:old_issue
)
do
...
...
@@ -297,9 +297,25 @@ describe Issues::MoveService do
end
context
'project issue hooks'
do
let
(
:hook
)
{
create
(
:project_hook
,
project:
old_project
,
issues_events:
true
)
}
let
!
(
:hook
)
{
create
(
:project_hook
,
project:
old_project
,
issues_events:
true
)
}
it
'executes project issue hooks'
do
allow_any_instance_of
(
WebHookService
).
to
receive
(
:execute
)
# Ideally, we'd test that `WebHookWorker.jobs.size` increased by 1,
# but since the entire spec run takes place in a transaction, we never
# actually get to the `after_commit` hook that queues these jobs.
expect
{
move_service
.
execute
(
old_issue
,
new_project
)
}
.
not_to
raise_error
# Sidekiq::Worker::EnqueueFromTransactionError
end
end
context
'group issue hooks'
do
let!
(
:hook
)
{
create
(
:group_hook
,
group:
new_project
.
group
,
issues_events:
true
)
}
it
'executes group issue hooks'
do
allow_any_instance_of
(
WebHookService
).
to
receive
(
:execute
)
# Ideally, we'd test that `WebHookWorker.jobs.size` increased by 1,
# but since the entire spec run takes place in a transaction, we never
# actually get to the `after_commit` hook that queues these jobs.
...
...
spec/support/db_cleaner.rb
View file @
00608acc
require
'database_cleaner/active_record/deletion'
module
FakeInformationSchema
# Work around a bug in DatabaseCleaner when using the deletion strategy:
# https://github.com/DatabaseCleaner/database_cleaner/issues/347
#
# On MySQL, if the information schema is said to exist, we use an inaccurate
# row count leading to some tables not being cleaned when they should
def
information_schema_exists?
(
_connection
)
false
end
end
DatabaseCleaner
::
ActiveRecord
::
Deletion
.
prepend
(
FakeInformationSchema
)
RSpec
.
configure
do
|
config
|
# Ensure all sequences are reset at the start of the suite run
config
.
before
(
:suite
)
do
setup_database_cleaner
DatabaseCleaner
.
clean_with
(
:truncation
)
end
config
.
append_after
(
:context
)
do
DatabaseCleaner
.
clean_with
(
:
trunca
tion
,
cache_tables:
false
)
DatabaseCleaner
.
clean_with
(
:
dele
tion
,
cache_tables:
false
)
end
config
.
before
(
:each
)
do
...
...
@@ -14,11 +30,7 @@ RSpec.configure do |config|
end
config
.
before
(
:each
,
:js
)
do
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
end
config
.
before
(
:each
,
:truncate
)
do
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
DatabaseCleaner
.
strategy
=
:deletion
,
{
except:
%w[licenses]
}
end
config
.
before
(
:each
,
:delete
)
do
...
...
@@ -26,7 +38,7 @@ RSpec.configure do |config|
end
config
.
before
(
:each
,
:migration
)
do
DatabaseCleaner
.
strategy
=
:
trunca
tion
,
{
cache_tables:
false
}
DatabaseCleaner
.
strategy
=
:
dele
tion
,
{
cache_tables:
false
}
end
config
.
before
(
:each
)
do
...
...
spec/support/features/discussion_comments_shared_example.rb
View file @
00608acc
...
...
@@ -143,15 +143,17 @@ shared_examples 'discussion comments' do |resource_name|
end
if
resource_name
==
'merge request'
let
(
:note_id
)
{
find
(
"
#{
comments_selector
}
.note"
,
match: :first
)[
'data-note-id'
]
}
it
'shows resolved discussion when toggled'
do
click_button
"Resolve discussion"
expect
(
page
).
to
have_selector
(
'.note-row-1'
,
visible:
true
)
expect
(
page
).
to
have_selector
(
".note-row-
#{
note_id
}
"
,
visible:
true
)
refresh
click_button
"Toggle discussion"
expect
(
page
).
to
have_selector
(
'.note-row-1'
,
visible:
true
)
expect
(
page
).
to
have_selector
(
".note-row-
#{
note_id
}
"
,
visible:
true
)
end
end
end
...
...
spec/uploaders/job_artifact_uploader_spec.rb
View file @
00608acc
...
...
@@ -37,7 +37,7 @@ describe JobArtifactUploader do
it
{
is_expected
.
to
start_with
(
"
#{
uploader
.
root
}
/
#{
uploader
.
class
.
base_dir
}
"
)
}
it
{
is_expected
.
to
include
(
"/
#{
job_artifact
.
created_at
.
utc
.
strftime
(
'%Y_%m_%d'
)
}
/"
)
}
it
{
is_expected
.
to
include
(
"/
#{
job_artifact
.
project_
id
}
/"
)
}
it
{
is_expected
.
to
include
(
"/
#{
job_artifact
.
job_id
}
/
#{
job_artifact
.
id
}
/"
)
}
it
{
is_expected
.
to
end_with
(
"ci_build_artifacts.zip"
)
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment