Sha256: 1925e2da7adc19c25d1d66ec89d7df27555e337b2ff50c8693fb17daa36a62fa

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

require 'test_helper'

class Admin::ApplesControllerTest < ActionController::TestCase
  def setup
    @controller = Admin::ApplesController.new
  end

  describe 'GET #index' do
    it 'should be successful' do
      get :index
      assert_response :success
    end
  end

  describe 'GET #show' do
    let(:apple) { Apple.create(name: 'Granny Smith') }

    it 'should be successful' do
      get :show, id: apple.id
      assert_response :success
    end
  end

  describe 'GET #edit' do
    let(:apple) { Apple.create(name: 'Granny Smith') }

    it 'should be successful' do
      get :edit, id: apple.id
      assert_response :success
    end
  end

  describe 'GET #new' do
    it 'should be successful' do
      get :new
      assert_response :success
    end
  end

  describe 'helper methods' do
    it 'should be available in ApplesController' do
      assert_equal 'bar', @controller.foo_return
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ceo-0.2.0 test/controllers/admin/apples_controller_test.rb
ceo-0.1.7 test/controllers/admin/apples_controller_test.rb
ceo-0.1.6 test/controllers/admin/apples_controller_test.rb
ceo-0.1.5 test/controllers/admin/apples_controller_test.rb
ceo-0.1.4 test/controllers/admin/apples_controller_test.rb