specstar-controllers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/specstar/controllers.rb +5 -4
- metadata +1 -1
data/lib/specstar/controllers.rb
CHANGED
@@ -9,10 +9,11 @@ module Specstar
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
def has_skip_before_filter?(controller, filter,
|
12
|
+
def has_skip_before_filter?(controller, filter, actions)
|
13
13
|
controller._process_action_callbacks.select { |callback|
|
14
14
|
callback.chain.select { |chain|
|
15
|
-
|
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 |
|
31
|
-
@action =
|
31
|
+
chain :only do |actions|
|
32
|
+
@action = *actions
|
32
33
|
end
|
33
34
|
|
34
35
|
match do |controller|
|