From b9d1bb1e12349feff1b425e5c1e28abf98407436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=83=8A=E5=9D=A4?= Date: Fri, 8 Jan 2016 23:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=B4=E6=97=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/controllers/articles_controller_test.rb~ | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 test/controllers/articles_controller_test.rb~ diff --git a/test/controllers/articles_controller_test.rb~ b/test/controllers/articles_controller_test.rb~ deleted file mode 100644 index bb72ffa..0000000 --- a/test/controllers/articles_controller_test.rb~ +++ /dev/null @@ -1,46 +0,0 @@ -require 'test_helper' -require 'articles_controller' - -class ArticlesControllerTest < ActionController::TestCase - setup do - @controller = AriticlesController.new - @ariticle = Ariticle.new - @ariticle.title = 'title1' - @ariticle.tags = 'tags1' - @ariticle.source = 'source1' - @ariticle.content = 'content1' - @ariticle.save - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:articles) - end - - test "should show article" do - get :show, id: @ariticle.id - assert_response :success - end - - test "should create ariticle" do - post :create,:ariticle =>{:title=>'title1', :tags=>'tags1', :source=>'source', :content=>'content1'} - assert_not_nil session[:ariticle_id] - assert_redirected_to article_path(@ariticle) - end - - test "should destroy article" do - assert_difference('Article.count', -1) do - delete :destroy, id: @article.id - end - - assert_redirected_to articles_path - end - - test "destroy_wrong" do - post :destroy, :ariticle=>{:username=>'title1'} - assert_response :success - assert_equal '删除失败', flash[:error] - end - -end