Skip to content

Commit

Permalink
cleaned up syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
npauzenga committed Nov 17, 2015
1 parent a99c5fb commit b28457f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
9 changes: 4 additions & 5 deletions spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

let(:interactor_input) do
{ user_params: {
name: user.name,
email: user.email,
password: user.password,
password_confirmation: user.password_confirmation
name: user.name,
email: user.email,
password: user.password,
password_confirmation: user.password_confirmation
}
}
end
Expand All @@ -20,7 +20,6 @@
Interactor::Context.new(errors: :val, user: user)
end


before(:example) do
allow(CreateUser).to receive(:call).with(interactor_input)
.and_return(interactor_context)
Expand Down
13 changes: 10 additions & 3 deletions spec/factories/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
password "helloworld"
password_confirmation "helloworld"
email_confirmed false
after(:create) { |user| user.confirm_token = SecureRandom.urlsafe_base64.to_s }
after(:create) { |user| user.confirm_digest = Encryptor.digest_token(user.confirm_token) }
after(:create) { |user| EncryptPassword.call(user: user) }

after(:create) do |user|
user.confirm_token = SecureRandom.urlsafe_base64.to_s
end
after(:create) do |user|
user.confirm_digest = Encryptor.digest_token(user.confirm_token)
end
after(:create) do |user|
EncryptPassword.call(user: user)
end
end
end

0 comments on commit b28457f

Please sign in to comment.