-
Notifications
You must be signed in to change notification settings - Fork 655
AO3-7238 Add work's last updated time to akismet comment spam checks #5521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c4cf839
43a3117
0d149b5
0bdfe67
5101069
8f953ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,6 +292,15 @@ def queue_adapter_for_test | |
| it "has comment_type \"fanwork-comment\"" do | ||
| expect(subject.akismet_attributes[:comment_type]).to eq("fanwork-comment") | ||
| end | ||
|
|
||
| it "has comment_post_modified_gmt as the work's revision time", :frozen do | ||
| work_posted_at = Time.current | ||
| travel_to(1.day.from_now) do | ||
| Chapter.new work_id: subject.commentable.id | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).to eq(Time.current.iso8601) | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).not_to eq(work_posted_at.iso8601) | ||
| end | ||
| end | ||
| end | ||
|
Comment on lines
+296
to
304
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, this test isn't really checking what it looks like - I think it would be clearer (for all the tests) to compare directly to the records' |
||
|
|
||
| context "when the commentable is an admin post" do | ||
|
|
@@ -300,6 +309,10 @@ def queue_adapter_for_test | |
| it "has comment_type \"comment\"" do | ||
| expect(subject.akismet_attributes[:comment_type]).to eq("comment") | ||
| end | ||
|
|
||
| it "has comment_post_modified_gmt as the admin post's creation time", :frozen do | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).to eq(Time.current.iso8601) | ||
| end | ||
| end | ||
|
|
||
| context "when the commentable is a comment" do | ||
|
|
@@ -309,6 +322,15 @@ def queue_adapter_for_test | |
| it "has comment_type \"fanwork-comment\"" do | ||
| expect(subject.akismet_attributes[:comment_type]).to eq("fanwork-comment") | ||
| end | ||
|
|
||
| it "has comment_post_modified_gmt as the work's revision time", :frozen do | ||
| work_posted_at = Time.current | ||
| travel_to(1.day.from_now) do | ||
| Chapter.new work_id: subject.commentable.commentable.id | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).to eq(Time.current.iso8601) | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).not_to eq(work_posted_at.iso8601) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context "when the comment is on an admin post" do | ||
|
|
@@ -317,6 +339,10 @@ def queue_adapter_for_test | |
| it "has comment_type \"comment\"" do | ||
| expect(subject.akismet_attributes[:comment_type]).to eq("comment") | ||
| end | ||
|
|
||
| it "has comment_post_modified_gmt as the admin post's creation time", :frozen do | ||
| expect(subject.akismet_attributes[:comment_post_modified_gmt]).to eq(Time.current.iso8601) | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.