Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 2 additions & 58 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit`
# on 2026-07-28 06:26:09 UTC using RuboCop version 1.88.2.
# on 2026-07-28 06:52:06 UTC using RuboCop version 1.88.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -585,43 +585,6 @@ RSpec/ContextWording:
- 'spec/support/shared_examples/behaves_like_invitable.rb'
- 'spec/support/shared_examples/behaves_like_managing_workshop_attendance.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/models/address_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterExampleGroup:
Exclude:
- 'spec/features/admin/manage_sponsor_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterFinalLet:
Exclude:
- 'spec/lib/tasks/delete_member_rake_spec.rb'
- 'spec/models/sponsor_spec.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterHook:
Exclude:
- 'spec/controllers/admin/member_search_controller_spec.rb'
- 'spec/models/workshop_invitation_spec.rb'
- 'spec/models/workshop_spec.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterSubject:
Exclude:
- 'spec/models/event_spec.rb'
- 'spec/models/meeting_spec.rb'
- 'spec/models/workshop_invitation_spec.rb'
- 'spec/models/workshop_spec.rb'

# Offense count: 57
# Configuration parameters: Max, CountAsOne.
RSpec/ExampleLength:
Expand Down Expand Up @@ -690,12 +653,6 @@ RSpec/ExpectChange:
- 'spec/features/member/login_spec.rb'
- 'spec/models/feedback_spec.rb'

# Offense count: 2
RSpec/ExpectInHook:
Exclude:
- 'spec/controllers/admin/invitations_controller_spec.rb'
- 'spec/support/shared_examples/behaves_like_managing_workshop_attendance.rb'

# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand All @@ -710,12 +667,6 @@ RSpec/HookArgument:
- 'spec/presenters/sponsor_presenter_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/HooksBeforeExamples:
Exclude:
- 'spec/support/shared_examples/behaves_like_managing_workshop_attendance.rb'

# Offense count: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand Down Expand Up @@ -820,7 +771,7 @@ RSpec/MetadataStyle:
- 'spec/features/viewing_pages_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 134
# Offense count: 135
# Configuration parameters: Max.
RSpec/MultipleExpectations:
Exclude:
Expand Down Expand Up @@ -923,13 +874,6 @@ RSpec/NamedSubject:
- 'spec/policies/testimonial_policy_spec.rb'
- 'spec/policies/workshop_policy_spec.rb'

# Offense count: 2
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/lib/services/flodesk_spec.rb'

# Offense count: 42
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/admin/invitations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

login admin
request.env["HTTP_REFERER"] = "/admin/member/3"

expect(invitation.attending).to be_nil
end

it "Successfuly updates an invitation" do
expect(invitation.attending).to be_nil

put :update, params: { id: invitation.token, workshop_id: workshop.id, attending: "true" }

expect(invitation.reload.attending).to be true
Expand Down
4 changes: 4 additions & 0 deletions spec/controllers/admin/member_search_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
before do
get :index
end

it "redirects to the home page" do
expect(response).to redirect_to(root_path)
end
Expand All @@ -19,6 +20,7 @@
login_as_admin(member)
get :index
end

it "shows user the search page" do
expect(response).to have_http_status(:ok)
end
Expand All @@ -29,6 +31,7 @@
allow(fake_relation).to receive(:select).with(any_args).and_return([fake_juliet])
get :index, params: { member_search: { name: "Juliet", callback_url: root_path } }
end

it "redirects to the calling service" do
expect(response).to have_http_status(:found)

Expand All @@ -47,6 +50,7 @@
allow(fake_relation).to receive(:select).with(any_args).and_return([fake_juliet, fake_romeo])
get :index, params: { member_search: { name: 'e', callback_url: root_path } }
end

it "presents the found members on the index page" do
expect(response).to have_http_status(:ok)
end
Expand Down
1 change: 1 addition & 0 deletions spec/features/admin/manage_sponsor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
expect(page).to have_content 'Office is located on the third floor.'
end
end

context 'with existing avatar' do
it 'shows the current avatar on the edit page' do
sponsor = Fabricate(:sponsor)
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/services/flodesk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
check = ->(request_body) { request_body == payload }
stub.post('/subscribers', check) { [200, {}, '{}'] }

client.subscribe(**payload)
expect(client.subscribe(**payload)).to include(status: 200)

stub.verify_stubbed_calls
end
Expand All @@ -49,7 +49,7 @@
# Faraday's `stub.delete` does not accept body at the time of writing
stub.send(:new_stub, :delete, "/subscribers/#{payload[:email]}/segments", {}, check) { [200, {}, '{}'] }

client.unsubscribe(**payload)
expect(client.unsubscribe(**payload)).to include(status: 200)

stub.verify_stubbed_calls
end
Expand Down
1 change: 1 addition & 0 deletions spec/lib/tasks/delete_member_rake_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RSpec.describe 'rake member:delete', type: :task do
let!(:member) { Fabricate.create(:member) }

before do
allow($stdout).to receive(:puts)
end
Expand Down
3 changes: 0 additions & 3 deletions spec/models/address_spec.rb

This file was deleted.

1 change: 1 addition & 0 deletions spec/models/event_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RSpec.describe Event do
subject(:event) { Fabricate(:event) }

include_examples "Invitable", :invitation, :event
include_examples DateTimeConcerns, :event

Expand Down
1 change: 1 addition & 0 deletions spec/models/meeting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

context 'validations' do
subject(:meeting) { Fabricate(:meeting) }

it { is_expected.to validate_presence_of(:date_and_time) }
it { is_expected.to validate_presence_of(:ends_at) }
it { should belong_to(:venue) }
Expand Down
1 change: 1 addition & 0 deletions spec/models/sponsor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
context 'scopes' do
describe 'searching by_name' do
let!(:search_sponsor) { Fabricate(:sponsor, name: 'codebar') }

before do
Fabricate.times(2, :sponsor)
end
Expand Down
2 changes: 2 additions & 0 deletions spec/models/workshop_invitation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RSpec.describe WorkshopInvitation do
subject(:workshop_invitation) { Fabricate(:workshop_invitation) }

it_behaves_like InvitationConcerns, :workshop_invitation, :workshop

context 'defaults' do
Expand All @@ -14,6 +15,7 @@

context 'if Student invitation' do
before { allow(subject).to receive(:student_attending?).and_return(true) }

it { is_expected.to validate_presence_of(:tutorial) }
it { is_expected.to validate_presence_of(:tutorial).on(:waitinglist) }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/models/workshop_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RSpec.describe Workshop do
subject(:workshop) { Fabricate(:workshop) }

include_examples "Invitable", :workshop_invitation, :workshop
include_examples DateTimeConcerns, :workshop

Expand Down Expand Up @@ -40,6 +41,7 @@

context 'if virtual' do
before { allow(subject).to receive(:virtual?).and_return(true) }

it { is_expected.to validate_presence_of(:slack_channel) }
it { is_expected.to validate_presence_of(:slack_channel_link) }
it { is_expected.to validate_numericality_of(:student_spaces).is_greater_than(0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@
click_on 'Attend'

expect(page).to have_content('See you at the workshop')
end

after do
visit workshop_path(workshop_auto_rsvp_in_past)
expect(page).to have_button('Manage your invitation')
end
Expand Down