Sha256: 6f3566711ab70ab669c825fb05178ceb2008ce84f2a404533b85a237f6274c52

Contents?: true

Size: 1.04 KB

Versions: 27

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class PostsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @post = posts(:one)
  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, published: @post.published, 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, published: @post.published, 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

27 entries across 27 versions & 1 rubygems

Version Path
cypress-on-rails-1.17.0 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.16.0 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.15.1 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.15.0 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.14.0 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.13.1 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.13.0 specs_e2e/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.12.1 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.12.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.11.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.10.1 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.9.1 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.9.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.8.1 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.8.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.7.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.6.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.5.1 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.5.0 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb
cypress-on-rails-1.4.2 spec/integrations/rails_5_2/test/controllers/posts_controller_test.rb