Skip to content

Commit 21c9d1b

Browse files
committed
Autocorrect new rubocop rspec rules
All these changes are from using regexes when include could be used
1 parent fb522a5 commit 21c9d1b

27 files changed

Lines changed: 40 additions & 40 deletions

spec/concepts/class_member/create_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
it 'returns the error message in the operation response' do
8585
response = described_class.call(school_class:, students:, teachers:)
86-
expect(response[:error]).to match(/No valid school members provided/)
86+
expect(response[:error]).to include('No valid school members provided')
8787
end
8888

8989
it 'sent the exception to Sentry' do

spec/concepts/class_member/delete_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
it 'returns the error message in the operation response' do
3535
response = described_class.call(school_class:, class_member_id:)
36-
expect(response[:error]).to match(/does-not-exist/)
36+
expect(response[:error]).to include('does-not-exist')
3737
end
3838

3939
it 'sent the exception to Sentry' do

spec/concepts/feedback/create_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@
8080

8181
it 'returns the error message in the operation response' do
8282
response = described_class.call(feedback_params:)
83-
expect(response[:error]).to match(/Error creating feedback/)
83+
expect(response[:error]).to include('Error creating feedback')
8484
end
8585

8686
it 'raises school project not found error when no school project' do
8787
response = described_class.call(feedback_params:)
88-
expect(response[:error]).to match(/School project must exist/)
88+
expect(response[:error]).to include('School project must exist')
8989
end
9090

9191
it 'sent the exception to Sentry' do

spec/concepts/feedback/delete_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
it 'returns the error message in the operation response' do
3636
response = described_class.call(feedback_id:)
37-
expect(response[:error]).to match(/does-not-exist/)
37+
expect(response[:error]).to include('does-not-exist')
3838
end
3939

4040
it 'sent the exception to Sentry' do

spec/concepts/lesson/create_copy_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199

200200
it 'returns the error message in the operation response' do
201201
response = described_class.call(lesson:, lesson_params:)
202-
expect(response[:error]).to match(/Error creating copy of lesson/)
202+
expect(response[:error]).to include('Error creating copy of lesson')
203203
end
204204

205205
it 'sent the exception to Sentry' do

spec/concepts/lesson/create_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
it 'returns the error message in the operation response' do
115115
response = described_class.call(lesson_params:)
116-
expect(response[:error]).to match(/Error creating lesson/)
116+
expect(response[:error]).to include('Error creating lesson')
117117
end
118118

119119
it 'sent the exception to Sentry' do
@@ -151,7 +151,7 @@
151151

152152
it 'returns the error message in the operation response' do
153153
response = described_class.call(lesson_params:)
154-
expect(response[:error]).to match(/Error creating lesson/)
154+
expect(response[:error]).to include('Error creating lesson')
155155
end
156156

157157
it 'sent the exception to Sentry' do

spec/concepts/lesson/update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
it 'returns the error message in the operation response' do
5959
response = described_class.call(lesson:, lesson_params:)
60-
expect(response[:error]).to match(/Error updating lesson/)
60+
expect(response[:error]).to include('Error updating lesson')
6161
end
6262

6363
it 'sent the exception to Sentry' do

spec/concepts/project/update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
end
9494

9595
it 'returns an error message' do
96-
expect(update[:error]).to match(/Projects with instructions must belong to a school/)
96+
expect(update[:error]).to include('Projects with instructions must belong to a school')
9797
end
9898
end
9999

spec/concepts/school/delete_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
it 'returns the error message in the operation response' do
5050
response = described_class.call(school_id:)
51-
expect(response[:error]).to match(/does-not-exist/)
51+
expect(response[:error]).to include('does-not-exist')
5252
end
5353

5454
it 'sent the exception to Sentry' do

spec/concepts/school/update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
it 'returns the error message in the operation response' do
4242
response = described_class.call(school:, school_params:)
43-
expect(response[:error]).to match(/Error updating school/)
43+
expect(response[:error]).to include('Error updating school')
4444
end
4545

4646
it 'sent the exception to Sentry' do

0 commit comments

Comments
 (0)