@@ -152,7 +152,10 @@ class LearningPathsControllerTest < ActionController::TestCase
152152 assert_response :success
153153 assert assigns ( :learning_path )
154154 assert_select '.learning-path-topic' , count : 2
155+ assert_operator assigns ( :learning_path ) . topics . length , :> , 1
155156 assert_select '.learning-path-topic.single-topic' , count : 0
157+ refute assigns ( :learning_path ) . unordered?
158+ assert_select '.learning-path-topic.unordered' , count : 0
156159 end
157160
158161 test 'should show learning_path as json' do
@@ -571,4 +574,14 @@ class LearningPathsControllerTest < ActionController::TestCase
571574 assert_select '.learning-path-topic' , count : 1
572575 assert_select '.learning-path-topic.single-topic' , count : 1
573576 end
577+
578+ test 'displays unordered view when learning path is unordered' do
579+ learning_path = learning_paths ( :one )
580+ learning_path . update! ( unordered : true )
581+ get :show , params : { id : learning_path }
582+ assert_response :success
583+ assert assigns ( :learning_path )
584+ assert assigns ( :learning_path ) . unordered?
585+ assert_select '.learning-path-topic.unordered' , minimum : 1
586+ end
574587end
0 commit comments