Skip to content

Add ActiveRecordCoder codec test with hard-coded payload#16

Merged
shioyama merged 1 commit into
masterfrom
shioyama/add_hard_coded_activerecord_coder_codec_test
Aug 23, 2022
Merged

Add ActiveRecordCoder codec test with hard-coded payload#16
shioyama merged 1 commit into
masterfrom
shioyama/add_hard_coded_activerecord_coder_codec_test

Conversation

@shioyama

Copy link
Copy Markdown
Member

Extracted from #14 (comment)

Added test ensures that payloads generated when encoding records do not change.

@shioyama shioyama force-pushed the shioyama/add_hard_coded_activerecord_coder_codec_test branch from f59d838 to c03e8ca Compare August 23, 2022 06:41
@shioyama shioyama marked this pull request as ready for review August 23, 2022 06:42
@shioyama shioyama force-pushed the shioyama/add_hard_coded_activerecord_coder_codec_test branch 2 times, most recently from 9e5b056 to f18ecd3 Compare August 23, 2022 06:45
end

test "preserves previous encoding scheme" do
payload = "\xC8\x01\x1A\x06\x95\x92\x00\x92\x92\xC7\x06\x00domain\x92\x01\x91\x92\xD6\x00shop\x00\x92\xD7\x00products\x92\x92\x02\x91\x92\xD6\x00shop\x00\x92\x03\x91\x92\xD6\x00shop\x00\x92\xA4Shop\x84\xA2id\x01\xA4name\xAASnow Devil\xA8settings\xC4\x18#\xE2\x98\xA01\xE2\x98\xA2\n\x81\xD7\x00currency\xA3\xE2\x82\xAC\xA8owner_id\xC0\x92\xA6Domain\x83\xA7shop_id\x01\xA2id\x01\xA4name\xABexample.com\x92\xA7Product\x84\xA7shop_id\x01\xA2id\x01\xA4name\xAFCheap Snowboard\xA8quantity\x18\x92\xA7Product\x84\xA7shop_id\x01\xA2id\x02\xA4name\xB3Expensive Snowboard\xA8quantity\x02".b # rubocop:disable Layout/LineLength

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split that line a bit? Or move it to a fixture file?

@shioyama shioyama force-pushed the shioyama/add_hard_coded_activerecord_coder_codec_test branch 2 times, most recently from df2ba1d to 7f4618c Compare August 23, 2022 06:52
@shioyama shioyama force-pushed the shioyama/add_hard_coded_activerecord_coder_codec_test branch from 7f4618c to 31e2d14 Compare August 23, 2022 06:53
@shioyama shioyama merged commit d8cecd5 into master Aug 23, 2022
@shopify-shipit shopify-shipit Bot temporarily deployed to rubygems August 23, 2022 06:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants