Created
February 26, 2015 09:19
-
-
Save terlar/60c41c513b7ea95a2176 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
require_relative '../../../web_test_helper' | |
module Web | |
class PostAdWithDescriptionPropertyTest < PostAdTestCase | |
def test_post_ad_with_multiline_description | |
description = "This is a multiline\ndescription\nindeed it is\n" | |
post_ad_with_properties({ | |
key: 'description', | |
type: 'description', | |
value: description | |
}) | |
assert_description(last_response, { | |
label: 'Description', | |
value: description | |
}) | |
get "/ads/#{last_posted_ad_id}" do |response| | |
assert_description(response, { | |
label: 'Description', | |
value: description | |
}) | |
end | |
end | |
private | |
def assert_description(response, data) | |
json = JSON.load(response.body).fetch('ad') | |
assert json.fetch('description'), data | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment