routes: replace hardcoded routes in models with route helpers.
Add a Routes module that gives models access to route helpers outside of views, and use it to replace various hardcoded routes.
This commit is contained in:
@@ -195,7 +195,7 @@ module Sources
|
||||
should "convert illust links and member links to dtext" do
|
||||
get_source("https://www.pixiv.net/member_illust.php?mode=medium&illust_id=63421642")
|
||||
|
||||
dtext_desc = %(foo 【pixiv #46337015 "»":[/posts?tags=pixiv:46337015]】bar 【pixiv #14901720 "»":[/posts?tags=pixiv:14901720]】\n\nbaz【"user/83739":[https://www.pixiv.net/users/83739] "»":[/artists?search%5Burl_matches%5D=https%3A%2F%2Fwww.pixiv.net%2Fusers%2F83739]】)
|
||||
dtext_desc = %(foo 【pixiv #46337015 "»":[/posts?tags=pixiv%3A46337015]】bar 【pixiv #14901720 "»":[/posts?tags=pixiv%3A14901720]】\n\nbaz【"user/83739":[https://www.pixiv.net/users/83739] "»":[/artists?search%5Burl_matches%5D=https%3A%2F%2Fwww.pixiv.net%2Fusers%2F83739]】)
|
||||
assert_equal(dtext_desc, @site.dtext_artist_commentary_desc)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ class UserFeedbackTest < ActiveSupport::TestCase
|
||||
gold = FactoryBot.create(:gold_user)
|
||||
member = FactoryBot.create(:user)
|
||||
dmail = <<~EOS.chomp
|
||||
@#{gold.name} created a "positive record":/user_feedbacks?search[user_id]=#{user.id} for your account:
|
||||
@#{gold.name} created a "positive record":/user_feedbacks?search%5Buser_id%5D=#{user.id} for your account:
|
||||
|
||||
good job!
|
||||
EOS
|
||||
|
||||
Reference in New Issue
Block a user