tests: eliminate as_user helper.

This commit is contained in:
evazion
2020-06-11 01:02:01 -05:00
parent 2d05004bef
commit 99a9149fc4
24 changed files with 84 additions and 130 deletions

View File

@@ -7,7 +7,7 @@ class PoolsControllerTest < ActionDispatch::IntegrationTest
@user = create(:user)
@mod = create(:moderator_user)
end
as_user do
as(@user) do
@post = create(:post)
@pool = create(:pool)
end
@@ -112,9 +112,7 @@ class PoolsControllerTest < ActionDispatch::IntegrationTest
end
should "not allow reverting to a previous version of another pool" do
as_user do
@pool2 = create(:pool)
end
@pool2 = as(@user) { create(:pool) }
put_auth revert_pool_path(@pool), @user, params: {:version_id => @pool2.versions.first.id }
@pool.reload
assert_not_equal(@pool.name, @pool2.name)