Skip to content

Commit

Permalink
statistics_calculations_spec: login user
Browse files Browse the repository at this point in the history
We need a user to create packages but avoid creating a home
project for it as it breaks the test's expectation
  • Loading branch information
coolo committed May 23, 2019
1 parent f3eba71 commit 154c57f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/spec/lib/statistics_calculations_spec.rb
Expand Up @@ -4,12 +4,15 @@

RSpec.describe StatisticsCalculations do
describe 'get_latest_updated' do
let(:user) { create(:confirmed_user) }
let(:package_1) { create(:package) }
let(:package_2) { create(:package, name: 'my_package') }
let(:package_3) { create(:package) }
let(:project_without_package) { create(:project) }

before do
Configuration.update(allow_user_to_create_home_project: false)
User.session = user
# Create all objects and their relations with the correct timestamps
Timecop.freeze(30.seconds.ago) { package_1 }
Timecop.freeze(1.minute.ago) { package_2 }
Expand Down

0 comments on commit 154c57f

Please sign in to comment.