Sha256: 6a761bf02ba5bc0f29ca9484f04eb6561939f502d8d66b252a6365657762708e

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 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
    assert_not_nil assigns(:pages)
  end

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

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

    assert_redirected_to page_path(assigns(:page))
  end

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

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

  test "should update page" do
    put :update, id: @page, page: { content: @page.content, title: @page.title }
    assert_redirected_to page_path(assigns(:page))
  end

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

    assert_redirected_to pages_path
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_admin_editor-0.2.4 test/dummy/test/functional/pages_controller_test.rb
active_admin_editor-0.2.3 test/dummy/test/functional/pages_controller_test.rb
active_admin_editor-0.2.2 test/dummy/test/functional/pages_controller_test.rb
active_admin_editor-0.2.1 test/dummy/test/functional/pages_controller_test.rb
active_admin_editor-0.2.0 test/dummy/test/functional/pages_controller_test.rb
active_admin_editor-0.1.0 test/dummy/test/functional/pages_controller_test.rb