Sha256: 251ebb36d02acdeae4d8141e4f81c46c3c10d968cabaa829ab16871f325c4a28

Contents?: true

Size: 1.55 KB

Versions: 27

Compression:

Stored size: 1.55 KB

Contents

require 'test_helper'

module Notee
  class PostsControllerTest < ActionController::TestCase
    setup do
      @post = notee_posts(:one)
      @routes = Engine.routes
    end

    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:posts)
    end

    test "should get new" do
      get :new
      assert_response :success
    end

    test "should create post" do
      assert_difference('Post.count') do
        post :create, post: { category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
      end

      assert_redirected_to post_path(assigns(:post))
    end

    test "should show post" do
      get :show, id: @post
      assert_response :success
    end

    test "should get edit" do
      get :notee, id: @post
      assert_response :success
    end

    test "should update post" do
      patch :update, id: @post, post: { category_id: @post.category_id, content: @post.content, published_at: @post.published_at, seo_description: @post.seo_description, seo_keyword: @post.seo_keyword, slug: @post.slug, status: @post.status, thumbnail_id: @post.thumbnail_id, title: @post.title }
      assert_redirected_to post_path(assigns(:post))
    end

    test "should destroy post" do
      assert_difference('Post.count', -1) do
        delete :destroy, id: @post
      end

      assert_redirected_to posts_path
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
notee-1.0.7 test/controllers/notee/posts_controller_test.rb
notee-1.0.6 test/controllers/notee/posts_controller_test.rb
notee-1.0.5 test/controllers/notee/posts_controller_test.rb
notee-1.0.4 test/controllers/notee/posts_controller_test.rb
notee-1.0.3 test/controllers/notee/posts_controller_test.rb
notee-1.0.2 test/controllers/notee/posts_controller_test.rb
notee-1.0.1 test/controllers/notee/posts_controller_test.rb
notee-1.0.0 test/controllers/notee/posts_controller_test.rb
notee-0.4.0 test/controllers/notee/posts_controller_test.rb
notee-0.3.7 test/controllers/notee/posts_controller_test.rb
notee-0.3.6 test/controllers/notee/posts_controller_test.rb
notee-0.3.5 test/controllers/notee/posts_controller_test.rb
notee-0.3.4.1 test/controllers/notee/posts_controller_test.rb
notee-0.3.4 test/controllers/notee/posts_controller_test.rb
notee-0.3.3 test/controllers/notee/posts_controller_test.rb
notee-0.3.2 test/controllers/notee/posts_controller_test.rb
notee-0.3.1 test/controllers/notee/posts_controller_test.rb
notee-0.3.0 test/controllers/notee/posts_controller_test.rb
notee-0.2.9 test/controllers/notee/posts_controller_test.rb
notee-0.2.8 test/controllers/notee/posts_controller_test.rb