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

Restore custom style rendering with css variables

Oliver Günther154afc3c7fe2
diff --git a/spec/models/design_color_spec.rb b/spec/models/design_color_spec.rb
index 1f845c7a833..54be9bbeab6 100644
--- a/spec/models/design_color_spec.rb
+++ b/spec/models/design_color_spec.rb
@@ -31,12 +31,12 @@ RSpec.describe DesignColor, type: :model do
describe "#get_hexcode" do
it "returns hexcode if present" do
primary_color
- expect(primary_color.get_hexcode).to eq("#3493B3")
+ expect(primary_color.hexcode).to eq("#3493B3")
end
- it "returns default hexcode if hexcode not present" do
- expect(described_class.new(variable: "primary-color").get_hexcode)
- .to eq(default_primary)
+ it "returns nil hexcode if hexcode not present" do
+ expect(described_class.new(variable: "primary-color").hexcode)
+ .to be_Nil
end
end
diff --git a/spec/views/layouts/base.html.erb_spec.rb b/spec/views/layouts/base.html.erb_spec.rb
index 0b8a70772e7..7729e17fa64 100644
--- a/spec/views/layouts/base.html.erb_spec.rb
+++ b/spec/views/layouts/base.html.erb_spec.rb
@@ -200,7 +200,7 @@ describe 'layouts/base', type: :view do
primary_color
render
expect(rendered).to render_template partial: 'custom_styles/_inline_css'
- expect(rendered).to match /--primary-color:\s*#{primary_color.get_hexcode}/
+ expect(rendered).to match /--primary-color:\s*#{primary_color.hexcode}/
end
end