Skip to content

Commit

Permalink
Merge pull request #1712 from etalab/scout/clean-useless-code
Browse files Browse the repository at this point in the history
  • Loading branch information
skelz0r authored Oct 31, 2024
2 parents 42bc40d + 631ee42 commit 2db817d
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 307 deletions.
20 changes: 0 additions & 20 deletions app/interactors/user/notify_datapass_of_token_ownership.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/mailers/api_entreprise/user_mailer.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/mailers/api_particulier/user_mailer.rb

This file was deleted.

27 changes: 0 additions & 27 deletions app/mailers/concerns/user_mailer_commons.rb

This file was deleted.

3 changes: 1 addition & 2 deletions app/organizers/api_entreprise/user/o_auth_login.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class APIEntreprise::User::OAuthLogin < ApplicationOrganizer
organize User::FindOrCreateThroughOAuth,
User::UpdateOAuthAPIGouvId,
User::NotifyDatapassOfTokenOwnership
User::UpdateOAuthAPIGouvId
end
3 changes: 1 addition & 2 deletions app/organizers/api_particulier/user/o_auth_login.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class APIParticulier::User::OAuthLogin < ApplicationOrganizer
organize User::FindOrCreateThroughOAuth,
User::UpdateOAuthAPIGouvId,
User::NotifyDatapassOfTokenOwnership
User::UpdateOAuthAPIGouvId
end
11 changes: 0 additions & 11 deletions spec/features/api_entreprise/signin_process_datapass_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
expect(user.oauth_api_gouv_id).to eq(unknown_api_gouv_id)
end

it 'sends an email to DataPass to update the authorization request owner' do
expect { subject }
.to have_enqueued_mail(APIEntreprise::UserMailer, :notify_datapass_for_data_reconciliation)
.with(user, 'api_entreprise')
end

it 'redirects to the user profile' do
subject

Expand All @@ -79,11 +73,6 @@
context 'when the user signs in the second time (and more)' do
let!(:user) { create(:user) }

it 'does not send any email to DataPass' do
expect { subject }
.not_to have_enqueued_mail(APIEntreprise::UserMailer, :notify_datapass_for_data_reconciliation)
end

it 'redirects to the user profile' do
subject

Expand Down
11 changes: 0 additions & 11 deletions spec/features/api_particulier/signin_process_datapass_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@
expect(user.oauth_api_gouv_id).to eq(unknown_api_gouv_id)
end

it 'sends an email to DataPass to update the authorization request owner' do
expect { subject }
.to have_enqueued_mail(APIParticulier::UserMailer, :notify_datapass_for_data_reconciliation)
.with(user, 'api_particulier')
end

it 'redirects to the user profile' do
subject

Expand All @@ -79,11 +73,6 @@
context 'when the user signs in the second time (and more)' do
let!(:user) { create(:user) }

it 'does not send any email to DataPass' do
expect { subject }
.not_to have_enqueued_mail(APIParticulier::UserMailer, :notify_datapass_for_data_reconciliation)
end

it 'redirects to the user profile' do
subject

Expand Down
70 changes: 0 additions & 70 deletions spec/mailers/api_entreprise/user_mailer_spec.rb

This file was deleted.

70 changes: 0 additions & 70 deletions spec/mailers/api_particulier/user_mailer_spec.rb

This file was deleted.

22 changes: 0 additions & 22 deletions spec/mailers/previews/api_entreprise/user_mailer_preview.rb

This file was deleted.

22 changes: 0 additions & 22 deletions spec/mailers/previews/api_particulier/user_mailer_preview.rb

This file was deleted.

22 changes: 0 additions & 22 deletions spec/organizers/api_entreprise/user/o_auth_login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,5 @@
expect(user.oauth_api_gouv_id).to eq(oauth_api_gouv_id)
end
end

context 'when the user signs in after receiving new tokens' do
let!(:user) { create(:user, :new_token_owner) }
let(:oauth_api_gouv_id) { user.oauth_api_gouv_id }

let(:another_sync) { described_class.call(params) }

it { is_expected.to be_a_success }

it 'sends an email to datapass for authorization request ownership update' do
expect { sync! }
.to have_enqueued_mail(APIEntreprise::UserMailer, :notify_datapass_for_data_reconciliation)
.with(user, 'api_entreprise')
end

it 'does not send emails on second login' do
another_sync

expect { sync! }
.not_to have_enqueued_mail(APIEntreprise::UserMailer, :notify_datapass_for_data_reconciliation)
end
end
end
end
22 changes: 0 additions & 22 deletions spec/organizers/api_particulier/user/o_auth_login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,5 @@
expect(user.oauth_api_gouv_id).to eq(oauth_api_gouv_id)
end
end

context 'when the user signs in after receiving new tokens' do
let!(:user) { create(:user, :new_token_owner) }
let(:oauth_api_gouv_id) { user.oauth_api_gouv_id }

let(:another_sync) { described_class.call(params) }

it { is_expected.to be_a_success }

it 'sends an email to datapass for authorization request ownership update' do
expect { sync! }
.to have_enqueued_mail(APIParticulier::UserMailer, :notify_datapass_for_data_reconciliation)
.with(user, 'api_particulier')
end

it 'does not send emails on second login' do
another_sync

expect { sync! }
.not_to have_enqueued_mail(APIParticulier::UserMailer, :notify_datapass_for_data_reconciliation)
end
end
end
end

0 comments on commit 2db817d

Please sign in to comment.