Created
September 15, 2018 10:50
-
-
Save iSarCasm/3f6b5cc0f5e165d209239ce8ef9ee4cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GreetUser | |
include Interactor | |
def call | |
puts "Hello, #{context.user.name}" | |
end | |
end | |
class SaveUser | |
include Interactor | |
def call | |
context.user.save | |
GreetUser.call(user: context.user) | |
end | |
end | |
describe GreetUser do | |
it 'prints welcome message' | |
end | |
describe SaveUser | |
it 'saves user' | |
it 'greets user' do | |
user = User.new | |
expect(GreetUser).to receive(:call).with(user: user) | |
SaveUser(user: user) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment