|
30 | 30 |
|
31 | 31 | require "spec_helper" |
32 | 32 |
|
33 | | -RSpec.describe "Project copy with sprints", :js, |
| 33 | +RSpec.describe "Project copy with sprints and buckets", :js, |
34 | 34 | with_good_job_batches: [CopyProjectJob, |
35 | 35 | Storages::CopyProjectFoldersJob, |
36 | 36 | SendCopyProjectStatusEmailJob] do |
|
42 | 42 | types: [type]) |
43 | 43 | end |
44 | 44 | shared_let(:sprint) { create(:sprint, project:, name: "Sprint A") } |
| 45 | + shared_let(:bucket) { create(:backlog_bucket, project:, name: "Bucket A") } |
45 | 46 | shared_let(:work_package) do |
46 | 47 | create(:work_package, project:, type:, subject: "Sprint story", sprint:) |
47 | 48 | end |
| 49 | + shared_let(:bucket_work_package) do |
| 50 | + create(:work_package, project:, type:, subject: "Bucket story", backlog_bucket: bucket) |
| 51 | + end |
48 | 52 |
|
49 | 53 | let(:general_settings_page) { Pages::Projects::Settings::General.new(project) } |
50 | 54 |
|
|
56 | 60 | login_as admin |
57 | 61 | end |
58 | 62 |
|
59 | | - it "assigns the copied work package to the copied sprint, not the source sprint" do |
| 63 | + it "assigns copied work packages to the copied sprint and bucket, not the source ones" do |
60 | 64 | general_settings_page.visit! |
61 | 65 | general_settings_page.click_copy_action |
62 | 66 |
|
|
76 | 80 |
|
77 | 81 | copied_work_package = copied_project.work_packages.find_by(subject: "Sprint story") |
78 | 82 | expect(copied_work_package.sprint).to eq(copied_sprint) |
| 83 | + |
| 84 | + copied_bucket = copied_project.backlog_buckets.find_by(name: "Bucket A") |
| 85 | + expect(copied_bucket).to be_present |
| 86 | + expect(copied_bucket.id).not_to eq(bucket.id) |
| 87 | + |
| 88 | + copied_bucket_work_package = copied_project.work_packages.find_by(subject: "Bucket story") |
| 89 | + expect(copied_bucket_work_package.backlog_bucket).to eq(copied_bucket) |
79 | 90 | end |
80 | 91 |
|
81 | 92 | def wait_for_copy_to_finish |
|
0 commit comments