Skip to content

Commit

Permalink
Update spec to match new desired behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-contreras committed Jul 24, 2024
1 parent c8ca856 commit 58dd83f
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions spec/features/work_packages/bulk/move_work_package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,22 @@
context "when the target project does not have the type" do
let!(:project2) { create(:project, name: "Target", types: [type2]) }

it "does moves the work package and changes the type", :with_cuprite do
it "does not move the work package", :with_cuprite do
click_on "Move and follow"
wait_for_reload
page.find(".inline-edit--container.subject", text: work_package.subject)
page.find_by_id("projects-menu", text: "Target")

expect(page)
.to have_css(".op-toast.-error",
text: I18n.t(:"work_packages.bulk.none_could_be_saved",
total: 1))

# Should NOT have moved
child_wp.reload
work_package.reload
expect(work_package.project_id).to eq(project2.id)
expect(work_package.type_id).to eq(type2.id)
expect(child_wp.project_id).to eq(project2.id)
expect(child_wp.type_id).to eq(type2.id)
expect(work_package.project_id).to eq(project.id)
expect(work_package.type_id).to eq(type.id)
expect(child_wp.project_id).to eq(project.id)
expect(child_wp.type_id).to eq(type.id)
end
end

Expand Down Expand Up @@ -168,26 +171,6 @@
expect(child_wp.project_id).to eq(project.id)
expect(child_wp.type_id).to eq(type.id)
end

it "does moves the work package when the required field is set" do
select "Risk", from: "Type"
fill_in required_cf.name, with: "1"

# Clicking move and follow might be broken due to the location.href
# in the refresh-on-form-changes component
retry_block do
click_on "Move and follow"
end

expect(page).to have_css(".op-toast.-success")

child_wp.reload
work_package.reload
expect(work_package.project_id).to eq(project2.id)
expect(work_package.type_id).to eq(type2.id)
expect(child_wp.project_id).to eq(project2.id)
expect(child_wp.type_id).to eq(type2.id)
end
end
end

Expand Down

0 comments on commit 58dd83f

Please sign in to comment.