Skip to content

Instantly share code, notes, and snippets.

@karmi
Created August 10, 2008 18:19
Show Gist options
  • Save karmi/4756 to your computer and use it in GitHub Desktop.
Save karmi/4756 to your computer and use it in GitHub Desktop.
def test_should_not_list_unpublished_projects
get :index
assert_equal 13, assigns(:projects).size
assert assigns(:projects).delete_if { |p| p.published? }.empty?
end
def test_should_show_404_when_trying_to_get_not_published_project
get :show, :id => 14
assert assigns(:project)
assert_response :not_found
assert_select 'h1', :text => 'Stránka nebyla nalezena'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment