Created
April 9, 2014 14:57
-
-
Save davefp/10280008 to your computer and use it in GitHub Desktop.
How would you format this line of ruby to be more readable?
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
#One liner? | |
assert_requested(:post, url, body: hash_including({name: 'web', events: ['release'], active: true, config: {url: 'http://example.com/webhooks/release', content_type: 'json'}})) | |
# Params aligned with the structure they're part of? | |
assert_requested(:post, url, | |
body: hash_including({name: 'web', events: ['release'], active: true, | |
config: {url: 'http://example.com/webhooks/release', content_type: 'json'}})) | |
# Something else? |
agmcleod
commented
Apr 9, 2014
body_hash = {
name: 'web',
events: ['release'],
active: true,
config: {
url: 'http://example.com/webhooks/release',
content_type: 'json'
}
}
assert_requested(:post, url, body: hash_including(body_hash))
like Kurt said, except the indentation is off
👍 for @kurtfunai
i did not even know about hash_including
!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment