Skip to content

Commit 50f261e

Browse files
author
Scott
committed
listing_lessons_spec - add test to check for project in json response
1 parent 9a9dd63 commit 50f261e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/features/lesson/listing_lessons_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
expect(data.first[:user_name]).to eq('School Teacher')
4141
end
4242

43+
it 'responds with the project JSON' do
44+
get('/api/lessons', headers:)
45+
data = JSON.parse(response.body, symbolize_names: true)
46+
expected_project = JSON.parse(lesson.project.to_json(only: %i[identifier project_type]), symbolize_names: true)
47+
48+
expect(data.first[:project]).to eq(expected_project)
49+
end
50+
4351
# rubocop:disable RSpec/ExampleLength
4452
it "responds with nil attributes for the user if their user profile doesn't exist" do
4553
user_id = SecureRandom.uuid

0 commit comments

Comments
 (0)