specstar-controllers 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/specstar/controllers.rb +5 -4
  2. metadata +1 -1
@@ -9,10 +9,11 @@ module Specstar
9
9
  end
10
10
  end
11
11
 
12
- def has_skip_before_filter?(controller, filter, action)
12
+ def has_skip_before_filter?(controller, filter, actions)
13
13
  controller._process_action_callbacks.select { |callback|
14
14
  callback.chain.select { |chain|
15
- chain.kind == :before && chain.filter.to_s == filter.to_s && (action.nil? || chain.per_key[:unless].include?("action_name == '#{action}'"))
15
+ actions_match = actions.nil? || actions.select { |action| !chain.per_key[:unless].include?("action_name == '#{action}'") }.empty?
16
+ chain.kind == :before && chain.filter.to_s == filter.to_s && actions_match
16
17
  }.size > 0
17
18
  }.size > 0
18
19
  end
@@ -27,8 +28,8 @@ module Specstar
27
28
  end
28
29
 
29
30
  RSpec::Matchers.define :have_skip_before_filter do |filter|
30
- chain :only do |action|
31
- @action = action
31
+ chain :only do |actions|
32
+ @action = *actions
32
33
  end
33
34
 
34
35
  match do |controller|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specstar-controllers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: