Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
freyavs committed Jul 27, 2023
1 parent 78c60f6 commit be8a401
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/controllers/series_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class SeriesControllerTest < ActionDispatch::IntegrationTest
end
end

test 'create series with missing course_id should 422' do
post series_index_url, params: { series: { name: 'Test series' }, format: :json }
assert_response :unprocessable_entity
assert_includes assigns(:series).errors.messages[:course_id], I18n.t('errors.messages.blank')
end

test 'update series should redirect to course' do
instance = update_request_expect(attr_hash: { series: { description: 'new description' } })
assert_redirected_to course_url(instance.course, series: instance, anchor: instance.anchor)
Expand Down

0 comments on commit be8a401

Please sign in to comment.