Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 8 files changed
  • 0 comments
  • 1 contributor
126  Gemfile.lock
... ...
@@ -1,80 +1,94 @@
1 1
 PATH
2 2
   remote: .
3 3
   specs:
4  
-    arturo (1.2.0)
  4
+    arturo (1.3.0)
5 5
       rails (~> 3.0)
6 6
 
7 7
 GEM
8 8
   remote: http://rubygems.org/
9 9
   specs:
10  
-    abstract (1.0.0)
11  
-    actionmailer (3.0.5)
12  
-      actionpack (= 3.0.5)
13  
-      mail (~> 2.2.15)
14  
-    actionpack (3.0.5)
15  
-      activemodel (= 3.0.5)
16  
-      activesupport (= 3.0.5)
17  
-      builder (~> 2.1.2)
18  
-      erubis (~> 2.6.6)
19  
-      i18n (~> 0.4)
20  
-      rack (~> 1.2.1)
21  
-      rack-mount (~> 0.6.13)
22  
-      rack-test (~> 0.5.7)
23  
-      tzinfo (~> 0.3.23)
24  
-    activemodel (3.0.5)
25  
-      activesupport (= 3.0.5)
26  
-      builder (~> 2.1.2)
27  
-      i18n (~> 0.4)
28  
-    activerecord (3.0.5)
29  
-      activemodel (= 3.0.5)
30  
-      activesupport (= 3.0.5)
31  
-      arel (~> 2.0.2)
32  
-      tzinfo (~> 0.3.23)
33  
-    activeresource (3.0.5)
34  
-      activemodel (= 3.0.5)
35  
-      activesupport (= 3.0.5)
36  
-    activesupport (3.0.5)
37  
-    arel (2.0.9)
38  
-    builder (2.1.2)
39  
-    erubis (2.6.6)
40  
-      abstract (>= 1.0.0)
  10
+    actionmailer (3.2.3)
  11
+      actionpack (= 3.2.3)
  12
+      mail (~> 2.4.4)
  13
+    actionpack (3.2.3)
  14
+      activemodel (= 3.2.3)
  15
+      activesupport (= 3.2.3)
  16
+      builder (~> 3.0.0)
  17
+      erubis (~> 2.7.0)
  18
+      journey (~> 1.0.1)
  19
+      rack (~> 1.4.0)
  20
+      rack-cache (~> 1.2)
  21
+      rack-test (~> 0.6.1)
  22
+      sprockets (~> 2.1.2)
  23
+    activemodel (3.2.3)
  24
+      activesupport (= 3.2.3)
  25
+      builder (~> 3.0.0)
  26
+    activerecord (3.2.3)
  27
+      activemodel (= 3.2.3)
  28
+      activesupport (= 3.2.3)
  29
+      arel (~> 3.0.2)
  30
+      tzinfo (~> 0.3.29)
  31
+    activeresource (3.2.3)
  32
+      activemodel (= 3.2.3)
  33
+      activesupport (= 3.2.3)
  34
+    activesupport (3.2.3)
  35
+      i18n (~> 0.6)
  36
+      multi_json (~> 1.0)
  37
+    arel (3.0.2)
  38
+    builder (3.0.0)
  39
+    erubis (2.7.0)
41 40
     factory_girl (1.3.2)
42  
-    i18n (0.5.0)
43  
-    mail (2.2.15)
44  
-      activesupport (>= 2.3.6)
  41
+    hike (1.2.1)
  42
+    i18n (0.6.0)
  43
+    journey (1.0.3)
  44
+    json (1.7.0)
  45
+    mail (2.4.4)
45 46
       i18n (>= 0.4.0)
46 47
       mime-types (~> 1.16)
47 48
       treetop (~> 1.4.8)
48  
-    mime-types (1.16)
  49
+    mime-types (1.18)
49 50
     mocha (0.9.8)
50 51
       rake
51  
-    polyglot (0.3.1)
52  
-    rack (1.2.2)
53  
-    rack-mount (0.6.14)
54  
-      rack (>= 1.0.0)
55  
-    rack-test (0.5.7)
  52
+    multi_json (1.3.4)
  53
+    polyglot (0.3.3)
  54
+    rack (1.4.1)
  55
+    rack-cache (1.2)
  56
+      rack (>= 0.4)
  57
+    rack-ssl (1.3.2)
  58
+      rack
  59
+    rack-test (0.6.1)
56 60
       rack (>= 1.0)
57  
-    rails (3.0.5)
58  
-      actionmailer (= 3.0.5)
59  
-      actionpack (= 3.0.5)
60  
-      activerecord (= 3.0.5)
61  
-      activeresource (= 3.0.5)
62  
-      activesupport (= 3.0.5)
  61
+    rails (3.2.3)
  62
+      actionmailer (= 3.2.3)
  63
+      actionpack (= 3.2.3)
  64
+      activerecord (= 3.2.3)
  65
+      activeresource (= 3.2.3)
  66
+      activesupport (= 3.2.3)
63 67
       bundler (~> 1.0)
64  
-      railties (= 3.0.5)
65  
-    railties (3.0.5)
66  
-      actionpack (= 3.0.5)
67  
-      activesupport (= 3.0.5)
  68
+      railties (= 3.2.3)
  69
+    railties (3.2.3)
  70
+      actionpack (= 3.2.3)
  71
+      activesupport (= 3.2.3)
  72
+      rack-ssl (~> 1.3.2)
68 73
       rake (>= 0.8.7)
69  
-      thor (~> 0.14.4)
  74
+      rdoc (~> 3.4)
  75
+      thor (~> 0.14.6)
70 76
     rake (0.8.7)
  77
+    rdoc (3.12)
  78
+      json (~> 1.4)
71 79
     redgreen (1.2.2)
72  
-    sqlite3-ruby (1.3.1)
  80
+    sprockets (2.1.3)
  81
+      hike (~> 1.2)
  82
+      rack (~> 1.0)
  83
+      tilt (~> 1.1, != 1.3.0)
  84
+    sqlite3 (1.3.5)
73 85
     thor (0.14.6)
  86
+    tilt (1.3.3)
74 87
     timecop (0.3.5)
75  
-    treetop (1.4.9)
  88
+    treetop (1.4.10)
  89
+      polyglot
76 90
       polyglot (>= 0.3.1)
77  
-    tzinfo (0.3.26)
  91
+    tzinfo (0.3.33)
78 92
 
79 93
 PLATFORMS
80 94
   ruby
@@ -85,5 +99,5 @@ DEPENDENCIES
85 99
   mocha
86 100
   rake
87 101
   redgreen (~> 1.2)
88  
-  sqlite3-ruby (~> 1.3)
  102
+  sqlite3
89 103
   timecop (~> 0.3)
4  app/models/arturo/feature.rb
@@ -29,8 +29,8 @@ def self.to_feature(feature_or_symbol)
29 29
     end
30 30
 
31 31
     # Create a new Feature
32  
-    def initialize(attributes = {})
33  
-      super(DEFAULT_ATTRIBUTES.merge(attributes || {}))
  32
+    def initialize(attributes = {}, options = {}, &block)
  33
+      super(DEFAULT_ATTRIBUTES.merge(attributes || {}), options, &block)
34 34
     end
35 35
 
36 36
     # @param [Object] feature_recipient a User, Account,
2  arturo.gemspec
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17 17
   gem.add_development_dependency  'mocha'
18 18
   gem.add_development_dependency  'rake'
19 19
   gem.add_development_dependency  'redgreen',     '~> 1.2'
20  
-  gem.add_development_dependency  'sqlite3-ruby', '~> 1.3'
  20
+  gem.add_development_dependency  'sqlite3'
21 21
   gem.add_development_dependency  'factory_girl', '~> 1.3'
22 22
   gem.add_development_dependency  'timecop',      '~> 0.3'
23 23
 end
4  test/dummy_app/Gemfile
... ...
@@ -1,5 +1,5 @@
1 1
 source 'http://rubygems.org'
2 2
 
3  
-gem 'rails', '3.0.1'
4  
-gem 'sqlite3-ruby', :require => 'sqlite3'
  3
+gem 'rails', '3.2.1'
  4
+gem 'sqlite3'#, :require => 'sqlite3'
5 5
 gem 'arturo', :path => File.expand_path('../../..', __FILE__)
144  test/dummy_app/Gemfile.lock
... ...
@@ -1,80 +1,94 @@
1 1
 PATH
2  
-  remote: /Users/jamesrosen/Projects/rmu/arturo
  2
+  remote: /Users/jamesarosen/Projects/arturo
3 3
   specs:
4  
-    arturo (1.1.3)
  4
+    arturo (1.3.0)
5 5
       rails (~> 3.0)
6 6
 
7 7
 GEM
8 8
   remote: http://rubygems.org/
9 9
   specs:
10  
-    abstract (1.0.0)
11  
-    actionmailer (3.0.1)
12  
-      actionpack (= 3.0.1)
13  
-      mail (~> 2.2.5)
14  
-    actionpack (3.0.1)
15  
-      activemodel (= 3.0.1)
16  
-      activesupport (= 3.0.1)
17  
-      builder (~> 2.1.2)
18  
-      erubis (~> 2.6.6)
19  
-      i18n (~> 0.4.1)
20  
-      rack (~> 1.2.1)
21  
-      rack-mount (~> 0.6.12)
22  
-      rack-test (~> 0.5.4)
23  
-      tzinfo (~> 0.3.23)
24  
-    activemodel (3.0.1)
25  
-      activesupport (= 3.0.1)
26  
-      builder (~> 2.1.2)
27  
-      i18n (~> 0.4.1)
28  
-    activerecord (3.0.1)
29  
-      activemodel (= 3.0.1)
30  
-      activesupport (= 3.0.1)
31  
-      arel (~> 1.0.0)
32  
-      tzinfo (~> 0.3.23)
33  
-    activeresource (3.0.1)
34  
-      activemodel (= 3.0.1)
35  
-      activesupport (= 3.0.1)
36  
-    activesupport (3.0.1)
37  
-    arel (1.0.1)
38  
-      activesupport (~> 3.0.0)
39  
-    builder (2.1.2)
40  
-    erubis (2.6.6)
41  
-      abstract (>= 1.0.0)
42  
-    i18n (0.4.1)
43  
-    mail (2.2.7)
44  
-      activesupport (>= 2.3.6)
45  
-      mime-types
46  
-      treetop (>= 1.4.5)
47  
-    mime-types (1.16)
48  
-    polyglot (0.3.1)
49  
-    rack (1.2.1)
50  
-    rack-mount (0.6.13)
51  
-      rack (>= 1.0.0)
52  
-    rack-test (0.5.6)
  10
+    actionmailer (3.2.1)
  11
+      actionpack (= 3.2.1)
  12
+      mail (~> 2.4.0)
  13
+    actionpack (3.2.1)
  14
+      activemodel (= 3.2.1)
  15
+      activesupport (= 3.2.1)
  16
+      builder (~> 3.0.0)
  17
+      erubis (~> 2.7.0)
  18
+      journey (~> 1.0.1)
  19
+      rack (~> 1.4.0)
  20
+      rack-cache (~> 1.1)
  21
+      rack-test (~> 0.6.1)
  22
+      sprockets (~> 2.1.2)
  23
+    activemodel (3.2.1)
  24
+      activesupport (= 3.2.1)
  25
+      builder (~> 3.0.0)
  26
+    activerecord (3.2.1)
  27
+      activemodel (= 3.2.1)
  28
+      activesupport (= 3.2.1)
  29
+      arel (~> 3.0.0)
  30
+      tzinfo (~> 0.3.29)
  31
+    activeresource (3.2.1)
  32
+      activemodel (= 3.2.1)
  33
+      activesupport (= 3.2.1)
  34
+    activesupport (3.2.1)
  35
+      i18n (~> 0.6)
  36
+      multi_json (~> 1.0)
  37
+    arel (3.0.2)
  38
+    builder (3.0.0)
  39
+    erubis (2.7.0)
  40
+    hike (1.2.1)
  41
+    i18n (0.6.0)
  42
+    journey (1.0.3)
  43
+    json (1.7.0)
  44
+    mail (2.4.4)
  45
+      i18n (>= 0.4.0)
  46
+      mime-types (~> 1.16)
  47
+      treetop (~> 1.4.8)
  48
+    mime-types (1.18)
  49
+    multi_json (1.3.4)
  50
+    polyglot (0.3.3)
  51
+    rack (1.4.1)
  52
+    rack-cache (1.2)
  53
+      rack (>= 0.4)
  54
+    rack-ssl (1.3.2)
  55
+      rack
  56
+    rack-test (0.6.1)
53 57
       rack (>= 1.0)
54  
-    rails (3.0.1)
55  
-      actionmailer (= 3.0.1)
56  
-      actionpack (= 3.0.1)
57  
-      activerecord (= 3.0.1)
58  
-      activeresource (= 3.0.1)
59  
-      activesupport (= 3.0.1)
60  
-      bundler (~> 1.0.0)
61  
-      railties (= 3.0.1)
62  
-    railties (3.0.1)
63  
-      actionpack (= 3.0.1)
64  
-      activesupport (= 3.0.1)
65  
-      rake (>= 0.8.4)
66  
-      thor (~> 0.14.0)
67  
-    rake (0.8.7)
68  
-    sqlite3-ruby (1.3.1)
69  
-    thor (0.14.3)
70  
-    treetop (1.4.8)
  58
+    rails (3.2.1)
  59
+      actionmailer (= 3.2.1)
  60
+      actionpack (= 3.2.1)
  61
+      activerecord (= 3.2.1)
  62
+      activeresource (= 3.2.1)
  63
+      activesupport (= 3.2.1)
  64
+      bundler (~> 1.0)
  65
+      railties (= 3.2.1)
  66
+    railties (3.2.1)
  67
+      actionpack (= 3.2.1)
  68
+      activesupport (= 3.2.1)
  69
+      rack-ssl (~> 1.3.2)
  70
+      rake (>= 0.8.7)
  71
+      rdoc (~> 3.4)
  72
+      thor (~> 0.14.6)
  73
+    rake (0.9.2.2)
  74
+    rdoc (3.12)
  75
+      json (~> 1.4)
  76
+    sprockets (2.1.3)
  77
+      hike (~> 1.2)
  78
+      rack (~> 1.0)
  79
+      tilt (~> 1.1, != 1.3.0)
  80
+    sqlite3 (1.3.5)
  81
+    thor (0.14.6)
  82
+    tilt (1.3.3)
  83
+    treetop (1.4.10)
  84
+      polyglot
71 85
       polyglot (>= 0.3.1)
72  
-    tzinfo (0.3.23)
  86
+    tzinfo (0.3.33)
73 87
 
74 88
 PLATFORMS
75 89
   ruby
76 90
 
77 91
 DEPENDENCIES
78 92
   arturo!
79  
-  rails (= 3.0.1)
80  
-  sqlite3-ruby
  93
+  rails (= 3.2.1)
  94
+  sqlite3
5  test/dummy_app/db/schema.rb
... ...
@@ -1,3 +1,4 @@
  1
+# encoding: UTF-8
1 2
 # This file is auto-generated from the current state of the database. Instead
2 3
 # of editing this file, please use the migrations feature of Active Record to
3 4
 # incrementally modify your database, and then regenerate this schema definition.
@@ -15,8 +16,8 @@
15 16
   create_table "features", :force => true do |t|
16 17
     t.string   "symbol",                :null => false
17 18
     t.integer  "deployment_percentage", :null => false
18  
-    t.datetime "created_at"
19  
-    t.datetime "updated_at"
  19
+    t.datetime "created_at",            :null => false
  20
+    t.datetime "updated_at",            :null => false
20 21
   end
21 22
 
22 23
 end
4  test/dummy_app/test/functional/controller_filters_test.rb
@@ -13,6 +13,10 @@ def setup
13 13
     Factory(:feature, :symbol => :book_holds, :deployment_percentage => 0)
14 14
   end
15 15
 
  16
+  def test_on_feature_disabled_not_an_action
  17
+    assert !@controller.action_methods.include?(:on_feature_disabled)
  18
+  end
  19
+
16 20
   def test_get_show
17 21
     get :show, :id => '2'
18 22
     assert_response :success
38  test/dummy_app/test/unit/features_helper_test.rb
@@ -3,37 +3,23 @@
3 3
 
4 4
 class ArturoFeaturesHelperTest < ActiveSupport::TestCase
5 5
 
6  
-  ERBHandler = ActionView::Template::Handlers::ERB
  6
+  include ActionView::Helpers::TagHelper
  7
+  include Arturo::FeaturesHelper
7 8
 
8  
-  class Context
9  
-    include Arturo::FeaturesHelper
10  
-    attr_accessor :_template, :output_buffer
  9
+  attr_accessor :output_buffer
11 10
 
12  
-    def initialize
13  
-      @output_buffer = "original"
14  
-      @_virtual_path = nil
15  
-    end
16  
-
17  
-    def bad_feature
18  
-      feature = Factory(:feature)  
19  
-      feature.deployment_percentage = 101
20  
-      feature.valid?
21  
-      return feature
  11
+  def bad_feature
  12
+    @bad_feature ||= Factory(:feature).tap do |f|
  13
+      f.deployment_percentage = 101
  14
+      f.valid?
22 15
     end
23 16
   end
24  
-  
25  
-  def test_error_messages_for
26  
-    output = "<ul class=\"errors\"><li class=\"error\">must be less than or equal to 100</li></ul>"
27 17
 
28  
-    template_result = ActionView::Template.new(
29  
-      "<%= error_messages_for(bad_feature, :deployment_percentage) %>",
30  
-      "partial",
31  
-      ERBHandler,
32  
-      :virtual_path => "partial"
33  
-    )
  18
+  def test_error_messages_for
  19
+    expected = "<ul class=\"errors\"><li class=\"error\">must be less than or equal to 100</li></ul>"
  20
+    actual = error_messages_for(bad_feature, :deployment_percentage)
34 21
 
35  
-    assert_equal output, template_result.render( Context.new, {} )
36  
-    assert template_result.render( Context.new, {} ).html_safe?
37  
-  
  22
+    assert_equal expected, actual
  23
+    assert actual.html_safe?
38 24
   end
39 25
 end

No commit comments for this range

Something went wrong with that request. Please try again.