tests: add more tags controller/model tests.
This commit is contained in:
@@ -26,7 +26,7 @@ class TagsControllerTest < ActionController::TestCase
|
||||
|
||||
context "index action" do
|
||||
setup do
|
||||
@tag = FactoryGirl.create(:tag, :name => "aaa")
|
||||
@tag = FactoryGirl.create(:tag, name: "aaa", post_count: 1)
|
||||
end
|
||||
|
||||
should "render" do
|
||||
@@ -42,6 +42,15 @@ class TagsControllerTest < ActionController::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "autocomplete action" do
|
||||
should "render" do
|
||||
FactoryGirl.create(:tag, name: "touhou", post_count: 1)
|
||||
|
||||
get :autocomplete, { search: { name_matches: "t" }, format: :json }
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
context "show action" do
|
||||
setup do
|
||||
@tag = FactoryGirl.create(:tag)
|
||||
|
||||
Reference in New Issue
Block a user