Add tests for reverting to foreign versions.

This commit is contained in:
evazion
2016-10-11 04:07:28 +00:00
parent 23ad02fa9c
commit 80895ef46e
7 changed files with 102 additions and 5 deletions

View File

@@ -107,6 +107,16 @@ class PoolsControllerTest < ActionController::TestCase
@pool.reload
assert_equal([@post.id], @pool.post_id_array)
end
should "not allow reverting to a previous version of another pool" do
@pool2 = FactoryGirl.create(:pool)
post :revert, { :id => @pool.id, :version_id => @pool2.versions(true).first.id }, {:user_id => @user.id}
@pool.reload
assert_not_equal(@pool.name, @pool2.name)
assert_response :missing
end
end
end
end