Sha256: 43882d789327d1a00c587b3b243eea11b6e2a33e9bdc11ccb02753e8e4cd2d48

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

require 'test_helper'

class DucksControllerTest < ActionController::TestCase
  
  context 'create' do
    setup do
      @duck = ducks(:basic)
      post :create, :duck => @duck.attributes
      @duck = Duck.find(:all).last
    end
    should_redirect_to 'duck_path(@duck)'
  end
  
  context 'update' do
    setup do
      @duck = ducks(:basic)
      put :update, :id => @duck.to_param, :duck => @duck.attributes
    end
    should_redirect_to 'duck_path(@duck)'
  end
  
  context 'destroy' do
    setup do
      @duck = ducks(:basic)
      delete :destroy, :id => @duck.to_param
    end
    should_redirect_to 'ducks_path'
  end
  
  context 'new' do
    setup do
      get :new
    end
    should_respond_with :success
    should_render_template :new
    should_assign_to :duck
  end
  
  context 'edit' do
    setup do
      @duck = ducks(:basic)
      get :edit, :id => @duck.to_param
    end
    should_respond_with :success
    should_render_template :edit
    should_assign_to :duck
  end
  
  context 'show' do
    setup do
      @duck = ducks(:basic)
      get :show, :id => @duck.to_param
    end
    should_respond_with :success
    should_render_template :show
    should_assign_to :duck
  end
  
  context 'index' do
    setup do
      get :index
    end
    should_respond_with :success
    should_assign_to :ducks
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
akitaonrails-dry_scaffold-0.3.3 generators/dry_scaffold/prototypes/controllers/tests/shoulda/functional_test.rb