decent_decoration 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e0d5a373d7d8d1aa38699d04423280215578b5e
4
- data.tar.gz: f53eac8c9a9008605952ebde1cde0391afb0a96d
3
+ metadata.gz: 675e5cca86a5c81f3cccc32a847bfae584b6e567
4
+ data.tar.gz: 4671f0e9906c0334084b145825ff87cd57257de3
5
5
  SHA512:
6
- metadata.gz: 4370746d93a63267459b49a993dc12014cc280aba7699c6111c0643fa47bbcd4266a791f428dc746c948cfa969433af85b189854441dbc0f16a9aa3033795d93
7
- data.tar.gz: 8ff8340e1b508ac921c1edf43937780f0fec5660e0e42d4e1f30a62f155c817e0113851ebc5444b13e26b0cd5b92c8eb83bf3eba8b3651269d2a10225f1e5f9d
6
+ metadata.gz: 7a75179eead1974c0cd04ce3cd7e5aa952970c48747da2472981349dbf1081b8a89c500a48daf83d57bcd83eaebcab75b4b6b724e075fddbe6481762c912dfd3
7
+ data.tar.gz: 6a7a969661910ce530fbe2c9c4072a56f234dc92170942b468394af4462b748884e3d07488197fe3eb48b87a112836a14c50fad52f5df67862005288eee20663
@@ -1,9 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - jruby-19mode
6
- - rbx-19mode
3
+ - 2.2.2
4
+ - 2.3.0
7
5
  notifications:
8
6
  email:
9
7
  recipients:
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.0
4
+
5
+ * make compatible with decent_exposure 3.0
6
+ * drop Ruby 1.9.3 support
7
+
3
8
  ## v0.0.6
4
9
 
5
10
  * fixed `decent_exposure` dependency [@madsheep]
@@ -1,127 +1,159 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- decent_decoration (0.0.5)
5
- decent_exposure (> 0)
4
+ decent_decoration (0.1.0)
5
+ decent_exposure (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (4.0.0)
11
- actionpack (= 4.0.0)
12
- mail (~> 2.5.3)
13
- actionpack (4.0.0)
14
- activesupport (= 4.0.0)
15
- builder (~> 3.1.0)
16
- erubis (~> 2.7.0)
17
- rack (~> 1.5.2)
10
+ actionmailer (4.2.6)
11
+ actionpack (= 4.2.6)
12
+ actionview (= 4.2.6)
13
+ activejob (= 4.2.6)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ actionpack (4.2.6)
17
+ actionview (= 4.2.6)
18
+ activesupport (= 4.2.6)
19
+ rack (~> 1.6)
18
20
  rack-test (~> 0.6.2)
19
- activemodel (4.0.0)
20
- activesupport (= 4.0.0)
21
- builder (~> 3.1.0)
22
- activerecord (4.0.0)
23
- activemodel (= 4.0.0)
24
- activerecord-deprecated_finders (~> 1.0.2)
25
- activesupport (= 4.0.0)
26
- arel (~> 4.0.0)
27
- activerecord-deprecated_finders (1.0.3)
28
- activesupport (4.0.0)
29
- i18n (~> 0.6, >= 0.6.4)
30
- minitest (~> 4.2)
31
- multi_json (~> 1.3)
32
- thread_safe (~> 0.1)
33
- tzinfo (~> 0.3.37)
34
- arel (4.0.0)
35
- atomic (1.1.13)
36
- builder (3.1.4)
37
- colorize (0.5.8)
38
- coveralls (0.6.7)
39
- colorize
40
- multi_json (~> 1.3)
41
- rest-client
42
- simplecov (>= 0.7)
43
- thor
44
- decent_exposure (2.2.1)
45
- diff-lcs (1.2.4)
46
- draper (1.2.1)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (4.2.6)
24
+ activesupport (= 4.2.6)
25
+ builder (~> 3.1)
26
+ erubis (~> 2.7.0)
27
+ rails-dom-testing (~> 1.0, >= 1.0.5)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ activejob (4.2.6)
30
+ activesupport (= 4.2.6)
31
+ globalid (>= 0.3.0)
32
+ activemodel (4.2.6)
33
+ activesupport (= 4.2.6)
34
+ builder (~> 3.1)
35
+ activerecord (4.2.6)
36
+ activemodel (= 4.2.6)
37
+ activesupport (= 4.2.6)
38
+ arel (~> 6.0)
39
+ activesupport (4.2.6)
40
+ i18n (~> 0.7)
41
+ json (~> 1.7, >= 1.7.7)
42
+ minitest (~> 5.1)
43
+ thread_safe (~> 0.3, >= 0.3.4)
44
+ tzinfo (~> 1.1)
45
+ arel (6.0.3)
46
+ builder (3.2.2)
47
+ concurrent-ruby (1.0.2)
48
+ coveralls (0.8.14)
49
+ json (>= 1.8, < 3)
50
+ simplecov (~> 0.12.0)
51
+ term-ansicolor (~> 1.3)
52
+ thor (~> 0.19.1)
53
+ tins (~> 1.6.0)
54
+ decent_exposure (3.0.0)
55
+ activesupport (>= 4.0)
56
+ diff-lcs (1.2.5)
57
+ docile (1.1.5)
58
+ draper (2.1.0)
47
59
  actionpack (>= 3.0)
60
+ activemodel (>= 3.0)
48
61
  activesupport (>= 3.0)
49
- request_store (~> 1.0.3)
62
+ request_store (~> 1.0)
50
63
  erubis (2.7.0)
51
- hike (1.2.3)
52
- i18n (0.6.5)
53
- mail (2.5.4)
54
- mime-types (~> 1.16)
55
- treetop (~> 1.4.8)
56
- mime-types (1.25)
57
- minitest (4.7.5)
58
- multi_json (1.7.9)
59
- polyglot (0.3.3)
60
- rack (1.5.2)
61
- rack-test (0.6.2)
64
+ globalid (0.3.6)
65
+ activesupport (>= 4.1.0)
66
+ i18n (0.7.0)
67
+ json (1.8.3)
68
+ loofah (2.0.3)
69
+ nokogiri (>= 1.5.9)
70
+ mail (2.6.4)
71
+ mime-types (>= 1.16, < 4)
72
+ mime-types (3.1)
73
+ mime-types-data (~> 3.2015)
74
+ mime-types-data (3.2016.0521)
75
+ mini_portile2 (2.1.0)
76
+ minitest (5.9.0)
77
+ nokogiri (1.6.8)
78
+ mini_portile2 (~> 2.1.0)
79
+ pkg-config (~> 1.1.7)
80
+ pkg-config (1.1.7)
81
+ rack (1.6.4)
82
+ rack-test (0.6.3)
62
83
  rack (>= 1.0)
63
- rails (4.0.0)
64
- actionmailer (= 4.0.0)
65
- actionpack (= 4.0.0)
66
- activerecord (= 4.0.0)
67
- activesupport (= 4.0.0)
84
+ rails (4.2.6)
85
+ actionmailer (= 4.2.6)
86
+ actionpack (= 4.2.6)
87
+ actionview (= 4.2.6)
88
+ activejob (= 4.2.6)
89
+ activemodel (= 4.2.6)
90
+ activerecord (= 4.2.6)
91
+ activesupport (= 4.2.6)
68
92
  bundler (>= 1.3.0, < 2.0)
69
- railties (= 4.0.0)
70
- sprockets-rails (~> 2.0.0)
71
- railties (4.0.0)
72
- actionpack (= 4.0.0)
73
- activesupport (= 4.0.0)
93
+ railties (= 4.2.6)
94
+ sprockets-rails
95
+ rails-deprecated_sanitizer (1.0.3)
96
+ activesupport (>= 4.2.0.alpha)
97
+ rails-dom-testing (1.0.7)
98
+ activesupport (>= 4.2.0.beta, < 5.0)
99
+ nokogiri (~> 1.6.0)
100
+ rails-deprecated_sanitizer (>= 1.0.1)
101
+ rails-html-sanitizer (1.0.3)
102
+ loofah (~> 2.0)
103
+ railties (4.2.6)
104
+ actionpack (= 4.2.6)
105
+ activesupport (= 4.2.6)
74
106
  rake (>= 0.8.7)
75
107
  thor (>= 0.18.1, < 2.0)
76
- rake (10.1.0)
77
- request_store (1.0.5)
78
- rest-client (1.6.7)
79
- mime-types (>= 1.16)
80
- rspec (2.14.1)
81
- rspec-core (~> 2.14.0)
82
- rspec-expectations (~> 2.14.0)
83
- rspec-mocks (~> 2.14.0)
84
- rspec-core (2.14.5)
85
- rspec-expectations (2.14.2)
86
- diff-lcs (>= 1.1.3, < 2.0)
87
- rspec-mocks (2.14.3)
88
- rspec-rails (2.14.0)
108
+ rake (11.2.2)
109
+ request_store (1.3.1)
110
+ rspec-core (3.5.1)
111
+ rspec-support (~> 3.5.0)
112
+ rspec-expectations (3.5.0)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.5.0)
115
+ rspec-mocks (3.5.0)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.5.0)
118
+ rspec-rails (3.5.1)
89
119
  actionpack (>= 3.0)
90
120
  activesupport (>= 3.0)
91
121
  railties (>= 3.0)
92
- rspec-core (~> 2.14.0)
93
- rspec-expectations (~> 2.14.0)
94
- rspec-mocks (~> 2.14.0)
95
- simplecov (0.7.1)
96
- multi_json (~> 1.0)
97
- simplecov-html (~> 0.7.1)
98
- simplecov-html (0.7.1)
99
- sprockets (2.10.0)
100
- hike (~> 1.2)
101
- multi_json (~> 1.0)
102
- rack (~> 1.0)
103
- tilt (~> 1.1, != 1.3.0)
104
- sprockets-rails (2.0.0)
105
- actionpack (>= 3.0)
106
- activesupport (>= 3.0)
107
- sprockets (~> 2.8)
108
- thor (0.18.1)
109
- thread_safe (0.1.2)
110
- atomic
111
- tilt (1.4.1)
112
- treetop (1.4.15)
113
- polyglot
114
- polyglot (>= 0.3.1)
115
- tzinfo (0.3.37)
122
+ rspec-core (~> 3.5.0)
123
+ rspec-expectations (~> 3.5.0)
124
+ rspec-mocks (~> 3.5.0)
125
+ rspec-support (~> 3.5.0)
126
+ rspec-support (3.5.0)
127
+ simplecov (0.12.0)
128
+ docile (~> 1.1.0)
129
+ json (>= 1.8, < 3)
130
+ simplecov-html (~> 0.10.0)
131
+ simplecov-html (0.10.0)
132
+ sprockets (3.6.3)
133
+ concurrent-ruby (~> 1.0)
134
+ rack (> 1, < 3)
135
+ sprockets-rails (3.1.1)
136
+ actionpack (>= 4.0)
137
+ activesupport (>= 4.0)
138
+ sprockets (>= 3.0.0)
139
+ term-ansicolor (1.3.2)
140
+ tins (~> 1.0)
141
+ thor (0.19.1)
142
+ thread_safe (0.3.5)
143
+ tins (1.6.0)
144
+ tzinfo (1.2.2)
145
+ thread_safe (~> 0.1)
116
146
 
117
147
  PLATFORMS
118
148
  ruby
119
149
 
120
150
  DEPENDENCIES
121
- activesupport (>= 3.2)
151
+ activesupport (~> 4.0)
122
152
  coveralls
123
153
  decent_decoration!
124
- draper (>= 1.0.0)
125
- rails (>= 3.2)
126
- rspec (~> 2.13)
127
- rspec-rails (~> 2.13)
154
+ draper (~> 2.1)
155
+ rails (~> 4.0)
156
+ rspec-rails (~> 3.0)
157
+
158
+ BUNDLED WITH
159
+ 1.11.2
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Tomasz Pewiński
1
+ Copyright (c) 2012-2014 netguru
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,14 +4,14 @@
4
4
  [![Coverage Status](https://coveralls.io/repos/netguru/decent_decoration/badge.png?branch=master)](https://coveralls.io/r/netguru/decent_decoration)
5
5
  [![Gem Version](https://badge.fury.io/rb/decent_decoration.png)](http://badge.fury.io/rb/decent_decoration)
6
6
 
7
- decent_decoration allows you to use excellent [decent_exposure][decent_exposure] gem with decorators.
7
+ decent_decoration allows you to use excellent [decent_exposure 3.0][decent_exposure] gem with decorators.
8
8
 
9
9
  ## Installation
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```
14
- gem 'decent_decoration'
14
+ gem 'decent_decoration', '~> 0.1.0'
15
15
  ```
16
16
 
17
17
  And then execute:
@@ -67,7 +67,7 @@ decent_decoration supports most of the awesome [decent_exposure api][decent_expo
67
67
  # app/controllers/attendees_controller.rb
68
68
  class AttendeesController < ApplicationController
69
69
  expose_decorated(:conference)
70
- expose_decorated(:attendees, ancestor: :conference)
70
+ expose_decorated(:attendees, scope: :conference)
71
71
  end
72
72
  ```
73
73
 
@@ -84,3 +84,5 @@ You can use any decorator mechanism as long as `ConferenceDecorator` responds to
84
84
  [decent_exposure]: https://github.com/voxdolo/decent_exposure
85
85
  [decent_exposure_api]: https://github.com/voxdolo/decent_exposure#usage
86
86
  [draper]: https://github.com/drapergem/draper
87
+
88
+ Copyright © 2012–2014 [netguru](https://netguru.co). See LICENSE for further details.
@@ -16,10 +16,12 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
- gem.add_runtime_dependency 'decent_exposure', '>= 2.0'
20
- gem.add_development_dependency 'rspec', '~> 2.13'
21
- gem.add_development_dependency 'rspec-rails', '~> 2.13'
22
- gem.add_development_dependency 'rails', '>= 3.2'
23
- gem.add_development_dependency 'activesupport', '>= 3.2'
24
- gem.add_development_dependency 'draper', '>= 1.0.0'
19
+
20
+ gem.required_ruby_version = "~> 2.0"
21
+
22
+ gem.add_runtime_dependency 'decent_exposure', '~> 3.0'
23
+ gem.add_development_dependency 'rspec-rails', "~> 3.0"
24
+ gem.add_development_dependency 'rails', '~> 4.0'
25
+ gem.add_development_dependency 'activesupport', '~> 4.0'
26
+ gem.add_development_dependency 'draper', '~> 2.1'
25
27
  end
@@ -13,9 +13,7 @@ module DecentDecoration
13
13
  end
14
14
 
15
15
  def options
16
- original_options.except(:decorator, :collection).tap do |h|
17
- h[:model] ||= name
18
- end
16
+ original_options.except(:decorator, :collection)
19
17
  end
20
18
 
21
19
  def decorator_class
@@ -35,7 +33,7 @@ module DecentDecoration
35
33
  private
36
34
 
37
35
  def infer_decorator_class
38
- "#{options[:model].to_s.classify}Decorator".constantize
36
+ "#{name.to_s.classify}Decorator".constantize
39
37
  end
40
38
 
41
39
  def decorate_collection?
@@ -60,15 +58,16 @@ module DecentDecoration
60
58
  end
61
59
 
62
60
  module ControllerMethods
63
- def expose_decorated(name, options = {}, &block)
61
+ def expose_decorated(name, *args, &block)
62
+ options = args.extract_options!
64
63
  decoration = Decoration.new(name, options)
65
64
 
66
65
  decorator_class = decoration.decorator_class
67
66
  decorate_method = decoration.decorate_method
68
- decorated_name = decoration.decorated_name
67
+ decorated_name = decoration.decorated_name
69
68
  options = decoration.options
70
69
 
71
- expose(name, options, &block)
70
+ expose(name, *args, options, &block)
72
71
  expose(decorated_name) { decorator_class.public_send(decorate_method, public_send(name)) }
73
72
 
74
73
  helper Module.new do
@@ -1,3 +1,3 @@
1
1
  module DecentDecoration
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -5,27 +5,27 @@ describe DecentDecoration::Decoration do
5
5
 
6
6
  it "should be initialized with name" do
7
7
  subject = klass.new(:conference)
8
- subject.name.should == :conference
8
+ expect(subject.name).to eq :conference
9
9
  end
10
10
 
11
11
  it "should be initialized with options" do
12
12
  subject = klass.new(:conference, { model: :conference })
13
- subject.options.should == { model: :conference }
13
+ expect(subject.options).to eq({ model: :conference })
14
14
  end
15
15
 
16
16
  describe "#decorated_name" do
17
17
  it "should consist of name prepended by decorated" do
18
- klass.new(:conference).decorated_name.should == :decorated_conference
18
+ expect(klass.new(:conference).decorated_name).to eq :decorated_conference
19
19
  end
20
20
  end
21
21
 
22
22
  describe "#decorator_class" do
23
23
  it "should infer the class from name" do
24
- klass.new(:conference).decorator_class.should == ConferenceDecorator
24
+ expect(klass.new(:conference).decorator_class).to eq ConferenceDecorator
25
25
  end
26
26
 
27
27
  it "should use :decorator if passed" do
28
- klass.new(:conference, decorator: AttendeeDecorator).decorator_class.should == AttendeeDecorator
28
+ expect(klass.new(:conference, decorator: AttendeeDecorator).decorator_class).to eq AttendeeDecorator
29
29
  end
30
30
  end
31
31
 
@@ -35,24 +35,24 @@ describe DecentDecoration::Decoration do
35
35
  let(:decorator) { double }
36
36
 
37
37
  it "should be :decorate_collection if decorator supports it" do
38
- decorator.stub(:decorate_collection)
39
- subject.decorate_method.should == :decorate_collection
38
+ allow(decorator).to receive(:decorate_collection)
39
+ expect(subject.decorate_method).to eq :decorate_collection
40
40
  end
41
41
 
42
42
  it "should be :decorate if decorator does not support :decorate_collection and supports :decorate" do
43
- decorator.stub(:decorate)
44
- subject.decorate_method.should == :decorate
43
+ allow(decorator).to receive(:decorate)
44
+ expect(subject.decorate_method).to eq :decorate
45
45
  end
46
46
 
47
47
  it "should be :new if decorator does not support :decorate_collection or :decorate" do
48
- subject.decorate_method.should == :new
48
+ expect(subject.decorate_method).to eq :new
49
49
  end
50
50
 
51
51
  it "should be :decorate if decorator supports it and collection: false" do
52
- decorator.stub(:decorate)
53
- decorator.stub(:decorate_collection)
52
+ allow(decorator).to receive(:decorate)
53
+ allow(decorator).to receive(:decorate_collection)
54
54
  subject = klass.new(:conferences, decorator: decorator, collection: false)
55
- subject.decorate_method.should == :decorate
55
+ expect(subject.decorate_method).to eq :decorate
56
56
  end
57
57
  end
58
58
 
@@ -61,24 +61,24 @@ describe DecentDecoration::Decoration do
61
61
  let(:decorator) { double }
62
62
 
63
63
  it "should not be :decorate_collection even if decorator supports it" do
64
- decorator.stub(:decorate_collection)
65
- subject.decorate_method.should_not == :decorate_collection
64
+ allow(decorator).to receive(:decorate_collection)
65
+ expect(subject.decorate_method).not_to eq :decorate_collection
66
66
  end
67
67
 
68
68
  it "should be :decorate_collection if decorator supports it and collection: true" do
69
- decorator.stub(:decorate)
70
- decorator.stub(:decorate_collection)
69
+ allow(decorator).to receive(:decorate)
70
+ allow(decorator).to receive(:decorate_collection)
71
71
  subject = klass.new(:conference, decorator: decorator, collection: true)
72
- subject.decorate_method.should == :decorate_collection
72
+ expect(subject.decorate_method).to eq :decorate_collection
73
73
  end
74
74
 
75
75
  it "should be :decorate if decorator supports it" do
76
- decorator.stub(:decorate)
77
- subject.decorate_method.should == :decorate
76
+ allow(decorator).to receive(:decorate)
77
+ expect(subject.decorate_method).to eq :decorate
78
78
  end
79
79
 
80
80
  it "should be :new if decorator does not support :decorate" do
81
- subject.decorate_method.should == :new
81
+ expect(subject.decorate_method).to eq :new
82
82
  end
83
83
  end
84
84
  end
@@ -1,29 +1,21 @@
1
1
  class ConferencesController < ActionController::Base
2
2
  include Rails.application.routes.url_helpers
3
3
 
4
- expose_decorated(:conference)
5
- expose_decorated(:other_conference, model: Conference, decorator: CoolConferenceDecorator)
4
+ expose_decorated :conference
5
+ expose_decorated :other_conference, model: Conference, decorator: CoolConferenceDecorator
6
6
 
7
7
  def show
8
8
  render :text => "foo"
9
9
  end
10
-
11
- def new
12
- render :text => "foo"
13
- end
14
10
  end
15
11
 
16
12
  class AttendeesController < ActionController::Base
17
13
  include Rails.application.routes.url_helpers
18
14
 
19
- expose_decorated(:attendee)
20
- expose_decorated(:attendees) { [Attendee.new, Attendee.new] }
15
+ expose_decorated :attendee
16
+ expose_decorated :attendees, ->{ [Attendee.new, Attendee.new] }
21
17
 
22
18
  def show
23
19
  render :text => "foo"
24
20
  end
25
-
26
- def new
27
- render :text => "foo"
28
- end
29
21
  end
@@ -10,21 +10,17 @@ require 'active_model'
10
10
  module Rails
11
11
  class App
12
12
  def env_config; {} end
13
+
13
14
  def routes
14
- return @routes if defined?(@routes)
15
- @routes = ActionDispatch::Routing::RouteSet.new
16
- @routes.draw do
17
- get '/conferences/new' => "conferences#new"
18
- get '/conference/(:id)' => "conferences#show"
19
- get '/attendees/new' => "attendees#new"
20
- get '/attendee/(:id)' => "attendees#show"
15
+ @routes ||= ActionDispatch::Routing::RouteSet.new.tap do |routes|
16
+ routes.draw do
17
+ resources :conferences, only: %i(show)
18
+ resources :attendees, only: %i(show)
19
+ end
21
20
  end
22
- @routes
23
- end
24
- def call(*args)
25
- routes.call(*args)
26
21
  end
27
22
  end
23
+
28
24
  def self.application
29
25
  @app ||= App.new
30
26
  end
@@ -4,16 +4,16 @@ require 'rspec/rails'
4
4
 
5
5
  describe AttendeesController, type: :controller do
6
6
  before do
7
- get '/attendee/dave'
7
+ get :show, id: 'dave'
8
8
  end
9
9
 
10
10
  it "should be a decorator" do
11
- controller.view_context.attendee.should be_instance_of(AttendeeDecorator)
11
+ expect(controller.view_context.attendee).to be_instance_of(AttendeeDecorator)
12
12
  end
13
13
 
14
14
  it "should be a decorator in collection" do
15
15
  controller.view_context.attendees.each do |attendee|
16
- attendee.should be_instance_of(AttendeeDecorator)
16
+ expect(attendee).to be_instance_of(AttendeeDecorator)
17
17
  end
18
18
  end
19
19
  end
@@ -3,38 +3,38 @@ require 'rspec/rails'
3
3
 
4
4
  describe ConferencesController, type: :controller do
5
5
  before do
6
- get '/conference/RuPy'
6
+ get :show, id: 'RuPy'
7
7
  end
8
8
 
9
9
  describe "inside a view" do
10
10
  it "should be a decorator" do
11
- controller.view_context.conference.should be_instance_of(ConferenceDecorator)
11
+ expect(controller.view_context.conference).to be_instance_of(ConferenceDecorator)
12
12
  end
13
13
 
14
14
  it "should have decorated conference" do
15
- controller.view_context.conference.decorated_object.should be_instance_of(Conference)
15
+ expect(controller.view_context.conference.decorated_object).to be_instance_of(Conference)
16
16
  end
17
17
 
18
18
  it "should be specified decorator" do
19
- controller.view_context.other_conference.should be_instance_of(CoolConferenceDecorator)
19
+ expect(controller.view_context.other_conference).to be_instance_of(CoolConferenceDecorator)
20
20
  end
21
21
 
22
22
  it "should cache decorator" do
23
- controller.view_context.conference.object_id.should == controller.view_context.conference.object_id
23
+ expect(controller.view_context.conference.object_id).to eq controller.view_context.conference.object_id
24
24
  end
25
25
 
26
26
  it "should cache decorated object" do
27
- controller.view_context.conference.decorated_object.object_id.should == controller.view_context.conference.decorated_object.object_id
27
+ expect(controller.view_context.conference.decorated_object.object_id).to eq controller.view_context.conference.decorated_object.object_id
28
28
  end
29
29
  end
30
30
 
31
31
  describe "inside a controller" do
32
32
  it "should be undecorated object" do
33
- controller.conference.should be_instance_of(Conference)
33
+ expect(controller.conference).to be_instance_of(Conference)
34
34
  end
35
35
 
36
36
  it "should not be specified decorator" do
37
- controller.other_conference.should be_instance_of(Conference)
37
+ expect(controller.other_conference).to be_instance_of(Conference)
38
38
  end
39
39
  end
40
40
  end
metadata CHANGED
@@ -1,99 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decent_decoration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Pewiński
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-29 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decent_exposure
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '2.13'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: '2.13'
26
+ version: '3.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rspec-rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ~>
31
+ - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '2.13'
33
+ version: '3.0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - ~>
38
+ - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '2.13'
40
+ version: '3.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rails
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - '>='
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '3.2'
47
+ version: '4.0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - '>='
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '3.2'
54
+ version: '4.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: activesupport
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '3.2'
61
+ version: '4.0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: '3.2'
68
+ version: '4.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: draper
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: 1.0.0
75
+ version: '2.1'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '>='
80
+ - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: 1.0.0
82
+ version: '2.1'
97
83
  description: Use decent_exposure with decorators (e.g. Draper)
98
84
  email:
99
85
  - pewniak747@gmail.com
@@ -101,8 +87,8 @@ executables: []
101
87
  extensions: []
102
88
  extra_rdoc_files: []
103
89
  files:
104
- - .gitignore
105
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".travis.yml"
106
92
  - CHANGELOG.md
107
93
  - Gemfile
108
94
  - Gemfile.lock
@@ -130,17 +116,17 @@ require_paths:
130
116
  - lib
131
117
  required_ruby_version: !ruby/object:Gem::Requirement
132
118
  requirements:
133
- - - '>='
119
+ - - "~>"
134
120
  - !ruby/object:Gem::Version
135
- version: '0'
121
+ version: '2.0'
136
122
  required_rubygems_version: !ruby/object:Gem::Requirement
137
123
  requirements:
138
- - - '>='
124
+ - - ">="
139
125
  - !ruby/object:Gem::Version
140
126
  version: '0'
141
127
  requirements: []
142
128
  rubyforge_project:
143
- rubygems_version: 2.0.3
129
+ rubygems_version: 2.4.5.1
144
130
  signing_key:
145
131
  specification_version: 4
146
132
  summary: Use decent_exposure with decorators (e.g. Draper)