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

add a test to check if the file is deleted

Behrokh Satarnejad809f6d9747ce
diff --git a/spec/features/custom_styles/tabs_spec.rb b/spec/features/custom_styles/tabs_spec.rb
index 9c1a7e9d690..4a1309eeb55 100644
--- a/spec/features/custom_styles/tabs_spec.rb
+++ b/spec/features/custom_styles/tabs_spec.rb
@@ -44,6 +44,8 @@ RSpec.describe "interface tab" do
context "with EE token", with_ee: %i[define_custom_style] do
let(:custom_style) { create (:custom_style_with_logo) }
+ let(:image) { "logo" }
+ let!(:file_path) { custom_style.send(image).file.path }
before do
login_as(admin)
@@ -80,7 +82,8 @@ RSpec.describe "interface tab" do
expect(page).to have_current_path custom_style_path(tab: "branding")
# remove the logo and redirect to the branding tab
- custom_style.send `:remove_logo`
+ custom_style.send :remove_logo
+ expect(File.exist?(file_path)).to be false
expect(page).to have_current_path custom_style_path(tab: "branding")
end