Skip to content

Commit 5f58be7

Browse files
committed
linting
1 parent 4fb8959 commit 5f58be7

7 files changed

Lines changed: 29 additions & 28 deletions

File tree

decidim-meetings/app/events/decidim/meetings/update_meeting_event.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def notification_title
1111
I18n.t(
1212
"notification_title",
1313
scope: i18n_scope,
14-
changed_fields: changed_fields,
14+
changed_fields:,
1515
resource_title: translated_attribute(resource.title),
16-
resource_path: resource_path
16+
resource_path:
1717
).html_safe
1818
end
1919

decidim-meetings/spec/commands/admin/copy_meeting_fields_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module Admin
99
subject { described_class.new(form, meeting) }
1010

1111
let(:organization) { create(:organization) }
12-
let(:participatory_process) { create(:participatory_process, organization: organization) }
12+
let(:participatory_process) { create(:participatory_process, organization:) }
1313
let(:current_component) { create(:component, manifest_name: "meetings", participatory_space: participatory_process) }
14-
let(:user) { create(:user, :admin, :confirmed, organization: organization) }
14+
let(:user) { create(:user, :admin, :confirmed, organization:) }
1515
let(:meeting) { create(:meeting, :published, component: current_component, **meeting_attributes) }
1616

1717
let(:meeting_attributes) do

decidim-meetings/spec/commands/join_waitlist_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ module Decidim::Meetings
77
subject { described_class.new(meeting, form) }
88

99
let(:organization) { create(:organization) }
10-
let(:participatory_process) { create(:participatory_process, organization: organization) }
10+
let(:participatory_process) { create(:participatory_process, organization:) }
1111
let(:component) { create(:component, manifest_name: :meetings, participatory_space: participatory_process) }
1212
let(:available_slots) { 2 }
1313
let(:meeting) do
1414
create(:meeting,
15-
component: component,
15+
component:,
1616
registrations_enabled: true,
17-
available_slots: available_slots)
17+
available_slots:)
1818
end
1919

20-
let(:user) { create(:user, :confirmed, organization: organization, notifications_sending_frequency: "none") }
20+
let(:user) { create(:user, :confirmed, organization:, notifications_sending_frequency: "none") }
2121
let(:form) do
2222
Decidim::Meetings::JoinMeetingForm.new.with_context(
2323
current_user: user
@@ -35,7 +35,7 @@ module Decidim::Meetings
3535

3636
context "when all conditions are met" do
3737
before do
38-
create_list(:registration, available_slots, meeting: meeting, status: :registered)
38+
create_list(:registration, available_slots, meeting:, status: :registered)
3939
end
4040

4141
it "broadcasts ok" do
@@ -58,7 +58,7 @@ module Decidim::Meetings
5858

5959
context "when the user is already registered" do
6060
before do
61-
create(:registration, meeting: meeting, user: user, status: :registered)
61+
create(:registration, meeting:, user:, status: :registered)
6262
end
6363

6464
it "broadcasts invalid" do
@@ -74,7 +74,7 @@ module Decidim::Meetings
7474

7575
context "when the form is invalid" do
7676
before do
77-
create_list(:registration, available_slots, meeting: meeting, status: :registered)
77+
create_list(:registration, available_slots, meeting:, status: :registered)
7878
allow(form).to receive(:valid?).and_return(false)
7979
end
8080

decidim-meetings/spec/controllers/decidim/meetings/registrations_controller_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Decidim::Meetings
2727
context "with available slots" do
2828
it "creates registration and redirects" do
2929
expect do
30-
post :create, params: params
30+
post :create, params:
3131
end.to change(Registration, :count).by(1)
3232

3333
expect(flash[:notice]).to eq(I18n.t("registrations.create.success", scope: "decidim.meetings"))
@@ -36,10 +36,10 @@ module Decidim::Meetings
3636
end
3737

3838
context "when no available slots" do
39-
let!(:registrations) { create_list(:registration, 10, meeting: meeting) }
39+
let!(:registrations) { create_list(:registration, 10, meeting:) }
4040

4141
it "shows error message" do
42-
post :create, params: params
42+
post(:create, params:)
4343

4444
expect(flash[:alert]).to eq(I18n.t("registrations.create.invalid", scope: "decidim.meetings"))
4545
expect(response).to redirect_to(meeting_path(meeting))
@@ -49,7 +49,7 @@ module Decidim::Meetings
4949

5050
context "when user not authenticated" do
5151
it "redirects to login" do
52-
post :create, params: params
52+
post(:create, params:)
5353
expect(response).to redirect_to("/users/sign_in")
5454
end
5555
end
@@ -76,15 +76,15 @@ module Decidim::Meetings
7676
meeting.update!(
7777
registrations_enabled: true,
7878
registration_form_enabled: true,
79-
questionnaire: questionnaire
79+
questionnaire:
8080
)
8181
end
8282

8383
context "with valid params" do
8484
context "when joining directly" do
8585
it "answers questionnaire and redirects" do
8686
expect do
87-
post :respond, params: params
87+
post :respond, params:
8888
end.to change { meeting.registrations.count }.by(1)
8989

9090
expect(flash[:notice]).to eq(I18n.t("registrations.create.success", scope: "decidim.meetings"))
@@ -94,11 +94,11 @@ module Decidim::Meetings
9494

9595
context "when joining waitlist" do
9696
let(:meeting) { create(:meeting, component:, available_slots: 10) }
97-
let!(:registrations) { create_list(:registration, 10, meeting: meeting) }
97+
let!(:registrations) { create_list(:registration, 10, meeting:) }
9898

9999
it "adds user to waitlist and redirects" do
100100
expect do
101-
post :respond, params: params
101+
post :respond, params:
102102
end.to change { meeting.registrations.where(status: :waiting_list).count }.by(1)
103103

104104
expect(flash[:notice]).to eq(I18n.t("registrations.waitlist.success", scope: "decidim.meetings"))
@@ -116,7 +116,7 @@ module Decidim::Meetings
116116
end
117117

118118
it "shows error message" do
119-
post :respond, params: params
119+
post(:respond, params:)
120120

121121
expect(flash[:alert]).to eq(I18n.t("response.invalid", scope: "decidim.forms.questionnaires"))
122122
expect(response).to render_template("decidim/forms/questionnaires/show")
@@ -126,15 +126,15 @@ module Decidim::Meetings
126126

127127
describe "POST join_waitlist" do
128128
let(:meeting) { create(:meeting, component:, available_slots: 10) }
129-
let!(:registrations) { create_list(:registration, 10, meeting: meeting) }
129+
let!(:registrations) { create_list(:registration, 10, meeting:) }
130130
let(:params) { { meeting_id: meeting.id } }
131131

132132
before { sign_in user }
133133

134134
context "when meeting has no available slots" do
135135
it "adds user to waitlist" do
136136
expect do
137-
post :join_waitlist, params: params
137+
post :join_waitlist, params:
138138
end.to change(Registration.on_waiting_list, :count).by(1)
139139

140140
expect(flash[:notice]).to eq(I18n.t("registrations.waitlist.success", scope: "decidim.meetings"))
@@ -151,7 +151,7 @@ module Decidim::Meetings
151151

152152
it "destroys registration" do
153153
expect do
154-
delete :destroy, params: params
154+
delete :destroy, params:
155155
end.to change(Registration, :count).by(-1)
156156

157157
expect(flash[:notice]).to match(/successfully/)

decidim-meetings/spec/forms/admin/meeting_form_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module Decidim::Meetings
189189

190190
expect(described_class.from_model(meeting).decidim_category_id).to eq(category_id)
191191
end
192-
192+
193193
describe "when reminder_enabled is false" do
194194
let(:reminder_enabled) { false }
195195

@@ -221,6 +221,7 @@ module Decidim::Meetings
221221
it { is_expected.to be_valid }
222222
end
223223
end
224+
224225
describe "services_to_persist" do
225226
subject { form.services_to_persist }
226227

decidim-meetings/spec/system/admin/admin_manages_meetings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
visit decidim_admin.root_path
341341
expect(page).to have_content("created the #{translated(attributes[:title])} meeting on the")
342342
end
343-
343+
344344
context "when the venue has not been decided yet" do
345345
it "creates a new meeting without an address" do
346346
click_on "New meeting"

decidim-meetings/spec/system/meeting_waiting_list_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def leave_meeting(user)
5858

5959
context "when the meeting has no available slots" do
6060
before do
61-
create_list(:registration, available_slots, meeting: meeting)
61+
create_list(:registration, available_slots, meeting:)
6262
end
6363

6464
context "when the user is not logged in" do
@@ -111,13 +111,13 @@ def leave_meeting(user)
111111

112112
context "when the meeting is full and a user cancels their registration" do
113113
context "and there are users on the waiting list" do
114-
let!(:registrations) { create_list(:registration, available_slots, meeting: meeting) }
114+
let!(:registrations) { create_list(:registration, available_slots, meeting:) }
115115
let(:users_on_waitlist) { create_list(:user, 5, :confirmed, organization:) }
116116
let(:first_waitlist_user) { users_on_waitlist.first }
117117

118118
let!(:waitlist_entries) do
119119
users_on_waitlist.map.with_index do |user, index|
120-
create(:registration, meeting: meeting, user: user, status: "waiting_list", created_at: Time.current - index.minutes)
120+
create(:registration, meeting:, user:, status: "waiting_list", created_at: Time.current - index.minutes)
121121
end
122122
end
123123

0 commit comments

Comments
 (0)