rails: add 'URL' inflection.

Make it so we can write `ArtistURL` instead of `ArtistUrl`.
This commit is contained in:
evazion
2022-02-21 08:41:05 -06:00
parent fbab273c81
commit 60a26af6e3
8 changed files with 16 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
require 'test_helper'
class ArtistUrlsControllerTest < ActionDispatch::IntegrationTest
class ArtistURLsControllerTest < ActionDispatch::IntegrationTest
context "The artist urls controller" do
setup do
@artist = create(:artist, name: "bkub", url_string: "-http://bkub.com")

View File

@@ -152,10 +152,10 @@ class ArtistTest < ActiveSupport::TestCase
should "not delete urls that have not changed" do
artist = FactoryBot.create(:artist, :name => "rembrandt", :url_string => "http://rembrandt.com/test.jpg")
old_url_ids = ArtistUrl.order("id").pluck(&:id)
old_url_ids = ArtistURL.order("id").pluck(&:id)
artist.url_string = "http://rembrandt.com/test.jpg"
artist.save
assert_equal(old_url_ids, ArtistUrl.order("id").pluck(&:id))
assert_equal(old_url_ids, ArtistURL.order("id").pluck(&:id))
end
should "normalize urls before removing duplicates" do

View File

@@ -1,6 +1,6 @@
require 'test_helper'
class ArtistUrlTest < ActiveSupport::TestCase
class ArtistURLTest < ActiveSupport::TestCase
def assert_search_equals(results, conditions)
assert_equal(results.map(&:id), subject.search(conditions).map(&:id))
end
@@ -196,7 +196,7 @@ class ArtistUrlTest < ActiveSupport::TestCase
end
context "#search method" do
subject { ArtistUrl }
subject { ArtistURL }
should "work" do
@bkub = create(:artist, name: "bkub", is_deleted: false, url_string: "https://bkub.com")