tests: add more pools controller tests.

This commit is contained in:
evazion
2017-02-06 02:01:39 -06:00
parent dfb8d0106d
commit 5c871aee64

View File

@@ -49,6 +49,21 @@ class PoolsControllerTest < ActionController::TestCase
end
end
context "gallery action" do
should "render" do
pool = FactoryGirl.create(:pool)
get :gallery, {:id => pool.id}
assert_response :success
end
end
context "new action" do
should "render" do
get :new, {}, { user_id: @user.id }
assert_response :success
end
end
context "create action" do
should "create a pool" do
assert_difference("Pool.count", 1) do
@@ -57,6 +72,15 @@ class PoolsControllerTest < ActionController::TestCase
end
end
context "edit action" do
should "render" do
pool = FactoryGirl.create(:pool)
get :edit, { id: pool.id }, { user_id: @user.id }
assert_response :success
end
end
context "update action" do
setup do
@pool = FactoryGirl.create(:pool)