From 4b89e6b0423fd93608a65f2eb303c8c449e11a73 Mon Sep 17 00:00:00 2001 From: Yar04ek Date: Tue, 12 Dec 2023 12:46:07 +0100 Subject: [PATCH] ref: ApiStroke.ToJSON --- spec/docx/smoke/api_stroke_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/docx/smoke/api_stroke_spec.rb b/spec/docx/smoke/api_stroke_spec.rb index 425d7e709..6885918a9 100644 --- a/spec/docx/smoke/api_stroke_spec.rb +++ b/spec/docx/smoke/api_stroke_spec.rb @@ -7,8 +7,12 @@ expect(docx.elements[1].nonempty_runs.first.text).to eq('Class Type = stroke') end - it 'ApiRGBColor | ToJSON method' do + it 'ApiStroke | ToJSON method' do docx = builder.build_and_parse('js/docx/smoke/api_stroke/to_json.js') + expect(docx.elements.first.nonempty_runs.first.alternate_content.office2010_content.graphic.data.text_body.elements.first.character_style_array.size).to eq(2) + expect(docx.elements.first.nonempty_runs.first + .alternate_content.office2010_content.graphic.type).to eq(:shape) + expect(docx.elements[1].nonempty_runs.first.text).to include('"type":"stroke"') json = JSON.parse(docx.elements[1].nonempty_runs.first.text) stroke = json['graphic']['spPr']['ln']['fill']['fill']['color']['color']['rgba'] expect(stroke['red']).to eq(51)