Commit 01a9fb9f35fb7f3a57a7d48174956f8fea09a820
1 parent
eae70c57
Exists in
staging
and in
29 other branches
api: return content of raw html block
Showing
2 changed files
with
19 additions
and
0 deletions
Show diff stats
app/models/raw_html_block.rb
test/api/blocks_test.rb
... | ... | @@ -83,4 +83,15 @@ class BlocksTest < ActiveSupport::TestCase |
83 | 83 | json = JSON.parse(last_response.body) |
84 | 84 | assert_equal "test", json["block"]["api_content"]["some_content"]["name"] |
85 | 85 | end |
86 | + | |
87 | + should 'display api content of raw html block' do | |
88 | + box = fast_create(Box, :owner_id => environment.id, :owner_type => Environment.name) | |
89 | + block = fast_create(RawHTMLBlock, box_id: box.id) | |
90 | + block.html = '<div>test</div>' | |
91 | + block.save! | |
92 | + get "/api/v1/blocks/#{block.id}?#{params.to_query}" | |
93 | + json = JSON.parse(last_response.body) | |
94 | + assert_equal "<div>test</div>", json["block"]["api_content"]["html"] | |
95 | + end | |
96 | + | |
86 | 97 | end | ... | ... |