Sha256: 0940cc4a9831cda6c869b083f94b985b046067f89945042ff0aaeb07f8a86391

Contents?: true

Size: 1.17 KB

Versions: 18

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

module Optimacms
  class ArticlesControllerTest < ActionController::TestCase
    setup do
      @article = 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: { text: @article.text, 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
      patch :update, id: @article, article: { text: @article.text, 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

18 entries across 18 versions & 1 rubygems

Version Path
optimacms-0.1.36 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.34 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.32 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.31 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.28 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.27 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.25 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.24 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.23 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.21 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.19 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.17 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.15 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.14 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.5 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.3 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.2 test/controllers/optimacms/articles_controller_test.rb
optimacms-0.1.1 test/controllers/optimacms/articles_controller_test.rb