-
-<%= render "secondary_links" %>
-
-<% content_for(:page_title) do %>
- Rename Artist - <%= Danbooru.config.app_name %>
-<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index c2a86084a..a6d732ed8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -60,8 +60,6 @@ Danbooru::Application.routes.draw do
member do
put :revert
put :ban
- get :edit_name
- put :update_name
post :undelete
end
collection do
diff --git a/test/functional/artists_controller_test.rb b/test/functional/artists_controller_test.rb
index 01d0da6cf..712c272ed 100644
--- a/test/functional/artists_controller_test.rb
+++ b/test/functional/artists_controller_test.rb
@@ -57,6 +57,28 @@ class ArtistsControllerTest < ActionController::TestCase
assert_redirected_to(artist_path(@artist))
end
+ context "when renaming an artist" do
+ should "automatically rename the artist's wiki page" do
+ artist = FactoryGirl.create(:artist, :name => "aaa", :notes => "testing")
+ wiki_page = artist.wiki_page
+ assert_difference("WikiPage.count", 0) do
+ post :update, {:id => artist.id, :artist => {:name => "bbb", :notes => "more testing"}}, {:user_id => @user.id}
+ end
+ wiki_page.reload
+ assert_equal("bbb", wiki_page.title)
+ assert_equal("more testing", wiki_page.body)
+ end
+
+ should "merge the new notes with the existing wiki page's contents if a wiki page for the new name already exists" do
+ artist = FactoryGirl.create(:artist, :name => "aaa")
+ existing_wiki_page = FactoryGirl.create(:wiki_page, :title => "bbb", :body => "xxx")
+ post :update, {:id => artist.id, :artist => {:name => "bbb", :notes => "yyy"}}, {:user_id => @user.id}
+ existing_wiki_page.reload
+ assert_equal("bbb", existing_wiki_page.title)
+ assert_equal("xxx\n\nyyy", existing_wiki_page.body)
+ end
+ end
+
should "revert an artist" do
@artist.update_attributes(:name => "xyz")
@artist.update_attributes(:name => "abc")
diff --git a/test/unit/artist_test.rb b/test/unit/artist_test.rb
index 5de5b6e62..7db3ba829 100644
--- a/test/unit/artist_test.rb
+++ b/test/unit/artist_test.rb
@@ -14,30 +14,6 @@ class ArtistTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
- context "#rename!" do
- setup do
- @artist = FactoryGirl.create(:artist, :name => "aaa", :notes => "xxx")
- end
-
- should "rename the wiki page" do
- wiki_page = @artist.wiki_page
- @artist.rename!("bbb")
- assert_equal("bbb", @artist.name)
- wiki_page.reload
- assert_equal("bbb", wiki_page.title)
- end
-
- should "merge the old wiki page into the new one if a wiki page for the new name already exists" do
- FactoryGirl.create(:wiki_page, :title => "bbb", :body => "abcabc")
- wiki_page = @artist.wiki_page
- @artist.rename!("bbb")
- wiki_page.reload
- @artist.reload
- assert_equal("xxx", wiki_page.body)
- assert_equal("abcabc\n\nxxx", @artist.wiki_page.body)
- end
- end
-
context "with a matching tag alias" do
setup do
@tag_alias = FactoryGirl.create(:tag_alias, :antecedent_name => "aaa", :consequent_name => "bbb")