end
def content_for_version(version=nil)
- result = content.versions.find_by_version(version.to_i) if version
- result ||= content
- result
+ if content
+ result = content.versions.find_by_version(version.to_i) if version
+ result ||= content
+ result
+ end
end
def diff(version_to=nil, version_from=nil)
assert_template 'edit'
end
+ def test_show_specific_version_of_an_unexistent_page_without_edit_right
+ get :show, :project_id => 1, :id => 'Unexistent page', :version => 1
+ assert_response 404
+ end
+
def test_show_unexistent_page_with_parent_should_preselect_parent
@request.session[:user_id] = 2
get :show, :project_id => 1, :id => 'Unexistent page', :parent => 'Another_page'