Commit 9b657ad5 authored by Ash McKenzie's avatar Ash McKenzie

Update mock creation to use established style

parent 2e08c928
......@@ -347,7 +347,8 @@ describe Gitlab::UsageData do
let_it_be(:user) { create(:user, group_view: :security_dashboard) }
before do
Timecop.travel 2.days.ago do
[29, 2].each do |n|
Timecop.travel n.days.ago do
create(:ci_build, name: 'container_scanning', user: user)
create(:ci_build, name: 'dast', user: user)
create(:ci_build, name: 'dependency_scanning', user: user)
......@@ -355,6 +356,7 @@ describe Gitlab::UsageData do
create(:ci_build, name: 'sast', user: user)
end
end
end
it 'includes accurate usage_activity_by_stage data' do
expect(described_class.uncached_data[:usage_activity_by_stage_monthly][:secure]).to eq(
......@@ -368,9 +370,11 @@ describe Gitlab::UsageData do
end
it 'combines license_scanning into license_management' do
Timecop.travel 2.days.ago do
[29, 2].each do |n|
Timecop.travel n.days.ago do
create(:ci_build, name: 'license_scanning', user: user)
end
end
expect(described_class.uncached_data[:usage_activity_by_stage_monthly][:secure]).to eq(
user_preferences_group_overview_security_dashboard: 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment