Sha256: 85ca6863793e120a18b8daaa742b27f13b8165b43add7ecab76d33104114d3ac

Contents?: true

Size: 1.03 KB

Versions: 18

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'

class PostsControllerTest < ActionDispatch::IntegrationTest
  include GroongaClientModel::TestHelper

  setup do
    @post = create(:post)
  end

  test "should get index" do
    get posts_url
    assert_response :success
  end

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

  test "should create post" do
    assert_difference('Post.count') do
      post posts_url, params: { post: { body: @post.body, title: @post.title } }
    end

    assert_redirected_to post_url(Post.last)
  end

  test "should show post" do
    get post_url(@post)
    assert_response :success
  end

  test "should get edit" do
    get edit_post_url(@post)
    assert_response :success
  end

  test "should update post" do
    patch post_url(@post), params: { post: { body: @post.body, title: @post.title } }
    assert_redirected_to post_url(@post)
  end

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

    assert_redirected_to posts_url
  end
end

Version data entries

18 entries across 13 versions & 1 rubygems

Version Path
groonga-client-model-1.0.2 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-1.0.1 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-1.0.0 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.9 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.9 test/apps/rails4/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.8 test/apps/rails4/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.8 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.7 test/apps/rails4/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.7 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.6 test/apps/rails4/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.6 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.5 test/apps/rails4/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.5 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.4 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.3 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.2 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.1 test/apps/rails5/test/controllers/posts_controller_test.rb
groonga-client-model-0.9.0 test/apps/rails5/test/controllers/posts_controller_test.rb