diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 12:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 12:09:31 +0300 |
commit | 6763d2787670bc03a36a8eb601703e88fc70dece (patch) | |
tree | edc653ffd3052e3f9898c4fa8a07621d51574767 /spec/lib/gitlab/background_migration | |
parent | ed9165c2abda1dca048a8d3cb8030d906c0bbb0c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/background_migration')
-rw-r--r-- | spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb b/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb index a273dcf9e5c..ff8b9dd1005 100644 --- a/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb +++ b/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb @@ -12,6 +12,7 @@ describe Gitlab::BackgroundMigration::UserMentions::CreateResourceUserMention, s let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:notes) { table(:notes) } + let(:routes) { table(:routes) } let(:author) { users.create!(email: 'author@example.com', notification_email: 'author@example.com', name: 'author', username: 'author', projects_limit: 10, state: 'active') } let(:member) { users.create!(email: 'member@example.com', notification_email: 'member@example.com', name: 'member', username: 'member', projects_limit: 10, state: 'active') } @@ -32,13 +33,14 @@ describe Gitlab::BackgroundMigration::UserMentions::CreateResourceUserMention, s before do # build personal namespaces and routes for users - mentioned_users.each { |u| u.becomes(User).save! } + mentioned_users.each do |u| + namespace = namespaces.create!(path: u.username, name: u.name, runners_token: "my-token-u#{u.id}", owner_id: u.id, type: nil) + routes.create!(path: namespace.path, source_type: 'Namespace', source_id: namespace.id) + end # build namespaces and routes for groups mentioned_groups.each do |gr| - gr.name += '-org' - gr.path += '-org' - gr.becomes(Namespace).save! + routes.create!(path: gr.path, source_type: 'Namespace', source_id: gr.id) end end |