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
at_timestamp: rubocop refactoring
Sebastian Fiedlschuster1c39be6342c3
diff --git a/spec/models/journable/historic_active_record_relation_spec.rb b/spec/models/journable/historic_active_record_relation_spec.rbindex ae8d73db0cc..33a5403e799 100644--- a/spec/models/journable/historic_active_record_relation_spec.rb+++ b/spec/models/journable/historic_active_record_relation_spec.rb@@ -384,6 +384,7 @@ describe Journable::HistoricActiveRecordRelation dodescribe "#first" dodescribe "for columns that don't exist in the journal-data table" dolet(:column_name) { :lock_version }+subject { historic_relation.first.send(column_name) }specify "the column name does exist in the journable table" do@@ -395,7 +396,7 @@ describe Journable::HistoricActiveRecordRelation doendit "has the attribute with null value" do- expect(historic_relation.first.attributes_before_type_cast[column_name]).to be nil+ expect(historic_relation.first.attributes_before_type_cast[column_name]).to be_nilendit "has the typecasted value matching the journable class's data type" dodiff --git a/spec/models/journable/timestamps_spec.rb b/spec/models/journable/timestamps_spec.rbindex d3002ef3521..f410d976f29 100644--- a/spec/models/journable/timestamps_spec.rb+++ b/spec/models/journable/timestamps_spec.rb@@ -26,10 +26,6 @@# See COPYRIGHT and LICENSE files for more details.#++-# rubocop:disable RSpec/ClassCheck-# Prefer `kind_of?` over `is_a?` because it reads well before vowel and consonant sounds.-# E.g.: `relation.kind_of? ActiveRecord::Relation`-require 'spec_helper'describe Journable::Timestamps do@@ -87,16 +83,16 @@ describe Journable::Timestamps dosubject { WorkPackage.at_timestamp(timestamp) }it "returns a historic active-record relation" do- expect(subject).to be_kind_of Journable::HistoricActiveRecordRelation- expect(subject).to be_kind_of ActiveRecord::Relation+ expect(subject).to be_a Journable::HistoricActiveRecordRelation+ expect(subject).to be_an ActiveRecord::Relationenddescribe "chaining a where clause" dosubject { WorkPackage.at_timestamp(timestamp).where(assigned_to_id: 1) }it "still returns a historic active-record relation" do- expect(subject).to be_kind_of Journable::HistoricActiveRecordRelation- expect(subject).to be_kind_of ActiveRecord::Relation+ expect(subject).to be_a Journable::HistoricActiveRecordRelation+ expect(subject).to be_an ActiveRecord::Relationendend@@ -356,7 +352,7 @@ describe Journable::Timestamps doit "returns an error because maximum returns a float rather than a relation" doexpect { subject }.to raise_error NoMethodError- expect(WorkPackage.maximum(:estimated_hours)).to be_kind_of Float+ expect(WorkPackage.maximum(:estimated_hours)).to be_a Floatendendend@@ -560,7 +556,7 @@ describe Journable::Timestamps doendit "has the attribute with null value" do- expect(subject.attributes_before_type_cast[column_name]).to be nil+ expect(subject.attributes_before_type_cast[column_name]).to be_nilendit "has the typecasted value matching the journable class's data type" do@@ -646,5 +642,3 @@ describe Journable::Timestamps doendendend--# rubocop:enable RSpec/ClassCheck