• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codebar / planner / 28091726455

24 Jun 2026 10:20AM UTC coverage: 94.95% (-0.4%) from 95.333%
28091726455

Pull #2649

github

mroderick
review: strip unrelated refactoring, add email OIDC scope

- Remove InvitationManager model files and spec/models/ copies
  added by the original refactoring
- Restore original app/services/invitation_manager.rb and specs
- Revert locale and volunteer page changes unrelated to auth
- Add 'email' to OIDC scope for email claim per OIDC spec
Pull Request #2649: feat: add magic link auth provider with code exchange

211 of 240 new or added lines in 4 files covered. (87.92%)

3 existing lines in 2 files now uncovered.

3629 of 3822 relevant lines covered (94.95%)

41.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.0
/app/controllers/subscriptions_controller.rb
1
class SubscriptionsController < ApplicationController
6✔
2
  before_action :has_access?
6✔
3

4
  def index
6✔
5
    @mailing_list = MailingListForm.new
33✔
6
    @groups = Group.includes(:chapter).references(:chapter).order('chapters.city')
33✔
7
    @member = MemberPresenter.new(current_user)
33✔
8
  end
9

10
  def create
6✔
11
    @subscription = Subscription.new(group_id: group_id, member: current_user)
13✔
12

13
    if @subscription.save
13✔
14
      send_welcome_email(current_user, @subscription)
13✔
15
      flash[:notice] = I18n.t('subscriptions.messages.group.subscribe', chapter: @subscription.group.chapter.city,
13✔
16
                                                                        role: @subscription.group.name)
17
    else
UNCOV
18
      flash[:notice] = @subscription.errors.inspect
×
19
    end
20
    redirect_back fallback_location: root_path
13✔
21
  end
22

23
  def destroy
6✔
24
    # Don't error if subscription is not found
25
    subscription = current_user.subscriptions.find_by(group_id: group_id)
3✔
26
    subscription&.destroy
3✔
27

28
    # Instead, rely on the group's existence (rather than the subscription)
29
    group = Group.find(group_id)
3✔
30
    flash[:notice] = I18n.t('subscriptions.messages.group.unsubscribe',
3✔
31
                            chapter: group.chapter.city,
32
                            role: group.name)
33

34
    redirect_back fallback_location: root_path
3✔
35
  end
36

37
  private
6✔
38

39
  def group_id
6✔
40
    params.expect(subscription: [:group_id])[:group_id]
19✔
41
  end
42

43
  def send_welcome_email(member, subscription)
6✔
44
    return if member.received_welcome_for?(subscription)
13✔
45

46
    MemberMailer.welcome_for_subscription(subscription).deliver_now
9✔
47
  end
48
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc