fix tag al con test
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<div id="c-tag-aliases">
|
<div id="c-tag-aliases">
|
||||||
<div id="a-new">
|
<div id="a-new">
|
||||||
<h3>New Tag Alias</h3>
|
<h1>New Tag Alias</h1>
|
||||||
<%= simple_form_for(@tag_alias) do |f| %>
|
<%= simple_form_for(@tag_alias) do |f| %>
|
||||||
<%= f.input :antecedent_name, :label => "From" %>
|
<%= f.input :antecedent_name, :label => "From" %>
|
||||||
<%= f.input :consequent_name, :label => "To" %>
|
<%= f.input :consequent_name, :label => "To" %>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div id="c-tag-aliases">
|
<div id="c-tag-aliases">
|
||||||
<div id="a-new">
|
<div id="a-new">
|
||||||
<h3>New Tag Implication</h3>
|
<h1>New Tag Implication</h1>
|
||||||
<%= simple_form_for(@tag_implication) do |f| %>
|
<%= simple_form_for(@tag_implication) do |f| %>
|
||||||
<%= f.input :antecedent_name, :label => "From" %>
|
<%= f.input :antecedent_name, :label => "From" %>
|
||||||
<%= f.input :consequent_name, :label => "To" %>
|
<%= f.input :consequent_name, :label => "To" %>
|
||||||
|
|||||||
@@ -84,7 +84,9 @@ Danbooru::Application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :tag_aliases do
|
resources :tag_aliases do
|
||||||
resource :cache, :only => [:destroy]
|
member do
|
||||||
|
delete :cache
|
||||||
|
end
|
||||||
end
|
end
|
||||||
resources :tag_implications
|
resources :tag_implications
|
||||||
resources :tag_subscriptions
|
resources :tag_subscriptions
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class TagAliasesControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
context "index action" do
|
context "index action" do
|
||||||
setup 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
|
end
|
||||||
|
|
||||||
should "list all tag aliass" do
|
should "list all tag aliass" do
|
||||||
@@ -30,17 +30,6 @@ class TagAliasesControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
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
|
context "create action" do
|
||||||
should "create a tag alias" do
|
should "create a tag alias" do
|
||||||
assert_difference("TagAlias.count", 1) do
|
assert_difference("TagAlias.count", 1) do
|
||||||
@@ -48,22 +37,10 @@ class TagAliasesControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
end
|
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
|
context "destroy action" do
|
||||||
setup do
|
setup do
|
||||||
@tag_alias = Factory.create(:tag_alias, :creator => @user)
|
@tag_alias = Factory.create(:tag_alias)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "destroy a tag_alias" do
|
should "destroy a tag_alias" do
|
||||||
@@ -75,7 +52,7 @@ class TagAliasesControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
context "destroy_cache action" do
|
context "destroy_cache action" do
|
||||||
setup do
|
setup do
|
||||||
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa", :creator => @user)
|
@tag_alias = Factory.create(:tag_alias, :antecedent_name => "aaa")
|
||||||
end
|
end
|
||||||
|
|
||||||
should "reset the cache" do
|
should "reset the cache" do
|
||||||
|
|||||||
Reference in New Issue
Block a user