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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
calm rubocop
Ivan Kuchin0ff8caa75a1d
diff --git a/app/models/custom_value/date_strategy.rb b/app/models/custom_value/date_strategy.rbindex 9b301376c96..523aab51d84 100644--- a/app/models/custom_value/date_strategy.rb+++ b/app/models/custom_value/date_strategy.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/spec/models/custom_value/date_strategy_spec.rb b/spec/models/custom_value/date_strategy_spec.rbindex 8aaed69a426..b6f5fdc9c9a 100644--- a/spec/models/custom_value/date_strategy_spec.rb+++ b/spec/models/custom_value/date_strategy_spec.rb@@ -33,32 +33,31 @@ require "spec_helper"RSpec.describe CustomValue::DateStrategy dolet(:instance) { described_class.new(custom_value) }let(:custom_value) do- double("CustomValue",- value:)+ instance_double(CustomValue, value:)enddescribe "#typed_value" dosubject { instance.typed_value }- context "value is some date string" do+ context "when value is a date string" dolet(:value) { "2015-01-03" }it { is_expected.to eql(Date.iso8601(value)) }end- context "value is not a date" do+ context "when value is not a date" dolet(:value) { "hello, world!" }it { is_expected.to be_nil }end- context "value is blank" do+ context "when value is blank" dolet(:value) { "" }it { is_expected.to be_nil }end- context "value is nil" do+ context "when value is nil" dolet(:value) { nil }it { is_expected.to be_nil }@@ -68,17 +67,15 @@ RSpec.describe CustomValue::DateStrategy dodescribe "#formatted_value" dosubject { instance.formatted_value }- context "value is some date string" do+ context "when value is some date string", with_settings: { date_format: "%Y-%m-%d" } dolet(:value) { "2015-01-03" }- context "date format", with_settings: { date_format: "%Y-%m-%d" } do- it "is the date" do- expect(subject).to eql value- end+ it "is the date" do+ expect(subject).to eql valueendend- context "value is blank" do+ context "when value is blank" dolet(:value) { "" }it "is a blank string" do@@ -86,7 +83,7 @@ RSpec.describe CustomValue::DateStrategy doendend- context "value is nil" do+ context "when value is nil" dolet(:value) { nil }it "is a blank string" do@@ -98,7 +95,7 @@ RSpec.describe CustomValue::DateStrategy dodescribe "#validate_type_of_value" dosubject { instance.validate_type_of_value }- context "value is valid date string" do+ context "when value is valid date string" dolet(:value) { "2015-01-03" }it "accepts" do@@ -106,7 +103,7 @@ RSpec.describe CustomValue::DateStrategy doendend- context "value is invalid date string in good format" do+ context "when value is invalid date string in good format" dolet(:value) { "2015-02-30" }it "rejects" do@@ -114,7 +111,7 @@ RSpec.describe CustomValue::DateStrategy doendend- context "value is date string in bad format" do+ context "when value is date string in bad format" dolet(:value) { "03.01.2015" }it "rejects" do@@ -122,7 +119,7 @@ RSpec.describe CustomValue::DateStrategy doendend- context "value is not a date string at all" do+ context "when value is not a date string at all" dolet(:value) { "chicken" }it "rejects" do@@ -130,7 +127,7 @@ RSpec.describe CustomValue::DateStrategy doendend- context "value is valid date" do+ context "when value is valid date" dolet(:value) { Date.iso8601("2015-01-03") }it "accepts" do