rails: add 'URL' inflection.
Make it so we can write `ArtistURL` instead of `ArtistUrl`.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user