Skip to content

Commit a84926b

Browse files
committed
Add test for default status being returned
1 parent 7cae8f8 commit a84926b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

spec/features/lesson/listing_lessons_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,17 @@
306306
expect(data.size).to eq(1)
307307
expect(data.first[:status]).to eq('submitted')
308308
end
309+
310+
it 'includes the default status when no transitions have happened' do
311+
authenticated_in_hydra_as(student)
312+
create(:class_student, school_class:, student_id: student.id)
313+
314+
lesson.project.update!(school: school)
315+
316+
get('/api/lessons', headers:)
317+
data = JSON.parse(response.body, symbolize_names: true)
318+
319+
expect(data.first[:status]).to eq('unsubmitted')
320+
end
309321
end
310322
end

0 commit comments

Comments
 (0)