Skip to content

Commit a96b650

Browse files
committed
Fix Rubocop offenses
1 parent c6c101b commit a96b650

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

app/views/comments/_task_comments.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.comment-block
33
= t('.info.no_comments')
44

5-
-else
5+
- else
66
= link_to task_comments_path(@task), class: 'refresh', remote: true do
77
span.fa-solid.fa-arrows-rotate
88
=< t('.button.refresh_comments')

spec/controllers/account_links_controller_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
end
3939

4040
describe 'GET #new' do
41-
include_examples 'new examples', klass: AccountLink, resource: :account_link
41+
it_behaves_like 'new examples', klass: AccountLink, resource: :account_link
4242
end
4343

4444
describe 'GET #edit' do
45-
include_examples 'edit examples', klass: AccountLink, resource: :account_link
45+
it_behaves_like 'edit examples', klass: AccountLink, resource: :account_link
4646
end
4747

4848
describe 'POST #create' do
49-
include_examples 'create examples', klass: AccountLink, resource: :account_link
49+
it_behaves_like 'create examples', klass: AccountLink, resource: :account_link
5050

5151
it 'with valid attributes redirects to the user' do
5252
post :create, params: empty_params.merge(account_link: valid_attributes)
@@ -61,7 +61,7 @@
6161
attributes
6262
end
6363

64-
include_examples 'update examples', klass: AccountLink, resource: :account_link
64+
it_behaves_like 'update examples', klass: AccountLink, resource: :account_link
6565

6666
context 'with valid attributes' do
6767
it 'updates the requested account_link' do
@@ -80,7 +80,7 @@
8080
end
8181

8282
describe 'DELETE #destroy' do
83-
include_examples 'destroy examples', klass: AccountLink, resource: :account_link
83+
it_behaves_like 'destroy examples', klass: AccountLink, resource: :account_link
8484
it 'with valid attributes redirects to the user' do
8585
account_link = AccountLink.create! valid_attributes.merge(user:)
8686
delete :destroy, params: empty_params.merge(id: account_link.to_param)

spec/controllers/bridges/lom/tasks_controller_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
before { allow(Task).to receive(:find).with(task.id.to_s).and_return(task) }
3131

3232
context 'when allowed to access the LOM' do
33-
include_examples 'is a valid LOM response'
33+
it_behaves_like 'is a valid LOM response'
3434
end
3535

3636
context 'when not allowed to access the LOM' do
@@ -58,19 +58,19 @@
5858
context 'when no license is specified' do
5959
let(:license) { nil }
6060

61-
include_examples 'is a valid LOM response'
61+
it_behaves_like 'is a valid LOM response'
6262
end
6363

6464
context 'when ratings are available' do
6565
before { create(:rating, task:, user:) }
6666

67-
include_examples 'is a valid LOM response'
67+
it_behaves_like 'is a valid LOM response'
6868
end
6969

7070
context 'when comments are available' do
7171
before { create(:comment, task:, user:) }
7272

73-
include_examples 'is a valid LOM response'
73+
it_behaves_like 'is a valid LOM response'
7474
end
7575
end
7676
end

spec/controllers/collections_controller_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@
712712
end
713713
end
714714

715-
include_examples 'redirects to collection and flashes message successfully'
715+
it_behaves_like 'redirects to collection and flashes message successfully'
716716

717717
context 'when push_tasks returns errors' do
718718
let(:push_task_return) { ['error'] }
@@ -731,19 +731,19 @@
731731
context 'when user is not in collection' do
732732
let(:users) { [create(:user)] }
733733

734-
include_examples 'redirect to collection-list and flashes not authorized'
734+
it_behaves_like 'redirect to collection-list and flashes not authorized'
735735
end
736736

737737
context 'when the account link is shared with the requesting user' do
738738
let(:account_link) { create(:account_link, user: create(:user), shared_users: Array.wrap(user)) }
739739

740-
include_examples 'redirects to collection and flashes message successfully'
740+
it_behaves_like 'redirects to collection and flashes message successfully'
741741
end
742742

743743
context 'when the account link is neither owned by nor shared with the requesting user' do
744744
let(:account_link_user) { create(:user) }
745745

746-
include_examples 'redirect to collection-list and flashes not authorized'
746+
it_behaves_like 'redirect to collection-list and flashes not authorized'
747747
end
748748
end
749749
# get collections_all # adminview

spec/controllers/labels_controller_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
before { sign_in user }
4646

4747
context 'without requesting more info' do
48-
include_examples 'json without the number of referrencing tasks'
48+
it_behaves_like 'json without the number of referrencing tasks'
4949
end
5050

5151
context 'when requesting more info' do
5252
subject(:get_request) { get :search, params: params.merge(more_info: true) }
5353

54-
include_examples 'json without the number of referrencing tasks'
54+
it_behaves_like 'json without the number of referrencing tasks'
5555
end
5656
end
5757

@@ -61,7 +61,7 @@
6161
before { sign_in admin }
6262

6363
context 'when not requesting more info' do
64-
include_examples 'json without the number of referrencing tasks'
64+
it_behaves_like 'json without the number of referrencing tasks'
6565
end
6666

6767
context 'when requesting more info' do
@@ -122,20 +122,20 @@
122122
context 'with an invalid new label name' do
123123
let(:new_label_name) { '' }
124124

125-
include_examples 'error and flash message'
125+
it_behaves_like 'error and flash message'
126126
end
127127

128128
context 'with an already existing new label name' do
129129
let(:selected_labels) { labels[1..3] }
130130
let(:new_label_name) { labels.first.name }
131131

132-
include_examples 'error and flash message'
132+
it_behaves_like 'error and flash message'
133133
end
134134

135135
context 'with no labels to merge' do
136136
let(:selected_labels) { [] }
137137

138-
include_examples 'error and flash message'
138+
it_behaves_like 'error and flash message'
139139
end
140140

141141
context 'when the new label name is one of the selected labels except the first' do

spec/controllers/ratings_controller_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
expect { post_request }.to change { flash[:notice] }.to(I18n.t('common.notices.object_created', model: Rating.model_name.human))
4040
end
4141

42-
include_examples 'responds with the average_rating of the task'
42+
it_behaves_like 'responds with the average_rating of the task'
4343

4444
context 'when the user has already rated the task' do
4545
let!(:existing_rating) { task.ratings.create(user:, overall_rating: 1) }
@@ -56,7 +56,7 @@
5656
expect { post_request }.to change { flash[:notice] }.to(I18n.t('common.notices.object_updated', model: Rating.model_name.human))
5757
end
5858

59-
include_examples 'responds with the average_rating of the task'
59+
it_behaves_like 'responds with the average_rating of the task'
6060
end
6161

6262
context 'when user rates his own task' do
@@ -70,7 +70,7 @@
7070
expect { post_request }.to change { flash[:alert] }.to(I18n.t('ratings.handle_own_rating.error'))
7171
end
7272

73-
include_examples 'responds with the average_rating of the task'
73+
it_behaves_like 'responds with the average_rating of the task'
7474
end
7575
end
7676

@@ -81,7 +81,7 @@
8181
expect { post_request }.not_to change(Rating, :count)
8282
end
8383

84-
include_examples 'responds with the average_rating of the task'
84+
it_behaves_like 'responds with the average_rating of the task'
8585
end
8686
end
8787
end

spec/controllers/tasks_controller_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,27 @@
9090
context "when using filter keywords from #{description}" do
9191
let(:ransack_params) { {'fulltext_search' => keywords} }
9292

93-
include_examples 'shows task1'
93+
it_behaves_like 'shows task1'
9494
end
9595
end
9696
end
9797

9898
context 'when a label filter is used' do
9999
let(:ransack_params) { {'has_all_labels' => %w[l1 l3]} }
100100

101-
include_examples 'shows task1'
101+
it_behaves_like 'shows task1'
102102
end
103103

104104
context 'when a fulltext search filter and label filter are combined' do
105105
let(:ransack_params) { {'fulltext_search' => 'key1 key2', 'has_all_labels' => %w[l3]} }
106106

107-
include_examples 'shows task1'
107+
it_behaves_like 'shows task1'
108108
end
109109

110110
context 'when a programming language filter is used' do
111111
let(:ransack_params) { {'programming_language_id_in' => ruby_lang.id} }
112112

113-
include_examples 'shows task1'
113+
it_behaves_like 'shows task1'
114114
end
115115

116116
context 'when a second request without searchparams is made' do
@@ -984,12 +984,12 @@
984984
end
985985
end
986986

987-
include_examples 'renders success response'
987+
it_behaves_like 'renders success response'
988988

989989
context 'when the account link is shared with the requesting user' do
990990
let(:account_link) { create(:account_link, user: create(:user), shared_users: Array.wrap(user)) }
991991

992-
include_examples 'renders success response'
992+
it_behaves_like 'renders success response'
993993
end
994994

995995
context 'when the account link is neither owned by nor shared with the requesting user' do
@@ -1035,7 +1035,7 @@
10351035
end
10361036
end
10371037

1038-
include_examples 'renders success json'
1038+
it_behaves_like 'renders success json'
10391039

10401040
context 'when there is an error' do
10411041
let(:error) { 'error' }
@@ -1070,7 +1070,7 @@
10701070
context 'when the account link is shared with the requesting user' do
10711071
let(:account_link) { create(:account_link, user: create(:user), shared_users: Array.wrap(user)) }
10721072

1073-
include_examples 'renders success json'
1073+
it_behaves_like 'renders success json'
10741074
end
10751075

10761076
context 'when the account link is neither owned by nor shared with the requesting user' do
@@ -1124,7 +1124,7 @@
11241124
expect { post_request }.not_to change(Task, :count)
11251125
end
11261126

1127-
include_examples 'renders success response'
1127+
it_behaves_like 'renders success response'
11281128

11291129
context 'when push_type is create_new' do
11301130
let(:push_type) { 'create_new' }
@@ -1168,7 +1168,7 @@
11681168
context 'when the account link is shared with the requesting user' do
11691169
let(:account_link) { create(:account_link, user: create(:user), shared_users: Array.wrap(user)) }
11701170

1171-
include_examples 'renders success response'
1171+
it_behaves_like 'renders success response'
11721172
end
11731173

11741174
context 'when the account link is neither owned by nor shared with the requesting user' do

0 commit comments

Comments
 (0)