bsky user registerd at scanning

This commit is contained in:
Dylan Knutson
2025-08-12 22:27:22 +00:00
parent 420a44a27d
commit 6df6f63060
9 changed files with 256 additions and 60 deletions

View File

@@ -45,6 +45,36 @@ RSpec.describe Domain::Bluesky::Job::ScanUserJob do
content_type: "application/json",
contents: profile_response_body,
},
{
uri: "https://plc.directory/#{user.did}/log/audit",
status_code: 200,
content_type: "application/json",
caused_by_entry_idx: 0,
contents: [
{
did: "did:plc:le66o7kn5k4iqkxbih7gi4w2",
operation: {
sig: "signature",
prev: nil,
type: "plc_operation",
services: {
atproto_pds: {
type: "AtprotoPersonalDataServer",
endpoint: "https://bsky.social",
},
},
alsoKnownAs: ["at://handle.bsky.social"],
rotationKeys: ["rotation_key"],
verificationMethods: {
atproto: "verification_method",
},
},
cid: "cid",
nullified: false,
createdAt: "2023-07-03T05:08:27.780Z",
},
].to_json,
},
]
end
@@ -61,6 +91,9 @@ RSpec.describe Domain::Bluesky::Job::ScanUserJob do
expect(user.scanned_profile_at).to be_present
expect(user.state).to eq("ok")
expect(user.last_scan_log_entry).to eq(@log_entries.first)
expect(user.registered_at).to eq(
Time.parse("2023-07-03T05:08:27.780Z").in_time_zone("UTC"),
)
end
it "sets last_scan_log_entry to the HTTP response log entry" do
@@ -138,6 +171,36 @@ RSpec.describe Domain::Bluesky::Job::ScanUserJob do
content_type: "application/json",
contents: profile_response_body,
},
{
uri: "https://plc.directory/#{user.did}/log/audit",
status_code: 200,
content_type: "application/json",
caused_by_entry_idx: 0,
contents: [
{
did: "did:plc:le66o7kn5k4iqkxbih7gi4w2",
operation: {
sig: "signature",
prev: nil,
type: "plc_operation",
services: {
atproto_pds: {
type: "AtprotoPersonalDataServer",
endpoint: "https://bsky.social",
},
},
alsoKnownAs: ["at://handle.bsky.social"],
rotationKeys: ["rotation_key"],
verificationMethods: {
atproto: "verification_method",
},
},
cid: "cid",
nullified: false,
createdAt: "2023-07-03T05:08:27.780Z",
},
].to_json,
},
]
end