Sha256: b6a4f22c29c2a9c7e5006e91324e82fc5ea1762e93387c04b0c0da88400e8dee

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

require 'spec_helper'

describe BooksController, 'action hooks' do
  before do
    Book.delete_all
    @book = Book.create! title: 'Head First ActionArgs'
    get :show, id: @book.id
  end

  describe 'before_action' do
    context 'via Symbol' do
      subject { assigns :book }
      it { should == @book }
    end

    context 'via String' do
      subject { assigns :string_filter_executed }
      it { should be_true }
    end

    context 'via Proc' do
      subject { assigns :proc_filter_executed }
      it { should be_true }
    end
  end

  describe 'around_action' do
    subject { assigns :elapsed_time }
    it { should be }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
action_args-1.5.4 spec/controllers/hooks_spec.rb
action_args-1.5.3 spec/controllers/hooks_spec.rb
action_args-1.5.2 spec/controllers/hooks_spec.rb
action_args-1.5.1 spec/controllers/hooks_spec.rb