Sha256: 10f307aa15e1add5f346598ef41f9f02720b6e33d867571eb5d84092f53e53c0

Contents?: true

Size: 639 Bytes

Versions: 14

Compression:

Stored size: 639 Bytes

Contents

require "spec_helper"

class ControllerWithFlipFilters
  include Flip::ControllerFilters
end

describe ControllerWithFlipFilters do

  describe ".require_feature" do

    it "adds before_filter without options" do
      ControllerWithFlipFilters.tap do |klass|
        klass.should_receive(:before_filter).with({})
        klass.send(:require_feature, :testable)
      end
    end

    it "adds before_filter with options" do
      ControllerWithFlipFilters.tap do |klass|
        klass.should_receive(:before_filter).with({ only: [ :show ] })
        klass.send(:require_feature, :testable, only: [ :show ])
      end
    end

  end

end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
flip-1.0.1 spec/controller_filters_spec.rb
flip-1.0.0 spec/controller_filters_spec.rb
flip-0.2.1 spec/controller_filters_spec.rb
flip-0.2.0 spec/controller_filters_spec.rb
flip_fork-0.2.0 spec/controller_filters_spec.rb
flip_fork-0.1.1 spec/controller_filters_spec.rb
flip_fork-0.1.0 spec/controller_filters_spec.rb
flip-0.1.0 spec/controller_filters_spec.rb
flip-0.0.4 spec/controller_filters_spec.rb
flip-0.0.3 spec/controller_filters_spec.rb
flip-0.0.2 spec/controller_filters_spec.rb
flip-0.0.1 spec/controller_filters_spec.rb
flip-0.0.1.alpha2 spec/controller_filters_spec.rb
flip-0.0.1.alpha spec/controller_filters_spec.rb