Permalink
Browse files

Fix gate values not being used in features action.

  • Loading branch information...
1 parent 26b3499 commit 0e7e43abfcf29bcc28f1badc2b08ba3df6b986ad @jnunemaker committed Feb 18, 2013
Showing with 7 additions and 1 deletion.
  1. +2 −1 lib/flipper/ui/actions/features.rb
  2. +5 −0 spec/flipper-ui/middleware_spec.rb
@@ -10,7 +10,8 @@ class Features < UI::Action
def get
features = flipper.features.map { |feature|
- Decorators::Feature.new(feature)
+ gate_values = flipper.adapter.get(feature)
+ Decorators::Feature.new(feature, gate_values)
}
json_response features.map(&:as_json)
@@ -73,6 +73,11 @@ def gate_value(feature_name, gate_key)
feature['name'].should eq('New Stats')
feature['state'].should eq('on')
feature['description'].should eq('Enabled')
+ feature['gates'].first.should eq({
+ 'name' => 'boolean',
+ 'key' => 'boolean',
+ 'value' => true,
+ })
feature = features[1]
feature['id'].should eq('search')

0 comments on commit 0e7e43a

Please sign in to comment.