Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions spec/lib/tasks/for_education_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@
end

it 'adds two projects' do
lesson = Lesson.where(school_id: school.id)
expect(Project.where(lesson_id: lesson.pluck(:id)).length).to eq(2)
lessons = Lesson.where(school_id: school.id)
projects = Project.where(lesson_id: lessons.pluck(:id))

if projects.length != 2
$stdout.puts('Debug info for intermittent test')
lessons.each { |lesson| $stdout.puts(lesson.inspect) }
projects.each { |project| $stdout.puts(project.inspect) }
end

expect(projects.length).to eq(2)
end

it 'assigns a teacher' do
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

config.around(type: :task) do |example|
DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.strategy = :truncation

DatabaseCleaner.cleaning do
Rails.application.load_tasks
Expand Down