Flaky Spec Fixes: User Block and Sitemap Specs (#8314)
This commit is contained in:
parent
bde51a61a0
commit
6a139c73ac
2 changed files with 5 additions and 3 deletions
|
|
@ -27,8 +27,8 @@ RSpec.describe "Sitemaps", type: :request do
|
|||
|
||||
it "sends a surrogate key (for Fastly's user)" do
|
||||
create_list(:article, 4)
|
||||
Article.limit(3).update_all(published_at: 3.months.ago, score: 10)
|
||||
get "/sitemap-#{3.months.ago.strftime('%b-%Y')}.xml"
|
||||
Article.limit(3).update_all(published_at: "2020-03-07T00:27:30Z", score: 10)
|
||||
get "/sitemap-Mar-2020.xml"
|
||||
article = Article.first
|
||||
expect(response.body).to include("<loc>#{ApplicationConfig['APP_PROTOCOL']}#{ApplicationConfig['APP_DOMAIN']}#{article.path}</loc>")
|
||||
expect(response.body).to include("<lastmod>#{article.last_comment_at.strftime('%F')}</lastmod>")
|
||||
|
|
|
|||
|
|
@ -83,8 +83,10 @@ RSpec.describe "UserBlock", type: :request do
|
|||
end
|
||||
|
||||
it "raises ActiveRecord::RecordNotFound error if UserBlock not found" do
|
||||
missing_id = blocked.id
|
||||
blocked.destroy
|
||||
expect do
|
||||
delete "/user_blocks/#{blocked.id}", params: { user_block: { blocked_id: blocked.id + 10 } }
|
||||
delete "/user_blocks/#{missing_id}", params: { user_block: { blocked_id: missing_id } }
|
||||
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue