Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions app/controllers/activation_resends_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def find_account_by_email
@account = Account.find_by(email: params[:email])
return unless @account.nil?

@errors = t('.no_account')
render :new
redirect_to root_path, notice: t('.success')
end
Comment thread
Niharika1117 marked this conversation as resolved.
end
10 changes: 5 additions & 5 deletions test/controllers/activation_resends_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class ActivationResendsControllerTest < ActionController::TestCase
_(flash[:success]).must_equal I18n.t('activation_resends.create.recently_activated')
end

it 'Should not allow if email is invalid' do
it 'should not send email if account does not exist' do
before = ActionMailer::Base.deliveries.count
post :create, params: { email: 'InvalidEmail' }
post :create, params: { email: 'nonexistent@example.com' }
_(ActionMailer::Base.deliveries.count).must_equal before
assert_response :ok
assert_template :new
_(assigns(:errors)).must_equal I18n.t('activation_resends.create.no_account')
assert_response :redirect
assert_redirected_to root_path
_(flash[:notice]).must_equal I18n.t('activation_resends.create.success')
end

it 'should resend activation mail' do
Expand Down
Loading