def test_create
num_articles = Article.count
post :create, :article => {}
assert_response :redirect
assert_redirected_to :action => 'list'
assert_equal num_articles + 1, Article.count
end
def test_edit
get :edit, :id => 1
assert_response :success
assert_template 'edit'
assert_not_nil assigns(:article)
assert assigns(:article).valid?
end
-
Failure:
test_create(ArticlesControllerTest) [test/functional/
articles_controller_test.rb:99]:
Expected response to be a redirect to http://test.host/articles/list
but was a redirect to http://test.host/admin/login. -
Failure:
test_edit(ArticlesControllerTest) [test/functional/
articles_controller_test.rb:107]:
Expected response to be a <:success>, but was <302>
how do i solve these errors?
thank you