feature_toggle 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ module FeatureToggle
24
24
  end
25
25
 
26
26
  def active_action?(controller, action)
27
- feature = @actions["#{controller}:#{action}"]
27
+ feature = @actions["#{controller}:#{action}"] || @actions["#{controller}:*"]
28
28
  active?(feature)
29
29
  end
30
30
 
@@ -45,6 +45,17 @@ class FeatureToggleTest < Test::Unit::TestCase
45
45
  assert features.active_action?('users', 'destroy')
46
46
  end
47
47
 
48
+ def test_deactivate_all_actions_in_controller_for_feature_with_asterisk
49
+ features = load_features
50
+ assert features.active_action?('foot', 'kick')
51
+ assert features.active_action?('foot', 'anything')
52
+
53
+ features.deactivate("xli")
54
+
55
+ assert !features.active_action?('foot', 'kick')
56
+ assert !features.active_action?('foot', 'anything')
57
+ end
58
+
48
59
  def load_features
49
60
  config = File.join(File.dirname(__FILE__), 'features.yml')
50
61
  FeatureToggle.load(config)
@@ -8,4 +8,7 @@ wpc:
8
8
  - jump
9
9
  rao:
10
10
  hand:
11
- - wave
11
+ - wave
12
+ xli:
13
+ foot:
14
+ - '*'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_toggle
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:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-15 00:00:00.000000000 Z
12
+ date: 2012-10-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: mingle.saas@thoughtworks.com
@@ -19,8 +19,8 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - lib/feature_toggle/features.rb
21
21
  - lib/feature_toggle.rb
22
- - test/feature_toggle_test.rb
23
22
  - test/features.yml
23
+ - test/feature_toggle_test.rb
24
24
  - Rakefile
25
25
  - README.md
26
26
  - CHANGELOG.md
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 1.8.24
47
+ rubygems_version: 1.8.11
48
48
  signing_key:
49
49
  specification_version: 3
50
50
  summary: Feature Toggle library for ruby