tests: add more pools controller tests.
This commit is contained in:
@@ -49,6 +49,21 @@ class PoolsControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
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
|
context "create action" do
|
||||||
should "create a pool" do
|
should "create a pool" do
|
||||||
assert_difference("Pool.count", 1) do
|
assert_difference("Pool.count", 1) do
|
||||||
@@ -57,6 +72,15 @@ class PoolsControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
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
|
context "update action" do
|
||||||
setup do
|
setup do
|
||||||
@pool = FactoryGirl.create(:pool)
|
@pool = FactoryGirl.create(:pool)
|
||||||
|
|||||||
Reference in New Issue
Block a user