Sha256: 275d27bdd2ca9fc51c8c2bc3ed357e2d517f5380702b2644353a90d03f971feb

Contents?: true

Size: 1.01 KB

Versions: 83

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'

class PostsControllerTest < ActionController::TestCase
  setup do
    @post = posts(:one)
  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: { content: @post.content, 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 :edit, id: @post
    assert_response :success
  end

  test "should update post" do
    put :update, id: @post, post: { content: @post.content, 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

Version data entries

83 entries across 83 versions & 4 rubygems

Version Path
ab_panel-0.4.4 example/test/functional/posts_controller_test.rb
ab_panel-0.4.3 example/test/functional/posts_controller_test.rb
ab_panel-0.4.2 example/test/functional/posts_controller_test.rb
ouvrages_file_uploader-0.0.3 test/dummy/test/functional/posts_controller_test.rb
ab_panel-0.4.1 example/test/functional/posts_controller_test.rb
ab_panel-0.4.0 example/test/functional/posts_controller_test.rb
ouvrages_file_uploader-0.0.2 test/dummy/test/functional/posts_controller_test.rb
ouvrages_file_uploader-0.0.1 test/dummy/test/functional/posts_controller_test.rb
ab_panel-0.3.3 example/test/functional/posts_controller_test.rb
ab_panel-0.3.2 example/test/functional/posts_controller_test.rb
translation_center-1.7.2 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.8.4 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.8.3 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.8.2 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.8.1 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.8.0 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.7.9 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.7.8 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-0.0.0 test/dummy/test/functional/posts_controller_test.rb
afalkear_translation_center-1.7.7 test/dummy/test/functional/posts_controller_test.rb