Add tests for reverting to foreign versions.
This commit is contained in:
@@ -127,6 +127,16 @@ class PostsControllerTest < ActionController::TestCase
|
||||
@post.reload
|
||||
assert_equal("aaaa", @post.tag_string)
|
||||
end
|
||||
|
||||
should "not allow reverting to a previous version of another post" do
|
||||
@post2 = FactoryGirl.create(:post, :uploader_id => @user.id, :tag_string => "herp")
|
||||
|
||||
post :revert, { :id => @post.id, :version_id => @post2.versions.first.id }, {:user_id => @user.id}
|
||||
@post.reload
|
||||
|
||||
assert_not_equal(@post.tag_string, @post2.tag_string)
|
||||
assert_response :missing
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user