Skip to content

Commit

Permalink
rename PasswordResetOrganizer to CreatePasswordResetOrganizer
Browse files Browse the repository at this point in the history
  • Loading branch information
npauzenga committed Jan 2, 2016
1 parent bb204c4 commit 24420ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/password_resets_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PasswordResetsController < ApplicationController
def create
reset = PasswordResetOrganizer.call(email: password_params[:email])
reset = CreatePasswordResetOrganizer.call(email: password_params[:email])
if reset.success?
render json: reset.message, status: :created
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class PasswordResetOrganizer
class CreatePasswordResetOrganizer
include Interactor::Organizer
end
6 changes: 3 additions & 3 deletions spec/controllers/password_resets_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
let(:context) { double(:context, success?: true) }

before(:example) do
allow(PasswordResetOrganizer).to receive(:call).with(arguments).
allow(CreatePasswordResetOrganizer).to receive(:call).with(arguments).
and_return(context)

allow(context).to receive(:message).and_return(["reset sent"])
allow(context).to receive(:errors).and_return(["reset failed"])
end

it "calls PasswordResetOrganizer" do
expect(PasswordResetOrganizer).to receive(:call)
it "calls CreatePasswordResetOrganizer" do
expect(CreatePasswordResetOrganizer).to receive(:call)
post :create, params
end

Expand Down

0 comments on commit 24420ee

Please sign in to comment.