summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 12:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 12:08:54 +0000
commit50ae4065530c4eafbeb7c5ff2c462c48c02947ca (patch)
treea88b718bd281c58fcd9e60fd49585e5ca1dca26c /spec/tasks
parentbe37a0ee5e3e3dbb967266248f0f46f14a9931e2 (diff)
downloadgitlab-ce-50ae4065530c4eafbeb7c5ff2c462c48c02947ca.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/seed/group_seed_rake_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/seed/group_seed_rake_spec.rb b/spec/tasks/gitlab/seed/group_seed_rake_spec.rb
new file mode 100644
index 00000000000..bc217281594
--- /dev/null
+++ b/spec/tasks/gitlab/seed/group_seed_rake_spec.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+require 'rake_helper'
+
+describe 'gitlab:seed:group_seed rake task', :sidekiq do
+ let(:username) { 'group_seed' }
+ let!(:user) { create(:user, username: username) }
+ let(:task_params) { [2, username] }
+
+ before do
+ Rake.application.rake_require('tasks/gitlab/seed/group_seed')
+ end
+
+ subject { run_rake_task('gitlab:seed:group_seed', task_params) }
+
+ it 'performs group seed successfully' do
+ expect { subject }.not_to raise_error
+
+ group = user.groups.first
+
+ expect(user.groups.count).to be 3
+ expect(group.projects.count).to be 2
+ expect(group.members.count).to be 3
+ expect(group.milestones.count).to be 2
+ end
+end