Created
April 13, 2022 20:01
-
-
Save stolarczykt/bd9277b4b6abecf473e7e2dba946e6dc 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
test 'change advertisement content' do | |
advertisement_id = SecureRandom.random_number | |
author_id = SecureRandom.random_number | |
new_content = "Random content: #{SecureRandom.hex}" | |
command_bus.(PublishAdvertisement.new(advertisement_id, author_id)) | |
assert_events( | |
"Advertisement$#{advertisement_id}", | |
ContentHasChanged.new(data: {content: new_content}) | |
) do | |
command_bus.(ChangeContent.new(advertisement_id, new_content, author_id)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment