diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb')
-rw-r--r-- | spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb b/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb index 3de24f577ab..7019d5d4212 100644 --- a/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb +++ b/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' -describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204006 do +RSpec.describe Gitlab::BackgroundMigration::RemoveRestrictedTodos do + let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } let(:todos) { table(:todos) } @@ -18,8 +19,9 @@ describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204 users.create(id: 2, email: 'reporter@example.com', projects_limit: 10) users.create(id: 3, email: 'guest@example.com', projects_limit: 10) - projects.create!(id: 1, name: 'project-1', path: 'project-1', visibility_level: 0, namespace_id: 1) - projects.create!(id: 2, name: 'project-2', path: 'project-2', visibility_level: 0, namespace_id: 1) + namespace = namespaces.create(name: 'gitlab-org', path: 'gitlab-org') + projects.create!(id: 1, name: 'project-1', path: 'project-1', visibility_level: 0, namespace_id: namespace.id) + projects.create!(id: 2, name: 'project-2', path: 'project-2', visibility_level: 0, namespace_id: namespace.id) issues.create(id: 1, project_id: 1) issues.create(id: 2, project_id: 2) @@ -92,7 +94,7 @@ describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204 context 'when issues are restricted to project members' do before do - project_features.create(issues_access_level: 10, project_id: 2) + project_features.create(issues_access_level: 10, pages_access_level: 10, project_id: 2) end it 'removes non members issue todos' do @@ -102,7 +104,7 @@ describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204 context 'when merge requests are restricted to project members' do before do - project_features.create(merge_requests_access_level: 10, project_id: 2) + project_features.create(merge_requests_access_level: 10, pages_access_level: 10, project_id: 2) end it 'removes non members issue todos' do @@ -112,7 +114,7 @@ describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204 context 'when repository and merge requests are restricted to project members' do before do - project_features.create(repository_access_level: 10, merge_requests_access_level: 10, project_id: 2) + project_features.create(repository_access_level: 10, merge_requests_access_level: 10, pages_access_level: 10, project_id: 2) end it 'removes non members commit and merge requests todos' do |