Skip to content

Commit

Permalink
Merge pull request #5283 from dodona-edu/dependabot/bundler/rubocop-e…
Browse files Browse the repository at this point in the history
…e88cc48b1

Bump the rubocop group with 3 updates
  • Loading branch information
bmesuere authored Jan 9, 2024
2 parents 68ceacc + d14ba2f commit 7ac454d
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 77 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Style/HashSyntax:

FactoryBot/ConsistentParenthesesStyle:
EnforcedStyle: omit_parentheses
FactoryBot/ExcessiveCreateList:
MaxAmount: 50

Minitest/MultipleAssertions:
Enabled: false
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ group :development do
gem 'web-console', '~> 4.2.1'

gem 'rb-readline', '~> 0.5.5' # require for irb
gem 'rubocop-capybara', '~> 2.19.0'
gem 'rubocop-factory_bot', '~> 2.24'
gem 'rubocop-minitest', '~> 0.34.3'
gem 'rubocop-capybara', '~> 2.20.0'
gem 'rubocop-factory_bot', '~> 2.25'
gem 'rubocop-minitest', '~> 0.34.4'
gem 'rubocop-rails', '~> 2.23.1'

# for opening letters
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ GEM
webfinger (~> 2.0)
orm_adapter (0.5.0)
parallel (1.24.0)
parser (3.2.2.4)
parser (3.3.0.2)
ast (~> 2.4.1)
racc
premailer (1.18.0)
Expand Down Expand Up @@ -429,7 +429,7 @@ GEM
rb-readline (0.5.5)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.8.3)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
responders (3.1.1)
Expand All @@ -450,11 +450,11 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-minitest (0.34.3)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-minitest (0.34.4)
rubocop (>= 1.39, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
Expand Down Expand Up @@ -620,9 +620,9 @@ DEPENDENCIES
rails-i18n (~> 7.0.8)
rb-readline (~> 0.5.5)
rouge (= 4.2.0)
rubocop-capybara (~> 2.19.0)
rubocop-factory_bot (~> 2.24)
rubocop-minitest (~> 0.34.3)
rubocop-capybara (~> 2.20.0)
rubocop-factory_bot (~> 2.25)
rubocop-minitest (~> 0.34.4)
rubocop-rails (~> 2.23.1)
ruby-saml (~> 1.16.0)
rubyzip (~> 2.3.2)
Expand Down
78 changes: 39 additions & 39 deletions test/system/annotations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Navigate to code tab' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'
within '.code-listing' do
@code_lines.each { |code_line| assert_text code_line }
end
end

test 'Submission annotation button is present for each code line' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within '.code-listing' do
(1..@code_lines.length).each do |index|
Expand All @@ -59,7 +59,7 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Click on submission annotation button' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click
Expand All @@ -74,15 +74,15 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Enter annotation and send' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click

initial = 'This is a single line comment'
within 'form.annotation-submission' do
find('textarea.annotation-submission-input').fill_in with: initial
click_button 'Comment'
click_on 'Comment'
end

within '.annotation' do
Expand All @@ -94,7 +94,7 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Character counter updates when typing' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click
Expand All @@ -111,12 +111,12 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Cancel annotation form' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click
within 'form.annotation-submission' do
click_button 'Cancel'
click_on 'Cancel'
end

assert_no_css '.annotation'
Expand All @@ -127,7 +127,7 @@ class AnnotationsTest < ApplicationSystemTestCase
annot = create :annotation, submission: @instance, user: @zeus

visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within '.annotation' do
assert_text annot.annotation_text
Expand All @@ -141,7 +141,7 @@ class AnnotationsTest < ApplicationSystemTestCase

within 'form.annotation-submission' do
find('textarea.annotation-submission-input').fill_in with: replacement
click_button 'Update'
click_on 'Update'
end

within '.annotation' do
Expand All @@ -154,7 +154,7 @@ class AnnotationsTest < ApplicationSystemTestCase
annot = create :annotation, submission: @instance, user: @zeus

visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within '.annotation' do
assert_text annot.annotation_text
Expand All @@ -171,22 +171,22 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'User moving back and forth over code and tests' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

click_link 'Correctheid'
click_link 'Code'
click_on 'Correctheid'
click_on 'Code'

annot = create :annotation, submission: @instance, user: @zeus
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
assert_text annot.annotation_text
end

click_link 'Correctheid'
click_link 'Code'
click_on 'Correctheid'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -197,7 +197,7 @@ class AnnotationsTest < ApplicationSystemTestCase
test 'Edit valid annotation -- Too large input text' do
annot = create :annotation, submission: @instance, user: @zeus
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -224,7 +224,7 @@ class AnnotationsTest < ApplicationSystemTestCase
test 'Edit valid annotation -- Zero length input text' do
annot = create :annotation, submission: @instance, user: @zeus
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -237,12 +237,12 @@ class AnnotationsTest < ApplicationSystemTestCase
replacement = ''
within 'form.annotation-submission' do
find('textarea.annotation-submission-input').fill_in with: replacement
click_button 'Update'
click_on 'Update'
end

# Cancel the form
within 'form.annotation-submission' do
click_button 'Cancel'
click_on 'Cancel'
end

# Check if the view is correct without reloading
Expand All @@ -253,7 +253,7 @@ class AnnotationsTest < ApplicationSystemTestCase

# After reload, make sure no replacing has taken place
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -265,34 +265,34 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Enter invalid annotation and send - No content' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click

initial = ''
within 'form.annotation-submission' do
find('textarea.annotation-submission-input').fill_in with: initial
click_button 'Comment'
click_on 'Comment'

# Assuming the update did not go trough
# If the creation went trough, the cancel button would not exist anymore

click_button 'Cancel'
click_on 'Cancel'
end

assert_selector '.annotation', count: 0

# After reload, make sure no creation has taken place
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 0
end

test 'Enter invalid annotation and send - Content too long' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

find('tr#line-1').hover
find('.annotation-button a').click
Expand All @@ -310,14 +310,14 @@ class AnnotationsTest < ApplicationSystemTestCase

test 'Enter global annotation' do
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

click_button 'Add global comment'
click_on 'Add global comment'

initial = Faker::Lorem.words(number: 128).join(' ')
within 'd-annotation-form' do
find('textarea.annotation-submission-input').fill_in with: initial
click_button 'Comment'
click_on 'Comment'
end

assert_selector '.annotation', count: 1
Expand All @@ -328,7 +328,7 @@ class AnnotationsTest < ApplicationSystemTestCase

# After reload, make sure creation has taken place
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -340,7 +340,7 @@ class AnnotationsTest < ApplicationSystemTestCase
test 'Edit global annotation' do
annot = create :annotation, submission: @instance, user: @zeus, line_nr: nil
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -354,7 +354,7 @@ class AnnotationsTest < ApplicationSystemTestCase
replacement = Faker::Lorem.words(number: 32).join(' ')
within 'form.annotation-submission' do
find('textarea.annotation-submission-input').fill_in with: replacement
click_button 'Update'
click_on 'Update'
end
within '.annotation' do
assert_no_text old_text
Expand All @@ -363,7 +363,7 @@ class AnnotationsTest < ApplicationSystemTestCase

# After reload, make sure creation has taken place
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

assert_selector '.annotation', count: 1
within '.annotation' do
Expand All @@ -375,7 +375,7 @@ class AnnotationsTest < ApplicationSystemTestCase
test 'Can reply to an annotation' do
create :annotation, submission: @instance, user: @zeus
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

thread = find('d-thread')
within thread do
Expand All @@ -388,7 +388,7 @@ class AnnotationsTest < ApplicationSystemTestCase
answer_field = find('textarea')
answer_field.fill_in with: answer

click_button 'Reply'
click_on 'Reply'

assert_selector '.annotation', count: 2
end
Expand All @@ -398,7 +398,7 @@ class AnnotationsTest < ApplicationSystemTestCase
annot = create :annotation, submission: @instance, user: @zeus
create :annotation, submission: @instance, user: @zeus, thread_root: annot
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within 'd-thread' do
assert_selector '.annotation', count: 2
Expand All @@ -415,7 +415,7 @@ class AnnotationsTest < ApplicationSystemTestCase
annot = create :annotation, submission: @instance, user: @zeus
create :annotation, submission: @instance, user: @zeus, thread_root: annot
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within 'd-thread' do
assert_selector '.annotation', count: 2
Expand All @@ -440,7 +440,7 @@ class AnnotationsTest < ApplicationSystemTestCase
create :annotation, submission: @instance, user: @zeus, thread_root: annot
create :annotation, submission: @instance, user: @zeus, thread_root: annot
visit(submission_path(id: @instance.id))
click_link 'Code'
click_on 'Code'

within 'd-thread' do
assert_selector '.annotation', count: 3
Expand Down
4 changes: 2 additions & 2 deletions test/system/courses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class CoursesTest < ApplicationSystemTestCase
assert_selector 'd-filter-tabs li:first-child a.active'
assert_selector '#courses-table-wrapper tbody tr', count: 2

find('d-filter-tabs').click_link 'All courses'
find('d-filter-tabs').click_on 'All courses'

assert_selector 'd-filter-tabs li:nth-of-type(3) a.active'
assert_selector '#courses-table-wrapper tbody tr', count: 4
find('d-filter-tabs').click_link 'My courses'
find('d-filter-tabs').click_on 'My courses'

assert_selector 'd-filter-tabs li:nth-of-type(4) a.active'
assert_selector '#courses-table-wrapper tbody tr', count: 1
Expand Down
Loading

0 comments on commit 7ac454d

Please sign in to comment.