diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-04-06 10:57:19 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-04-06 10:57:19 +0000 |
commit | 20695052db6860620365af9b86ab301759d1405d (patch) | |
tree | b7e8afd7953b5c92cbcee71d5c1fcef2178d0a31 /spec | |
parent | 52b232ca5d18ffc08299f5bb0ef3be46d2fecca3 (diff) | |
download | gitlab-ce-20695052db6860620365af9b86ab301759d1405d.tar.gz |
[Rails5] Update `type_cast_*_database` methods
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/database/sha_attribute_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/merge_request_diff_commit_spec.rb | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/lib/gitlab/database/sha_attribute_spec.rb b/spec/lib/gitlab/database/sha_attribute_spec.rb index 62c1d37ea1c..778bfa2cc47 100644 --- a/spec/lib/gitlab/database/sha_attribute_spec.rb +++ b/spec/lib/gitlab/database/sha_attribute_spec.rb @@ -19,15 +19,15 @@ describe Gitlab::Database::ShaAttribute do let(:attribute) { described_class.new } - describe '#type_cast_from_database' do + describe '#deserialize' do it 'converts the binary SHA to a String' do - expect(attribute.type_cast_from_database(binary_from_db)).to eq(sha) + expect(attribute.deserialize(binary_from_db)).to eq(sha) end end - describe '#type_cast_for_database' do + describe '#serialize' do it 'converts a SHA String to binary data' do - expect(attribute.type_cast_for_database(sha).to_s).to eq(binary_sha) + expect(attribute.serialize(sha).to_s).to eq(binary_sha) end end end diff --git a/spec/models/merge_request_diff_commit_spec.rb b/spec/models/merge_request_diff_commit_spec.rb index 7709cf43200..8c01a7ac18f 100644 --- a/spec/models/merge_request_diff_commit_spec.rb +++ b/spec/models/merge_request_diff_commit_spec.rb @@ -36,7 +36,7 @@ describe MergeRequestDiffCommit do "committer_email": "dmitriy.zaporozhets@gmail.com", "merge_request_diff_id": merge_request_diff_id, "relative_order": 0, - "sha": sha_attribute.type_cast_for_database('5937ac0a7beb003549fc5fd26fc247adbce4a52e') + "sha": sha_attribute.serialize("5937ac0a7beb003549fc5fd26fc247adbce4a52e") }, { "message": "Change some files\n\nSigned-off-by: Dmitriy Zaporozhets \u003cdmitriy.zaporozhets@gmail.com\u003e\n", @@ -48,7 +48,7 @@ describe MergeRequestDiffCommit do "committer_email": "dmitriy.zaporozhets@gmail.com", "merge_request_diff_id": merge_request_diff_id, "relative_order": 1, - "sha": sha_attribute.type_cast_for_database('570e7b2abdd848b95f2f578043fc23bd6f6fd24d') + "sha": sha_attribute.serialize("570e7b2abdd848b95f2f578043fc23bd6f6fd24d") } ] end @@ -79,7 +79,7 @@ describe MergeRequestDiffCommit do "committer_email": "alejorro70@gmail.com", "merge_request_diff_id": merge_request_diff_id, "relative_order": 0, - "sha": sha_attribute.type_cast_for_database('ba3343bc4fa403a8dfbfcab7fc1a8c29ee34bd69') + "sha": sha_attribute.serialize("ba3343bc4fa403a8dfbfcab7fc1a8c29ee34bd69") }] end |