Sha256: 1f7adb30b415a75b13fcb1429a0cbca8d13cd58d89e27204718ca4cf1d020aa7

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

require 'test_helper'

module Kblog
  class ArticlesControllerTest < ActionController::TestCase
    setup do
      @article = kblog_articles(:one)
    end
  
    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:articles)
    end
  
    test "should get new" do
      get :new
      assert_response :success
    end
  
    test "should create article" do
      assert_difference('Article.count') do
        post :create, article: { content: @article.content, title: @article.title }
      end
  
      assert_redirected_to article_path(assigns(:article))
    end
  
    test "should show article" do
      get :show, id: @article
      assert_response :success
    end
  
    test "should get edit" do
      get :edit, id: @article
      assert_response :success
    end
  
    test "should update article" do
      put :update, id: @article, article: { content: @article.content, title: @article.title }
      assert_redirected_to article_path(assigns(:article))
    end
  
    test "should destroy article" do
      assert_difference('Article.count', -1) do
        delete :destroy, id: @article
      end
  
      assert_redirected_to articles_path
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kblog-0.0.4 test/functional/kblog/articles_controller_test.rb
kblog-0.0.3 test/functional/kblog/articles_controller_test.rb
kblog-0.0.2 test/functional/kblog/articles_controller_test.rb
kblog-0.0.1 test/functional/kblog/articles_controller_test.rb