mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Add feature flag to relevant specs
This commit is contained in:
@@ -635,7 +635,7 @@ describe API::V3::WorkPackages::WorkPackageCollectionRepresenter do
|
||||
member_with_permissions: %i[view_work_packages view_file_links])
|
||||
end
|
||||
|
||||
context 'with baseline and current timestamps' do
|
||||
context 'with baseline and current timestamps', with_flag: { show_changes: true } do
|
||||
let(:timestamps) { [Timestamp.parse("2022-01-01T00:00:00Z"), Timestamp.parse("PT0S")] }
|
||||
|
||||
describe 'attributesByTimestamp' do
|
||||
|
||||
@@ -1418,7 +1418,7 @@ describe API::V3::WorkPackages::WorkPackageRepresenter do
|
||||
member_with_permissions: %i[view_work_packages view_file_links])
|
||||
end
|
||||
|
||||
describe 'attributesByTimestamp' do
|
||||
describe 'attributesByTimestamp', with_flag: { show_changes: true } do
|
||||
it 'states whether the work package matches the query filters at the timestamp' do
|
||||
expect(subject)
|
||||
.to be_json_eql(true.to_json)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe Journable::WithHistoricAttributes do
|
||||
describe Journable::WithHistoricAttributes, with_flag: { show_changes: true } do
|
||||
create_shared_association_defaults_for_work_package_factory
|
||||
|
||||
shared_let(:baseline_time) { "2022-01-01".to_time }
|
||||
|
||||
@@ -28,7 +28,10 @@
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe Query::Results, 'Filter on historic data', with_mail: false do
|
||||
describe Query::Results,
|
||||
'Filter on historic data',
|
||||
with_flag: { show_changes: true },
|
||||
with_mail: false do
|
||||
let(:historic_time) { "2022-08-01".to_datetime }
|
||||
let(:pre_historic_time) { historic_time - 1.day }
|
||||
let(:recent_time) { 1.hour.ago }
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe Query::Timestamps do
|
||||
describe Query::Timestamps, with_flag: { show_changes: true } do
|
||||
describe "#timestamps" do
|
||||
subject { query.timestamps }
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
require 'spec_helper'
|
||||
require 'rack/test'
|
||||
|
||||
describe "POST /api/v3/queries/form" do
|
||||
describe "POST /api/v3/queries/form", with_flag: { show_changes: true } do
|
||||
include API::V3::Utilities::PathHelper
|
||||
|
||||
let(:path) { api_v3_paths.create_query_form }
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe "POST /api/v3/queries" do
|
||||
describe "POST /api/v3/queries", with_flag: { show_changes: true } do
|
||||
shared_let(:user) { create(:admin) }
|
||||
shared_let(:status) { create(:status) }
|
||||
shared_let(:project) { create(:project) }
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
require 'spec_helper'
|
||||
require 'rack/test'
|
||||
|
||||
describe 'API v3 Query resource', content_type: :json do
|
||||
describe 'API v3 Query resource',
|
||||
content_type: :json,
|
||||
with_flag: { show_changes: true } do
|
||||
include Rack::Test::Methods
|
||||
include API::V3::Utilities::PathHelper
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
require 'spec_helper'
|
||||
require 'rack/test'
|
||||
|
||||
describe "POST /api/v3/queries/form" do
|
||||
describe "POST /api/v3/queries/form", with_flag: { show_changes: true } do
|
||||
include API::V3::Utilities::PathHelper
|
||||
|
||||
let(:path) { api_v3_paths.query_form(query.id) }
|
||||
|
||||
@@ -113,7 +113,7 @@ describe "PATCH /api/v3/queries/:id" do
|
||||
login_as user
|
||||
end
|
||||
|
||||
describe "updating a query" do
|
||||
describe "updating a query", with_flag: { show_changes: true } do
|
||||
before do
|
||||
header "Content-Type", "application/json"
|
||||
patch "/api/v3/queries/#{query.id}", params.to_json
|
||||
|
||||
@@ -238,7 +238,7 @@ describe 'API v3 Work package resource',
|
||||
end
|
||||
end
|
||||
|
||||
context 'when providing timestamps' do
|
||||
context 'when providing timestamps', with_flag: { show_changes: true } do
|
||||
subject do
|
||||
get path
|
||||
last_response
|
||||
|
||||
@@ -235,7 +235,7 @@ describe API::V3::WorkPackageCollectionFromQueryService,
|
||||
end
|
||||
end
|
||||
|
||||
context 'when timestamps are given' do
|
||||
context 'when timestamps are given', with_flag: { show_changes: true } do
|
||||
let(:timestamps) { [Timestamp.parse("P-1Y"), Timestamp.parse("oneWeekAgo@12:00"), Timestamp.now] }
|
||||
let(:query) { build_stubbed(:query, timestamps:) }
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ describe UpdateQueryFromParamsService,
|
||||
end
|
||||
end
|
||||
|
||||
context "when providing timestamps" do
|
||||
context "when providing timestamps", with_flag: { show_changes: true } do
|
||||
let(:timestamps) do
|
||||
[
|
||||
Timestamp.parse("2022-10-29T23:01:23Z"),
|
||||
|
||||
@@ -97,7 +97,7 @@ shared_examples_for 'GET individual query' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when providing valid timestamps' do
|
||||
context 'when providing valid timestamps', with_flag: { show_changes: true } do
|
||||
let(:path) do
|
||||
params = CGI.escape(timestamps)
|
||||
"#{base_path}?timestamps=#{params}"
|
||||
|
||||
Reference in New Issue
Block a user