1+ # frozen_string_literal: true
2+
13require 'spec_helper'
24
35describe CoursesController , type : :controller do
@@ -43,7 +45,7 @@ def get_index_json(options = {})
4345
4446 result = get_index_json
4547
46- expect ( result [ 'courses' ] . map { |c | c [ 'name' ] } ) . to eq ( %w( Course1 Course2 Course3 ) )
48+ expect ( result [ 'courses' ] . map { |c | c [ 'name' ] } ) . to eq ( %w[ Course1 Course2 Course3 ] )
4749 end
4850 end
4951 end
@@ -275,8 +277,8 @@ def get_show_json(options = {}, parse_json = true)
275277 organization_id : @organization . slug ,
276278 id : @course . id ,
277279 empty_group : {
278- soft : { static : '1.1.2000' , unlock : '' } ,
279- hard : { static : '' , unlock : 'unlock + 2 weeks' }
280+ soft : { static : '1.1.2000' , unlock : '' } ,
281+ hard : { static : '' , unlock : 'unlock + 2 weeks' }
280282 }
281283
282284 @course . exercise_group_by_name ( '' ) . exercises ( false ) . each do |e |
@@ -298,14 +300,14 @@ def get_show_json(options = {}, parse_json = true)
298300 organization_id : @organization . slug ,
299301 id : @course . id ,
300302 group : {
301- group1 : {
302- soft : { static : '1.1.2000' , unlock : 'unlock + 7 days' } ,
303- hard : { static : '' , unlock : 'unlock + 2 months' }
304- } ,
305- group2 : {
306- soft : { static : '2.2.2000' , unlock : '' } ,
307- hard : { static : '3.3.2000' , unlock : '' }
308- }
303+ group1 : {
304+ soft : { static : '1.1.2000' , unlock : 'unlock + 7 days' } ,
305+ hard : { static : '' , unlock : 'unlock + 2 months' }
306+ } ,
307+ group2 : {
308+ soft : { static : '2.2.2000' , unlock : '' } ,
309+ hard : { static : '3.3.2000' , unlock : '' }
310+ }
309311 }
310312
311313 @course . exercise_group_by_name ( 'group1' ) . exercises ( false ) . each do |e |
@@ -392,7 +394,7 @@ def get_show_json(options = {}, parse_json = true)
392394 @course . exercises . create ( name : 'e3' )
393395
394396 post :save_unlocks , organization_id : @organization . slug , id : @course . id ,
395- empty_group : { '0' => '1.2.2000' , '1' => 'exercise e1' , '2' => '5% of e2' }
397+ empty_group : { '0' => '1.2.2000' , '1' => 'exercise e1' , '2' => '5% of e2' }
396398
397399 @course . exercise_group_by_name ( '' ) . exercises ( false ) . each do |e |
398400 spec = e . unlock_spec_obj . raw_spec
0 commit comments