Skip to content

Commit 316d434

Browse files
committed
Code style for tests
1 parent afc0942 commit 316d434

File tree

127 files changed

+748
-534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+748
-534
lines changed

spec/controllers/auths_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe AuthsController, type: :controller do

spec/controllers/certificates_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe CertificatesController, type: :controller do

spec/controllers/course_notifications_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
require 'cancan/matchers'
35

spec/controllers/course_templates_controller_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe CourseTemplatesController, type: :controller do
@@ -43,7 +45,7 @@
4345
end
4446
it 'should show course templates' do
4547
get :index, {}
46-
expect(assigns(:course_templates).map(&:name)).to eq(%w(template1 template2 template3))
48+
expect(assigns(:course_templates).map(&:name)).to eq(%w[template1 template2 template3])
4749
end
4850
end
4951

@@ -330,7 +332,7 @@
330332

331333
it 'should show course templates' do
332334
get :list_for_teachers, organization_id: @organization.slug
333-
expect(assigns(:course_templates).map(&:name)).to eq(%w(template1 template2 template3))
335+
expect(assigns(:course_templates).map(&:name)).to eq(%w[template1 template2 template3])
334336
end
335337
end
336338
end

spec/controllers/courses_controller_spec.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 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

spec/controllers/emails_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe EmailsController, type: :controller do

spec/controllers/exercise_status_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe ExerciseStatusController, type: :controller do

spec/controllers/exercises_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe ExercisesController, type: :controller do

spec/controllers/feedback_answers_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
require 'cancan/matchers'
35

spec/controllers/feedback_replies_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
require 'cancan/matchers'
35

0 commit comments

Comments
 (0)