Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class ResendConfirmation < Base
argument :email, String, required: true, prepare: ->(email, _) { email.downcase }
argument :redirect_url, String, required: true

field :authenticable, User, null: false
field :message, String, null: false
Comment thread
aarona marked this conversation as resolved.

def resolve(email:, redirect_url:)
Expand Down
8 changes: 4 additions & 4 deletions spec/requests/mutations/resend_confirmation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

context 'when params are correct' do
it 'sends an email to the user with confirmation url and returns a success message' do
expect { post_request }.to(change(ActionMailer::Base.deliveries, :count).by(1))
expect { post_request }.to change(ActionMailer::Base.deliveries, :count).by 1
Comment thread
aarona marked this conversation as resolved.
Outdated
expect(json_response[:data][:userResendConfirmation]).to include(
authenticable: {
id: id,
Expand Down Expand Up @@ -54,7 +54,7 @@
before { user.confirm }

it 'does *NOT* send an email and raises an error' do
expect { post_request }.to(change(ActionMailer::Base.deliveries, :count).by(0))
expect { post_request }.to change(ActionMailer::Base.deliveries, :count).by 0
Comment thread
aarona marked this conversation as resolved.
Outdated
expect(json_response[:data][:userResendConfirmation]).to be_nil
expect(json_response[:errors]).to contain_exactly(
hash_including(
Expand All @@ -66,11 +66,11 @@
end
end

context 'when the email isn''t in the system' do
context "when the email isn't in the system" do
let(:email) { 'nothere@gmail.com' }

it 'does *NOT* send an email and raises an error' do
expect { post_request }.to(change(ActionMailer::Base.deliveries, :count).by(0))
expect { post_request }.to not_change(ActionMailer::Base.deliveries, :count)
expect(json_response[:data][:userResendConfirmation]).to be_nil
expect(json_response[:errors]).to contain_exactly(
hash_including(
Expand Down