fix tag al con test

This commit is contained in:
albert
2011-07-20 17:40:45 -04:00
parent 0c2e69b074
commit 1c1f75fc03
4 changed files with 9 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
<div id="c-tag-aliases">
<div id="a-new">
<h3>New Tag Alias</h3>
<h1>New Tag Alias</h1>
<%= simple_form_for(@tag_alias) do |f| %>
<%= f.input :antecedent_name, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>

View File

@@ -1,6 +1,6 @@
<div id="c-tag-aliases">
<div id="a-new">
<h3>New Tag Implication</h3>
<h1>New Tag Implication</h1>
<%= simple_form_for(@tag_implication) do |f| %>
<%= f.input :antecedent_name, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>

View File

@@ -84,7 +84,9 @@ Danbooru::Application.routes.draw do
end
end
resources :tag_aliases do
resource :cache, :only => [:destroy]
member do
delete :cache
end
end
resources :tag_implications
resources :tag_subscriptions

View File

@@ -16,7 +16,7 @@ class TagAliasesControllerTest < ActionController::TestCase
context "index action" do
setup do
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa", :consequent_name => "bbb", :creator => @user)
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa", :consequent_name => "bbb")
end
should "list all tag aliass" do
@@ -30,17 +30,6 @@ class TagAliasesControllerTest < ActionController::TestCase
end
end
context "edit action" do
setup do
@tag_alias = Factory.create(:tag_alias, :creator => @user)
end
should "render" do
get :edit, {:id => @tag_alias.id}, {:user_id => @user.id}
assert_response :success
end
end
context "create action" do
should "create a tag alias" do
assert_difference("TagAlias.count", 1) do
@@ -48,22 +37,10 @@ class TagAliasesControllerTest < ActionController::TestCase
end
end
end
context "update action" do
setup do
@tag_alias = Factory.create(:tag_alias, :creator => @user)
end
should "update a tag_alias" do
post :update, {:id => @tag_alias.id, :tag_alias => {:antecedent_name => "zzz"}}, {:user_id => @user.id}
@tag_alias.reload
assert_equal("zzz", @tag_alias.antecedent_name)
end
end
context "destroy action" do
setup do
@tag_alias = Factory.create(:tag_alias, :creator => @user)
@tag_alias = Factory.create(:tag_alias)
end
should "destroy a tag_alias" do
@@ -75,7 +52,7 @@ class TagAliasesControllerTest < ActionController::TestCase
context "destroy_cache action" do
setup do
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa", :creator => @user)
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa")
end
should "reset the cache" do