Add missing test to delete a draft version

We weren't testing this action anywhere.
This commit is contained in:
Javi Martín
2024-03-21 02:09:15 +01:00
parent cb3bea8eec
commit 20d3725709

View File

@@ -74,6 +74,15 @@ describe "Admin legislation draft versions", :admin do
end
end
scenario "Delete" do
version = create(:legislation_draft_version, body: "Version 1")
visit edit_admin_legislation_process_draft_version_path(version.process, version)
click_link "Delete"
expect(page).to have_content "Draft deleted successfully"
end
context "Changing content with the markdown editor" do
let(:prompt) { "You've edited the text without saving it. Do you confirm to leave the page?" }
let(:version) { create(:legislation_draft_version, body: "Version 1") }