Sep 2025 posted_at fixes

This commit is contained in:
Dylan Knutson
2025-09-07 18:21:46 +00:00
parent 1905575d19
commit 7f7728366b
5 changed files with 2386 additions and 1 deletions

View File

@@ -158,6 +158,35 @@ describe Domain::Fa::Job::ScanPostJob do
end
end
context "when scanning a post from the September 2025 update" do
let(:client_mock_config) do
[
{
uri: "https://www.furaffinity.net/view/62198493/",
status_code: 200,
content_type: "text/html",
contents:
SpecUtil.read_fixture_file(
"domain/fa/submission/submission_page_62198493_2025-09-07.html",
),
},
]
end
it "updates the post attributes" do
perform_now({ fa_id: 62_198_493 })
post = Domain::Post::FaPost.find_by(fa_id: 62_198_493)
expect(post.state).to eq("ok")
expect(post.title).to eq("harlan")
expect(post.creator).to eq(
Domain::User::FaUser.find_by(url_name: "charkiexd"),
)
expect(post.posted_at).to be_within(1.second).of(
Time.parse("Sep 6, 2025 9:07:01 PM -07:00"),
)
end
end
context "when scanning an already scanned post" do
include_context "post 59_714_213 already exists"
include_context "creator is creeps"

View File

@@ -510,6 +510,40 @@ describe Domain::Fa::Parser::Page do
assert_equal 14, up.num_watching
end
context "pages after the September 2025 update" do
it "works when posted_at is in the AM" do
parser =
get_parser_at(
Rails.root.join(
"test/fixtures/files/domain/fa/submission/submission_page_62203391_2025-09-07.html",
),
)
assert_page_type parser, :probably_submission?
sub = parser.submission
assert_equal 62_203_391, sub.id
assert_equal "alice_yagami", sub.artist
assert_equal "aliceyagami", sub.artist_url_name
assert_equal "/user/aliceyagami/", sub.artist_user_page_path
assert_equal "//d.furaffinity.net/art/aliceyagami/1757267333/1757267333.aliceyagami_silksong.jpg",
sub.small_img
assert_equal "//d.furaffinity.net/art/aliceyagami/1757267333/1757267333.aliceyagami_silksong.jpg",
sub.full_res_img
assert_equal Time.parse("Sep 7, 2025 10:48:53 -07:00"), sub.posted_date
end
it "works when posted_at is in the PM" do
parser =
get_parser_at(
Rails.root.join(
"test/fixtures/files/domain/fa/submission/submission_page_62198493_2025-09-07.html",
),
)
assert_page_type parser, :probably_submission?
sub = parser.submission
assert_equal Time.parse("Sep 6, 2025 9:07:01 PM -07:00"), sub.posted_date
end
end
context "recent gallery submission parsing" do
it "works when the user has recent gallery submissions" do
parser =