Aliases/implications: Add tests for status and foreign keys.

This commit is contained in:
evazion
2016-10-11 07:56:13 +00:00
parent 23ad02fa9c
commit 101771adb8
4 changed files with 80 additions and 0 deletions

View File

@@ -41,6 +41,15 @@ class TagAliasesControllerTest < ActionController::TestCase
@tag_alias.reload
assert_equal("xxx", @tag_alias.antecedent_name)
end
should "not allow changing the status" do
post :update, {:id => @tag_alias.id, :tag_alias => {:status => "active"}}, {:user_id => @user.id}
@tag_alias.reload
assert_equal("pending", @tag_alias.status)
end
# TODO: Broken in shoulda-matchers 2.8.0. Need to upgrade to 3.1.1.
should_eventually permit(:antecedent_name, :consequent_name, :forum_topic_id).for(:update)
end
context "for an approved alias" do

View File

@@ -42,6 +42,15 @@ class TagImplicationsControllerTest < ActionController::TestCase
@tag_implication.reload
assert_equal("xxx", @tag_implication.antecedent_name)
end
should "not allow changing the status" do
post :update, {:id => @tag_implication.id, :tag_implication => {:status => "active"}}, {:user_id => @user.id}
@tag_implication.reload
assert_equal("pending", @tag_implication.status)
end
# TODO: Broken in shoulda-matchers 2.8.0. Need to upgrade to 3.1.1.
should_eventually permit(:antecedent_name, :consequent_name, :forum_topic_id).for(:update)
end
context "for an approved implication" do