Sha256: 844b3cedb923ca7ed1cf6eed5cf4ef37764b46c17552919ce1ffe1338bbe1845

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'

class PagesControllerTest < ActionController::TestCase
  setup do
    @page = pages(:one)
  end

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

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

  test "should create page" do
    assert_difference('Page.count') do
      post :create, params: { page: { header: @page.header, page: @page.page, title: @page.title } }
    end

    assert_redirected_to page_path(Page.last)
  end

  test "should show page" do
    get :show, params: { id: @page }
    assert_response :success
  end

  test "should get edit" do
    get :edit, params: { id: @page }
    assert_response :success
  end

  test "should update page" do
    patch :update, params: { id: @page, page: { header: @page.header, page: @page.page, title: @page.title } }
    assert_redirected_to page_path(@page)
  end

  test "should destroy page" do
    assert_difference('Page.count', -1) do
      delete :destroy, params: { id: @page }
    end

    assert_redirected_to pages_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trix_add_on-0.1.4 test/dummy/test/controllers/pages_controller_test.rb
trix_add_on-0.1.3 test/dummy/test/controllers/pages_controller_test.rb