Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Specify inline attachment in spec

Kabiru Mwenjae3a358e1660a
diff --git a/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb b/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
index 370d85c645e..94071bf4a6a 100644
--- a/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
+++ b/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
@@ -130,7 +130,7 @@ RSpec.describe "Work package activity tab comment editor",
wp_page.wait_for_activity_tab
end
- it "can upload an image to a comment via drag & drop in editor" do
+ it "can upload an image to a comment as an inline attachment" do
activity_tab.add_comment(text: "Sample text", save: false)
activity_tab.expect_focus_on_editor
@@ -138,9 +138,14 @@ RSpec.describe "Work package activity tab comment editor",
editor.drag_attachment(image_fixture.path, "An image caption")
editor.wait_until_upload_progress_toaster_cleared
+ attachment = Attachment.where(author: admin).last
+ expect(attachment.container).to be_nil
+
click_on "Submit"
expect(page).to have_content("An image caption")
+ journal = work_package.reload.journals.last
+ expect(journal.attachments).to contain_exactly(attachment)
end
end
end