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
avoid static ids in spec
ulferts049f3cb6f563
diff --git a/modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_parsing_spec.rb b/modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_parsing_spec.rbindex bed8fdf36ad..89dccef58ea 100644--- a/modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_parsing_spec.rb+++ b/modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_parsing_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' do+describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'parsing' doinclude ::API::V3::Utilities::PathHelperlet(:time_entry) do@@ -52,11 +52,11 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' dolet(:representer) dodescribed_class.create(time_entry, current_user: user, embed_links: true)end- let(:custom_field13) do- FactoryBot.build_stubbed(:time_entry_custom_field, field_format: 'user', id: 13)+ let(:user_custom_field) do+ FactoryBot.build_stubbed(:time_entry_custom_field, field_format: 'user')end- let(:custom_field11) do- FactoryBot.build_stubbed(:time_entry_custom_field, field_format: 'text', id: 11)+ let(:test_custom_field) do+ FactoryBot.build_stubbed(:time_entry_custom_field, field_format: 'text')endlet(:hash) do@@ -72,7 +72,7 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' do"href" => api_v3_paths.work_package(work_package2.id)},- "customField13" => {+ "customField#{user_custom_field.id}" => {"href" => api_v3_paths.user(user2.id)}},@@ -81,7 +81,7 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' do"raw" => "some comment"},"spentOn" => "2017-07-28",- "customField11" => {+ "customField#{test_custom_field.id}" => {"raw" => "some text"}}@@ -90,7 +90,7 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' dobefore doallow(time_entry).to receive(:available_custom_fields)- .and_return([custom_field11, custom_field13])+ .and_return([test_custom_field, user_custom_field])enddescribe '_links' do@@ -122,7 +122,7 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' doit 'updates the custom value' dotime_entry = representer.from_hash(hash)- expect(time_entry.custom_field_values.detect { |cv| cv.custom_field_id == custom_field13.id }.value)+ expect(time_entry.custom_field_values.detect { |cv| cv.custom_field_id == user_custom_field.id }.value).to eql(user2.id.to_s)endend@@ -171,7 +171,7 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' doit 'updates the custom value' dotime_entry = representer.from_hash(hash)- expect(time_entry.custom_field_values.detect { |cv| cv.custom_field_id == custom_field11.id }.value)+ expect(time_entry.custom_field_values.detect { |cv| cv.custom_field_id == test_custom_field.id }.value).to eql("some text")endend