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

`Query::Results`: fixing whitespace [ci-skip]

Sebastian Fiedlschuster6aa1fa2903a9
diff --git a/app/models/query/timestamps.rb b/app/models/query/timestamps.rb
index 378da2646b5..099a267db40 100644
--- a/app/models/query/timestamps.rb
+++ b/app/models/query/timestamps.rb
@@ -31,7 +31,7 @@ module Query::Timestamps
included do
serialize :timestamps, Array
-
+
# Returns the timestamps the query should be evaluated at.
#
# In the database, the timestamps are stored as ISO8601 strings.
@@ -47,10 +47,10 @@ module Query::Timestamps
}
return timestamps.any? ? timestamps : [Timestamp.now]
end
-
+
def timestamps=(array)
super(array.collect { |element| element.respond_to?(:iso8601) ? element.iso8601 : element })
end
end
-
+
end
diff --git a/spec/models/query/results_filter_on_historic_data_spec.rb b/spec/models/query/results_filter_on_historic_data_spec.rb
index 1beddef5c79..ae0208951ed 100644
--- a/spec/models/query/results_filter_on_historic_data_spec.rb
+++ b/spec/models/query/results_filter_on_historic_data_spec.rb
@@ -51,19 +51,19 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
member_in_project: project_1,
member_with_permissions: [:view_work_packages])
end
-
-
+
+
describe "[prelims]" do
specify "the work package has a journal entry with the historic description" do
expect(work_package.journals.count).to eq 2
expect(work_package.journals.first.data.description).to eq "This is the original description of the work package"
end
-
+
specify "the work package has its current description" do
expect(work_package.description).to eq "This is the current description of the work package"
end
end
-
+
describe "#work_packages" do
let(:query) do
login_as(user_1)
@@ -74,7 +74,7 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
end
let(:results) { query.results }
subject { results.work_packages }
-
+
describe "filter for description containing 'current'" do
let(:search_term) { 'current' }
it "includes the work package matching today" do
@@ -88,7 +88,7 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
expect(subject).not_to include work_package
end
end
-
+
describe "when searching current and historic work packages" do
before { query.timestamps = [historic_time, Time.zone.now] }
@@ -106,7 +106,7 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
end
end
end
-
+
describe "when searching only historic work packages" do
before { query.timestamps = [historic_time] }
@@ -119,7 +119,7 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
describe "filter for description containing 'original'" do
let(:search_term) { 'original' }
-
+
it "includes the work package matching in the past" do
expect(subject).to include work_package
end
@@ -129,7 +129,7 @@ describe ::Query::Results, 'Filter on historic data', type: :model, with_mail: f
end
end
end
-
+
describe "when searching only pre-historic work packages (i.e. when the work package does not exist yet)" do
before { query.timestamps = [pre_historic_time] }