mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-29 16:34:32 +08:00
Fix failing tests
This commit is contained in:
parent
16f99afbc0
commit
0adb8b2b61
2 changed files with 4 additions and 0 deletions
|
@ -35,6 +35,7 @@ class Team < ApplicationRecord
|
|||
has_many :repositories, dependent: :destroy
|
||||
has_many :reports, inverse_of: :team, dependent: :destroy
|
||||
|
||||
attr_accessor :without_intro_demo
|
||||
after_create :generate_intro_demo
|
||||
|
||||
def default_view_state
|
||||
|
@ -312,6 +313,8 @@ class Team < ApplicationRecord
|
|||
include FirstTimeDataGenerator
|
||||
|
||||
def generate_intro_demo
|
||||
return if without_intro_demo
|
||||
|
||||
user = User.find(created_by_id)
|
||||
if user.created_teams.order(:created_at).first == self
|
||||
seed_demo_data(user, self)
|
||||
|
|
|
@ -6,5 +6,6 @@ FactoryBot.define do
|
|||
sequence(:name) { |n| "My team-#{n}" }
|
||||
description { Faker::Lorem.sentence }
|
||||
space_taken { 1048576 }
|
||||
without_intro_demo true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue