active_decorator-rspec 0.0.5 → 0.0.6

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: 11702bcbf9f5f24e8b5af8264182ade9007607e9
4
- data.tar.gz: d7410dea37d4a9a87ef95b2bbe71ad651726ce4c
3
+ metadata.gz: d498ef0af2b6bdd45ff7593f3dbb46e5368175d5
4
+ data.tar.gz: f19f2aba1e6a4717a0dcb1c48b022d8f55dd42c4
5
5
  SHA512:
6
- metadata.gz: 13223635f87b9977e3ec838c173320bf82b7c28a50073dfd1e6ace9d44a1683cf5e0722ce9974129b65b6a24004ef637cf01c6a20f5e52c2a89563b78f24abdc
7
- data.tar.gz: 452853ea66c1b5a0c556506c58d56085833dd89dfc8315aa32f878a2d9dfcff77dd25d27bbe301cc087ca6633d279a5fc270106b12fd4de1886c3d0b47a8cf65
6
+ metadata.gz: 240703698659cad4214d0d2446c1c3a9c75df5bf4c8169cdd93fbf08fdcec4a3c993e9037466a9273bf614f81b9dd636a7e4569e99403264a7e7868e58c21b28
7
+ data.tar.gz: ede893d84f62804bbabe793b8a4d45997b19f2ededb3c2c1f83a177baa43066128c263e48ed531c409d5ca5b2175c9eb0ae00daa887c69da7e41895f79899628
@@ -8,8 +8,11 @@ module ActiveDecorator
8
8
  def self.enable(example)
9
9
  example.extend self
10
10
 
11
- base_class = defined?(ApplicationController) ? \
12
- ApplicationController : ActionController::Base
11
+ base_class = begin
12
+ ApplicationController
13
+ rescue NameError
14
+ ActionController::Base
15
+ end
13
16
  controller = Class.new(base_class).new
14
17
  controller.request = ActionController::TestRequest.new
15
18
  if ActiveDecorator::ViewContext.respond_to?(:current=)
@@ -1,5 +1,5 @@
1
1
  module ActiveDecorator
2
2
  module RSpec
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -17,5 +17,7 @@ describe AuthorDecorator do
17
17
  its(:link) { should eq %(<a href="/authors/#{author.id}">boo</a>) }
18
18
 
19
19
  its(:url) { should eq "http://test.host/authors/#{author.id}" }
20
+
21
+ its(:link_if_admin) { should eq %(<a href="/authors/#{author.id}">boo</a>) }
20
22
  end
21
23
  end
data/spec/dummy_app.rb CHANGED
@@ -10,6 +10,7 @@ module DummyApp
10
10
  config.session_store :cookie_store, :key => '_dummy_app_session'
11
11
  config.active_support.deprecation = :log
12
12
  config.eager_load = false
13
+ config.root = File.join(File.dirname(__FILE__), 'dummy_app')
13
14
  end
14
15
  end
15
16
  DummyApp::Application.initialize!
@@ -37,9 +38,10 @@ module AuthorDecorator
37
38
  def url
38
39
  author_url(self)
39
40
  end
40
- end
41
41
 
42
- class ApplicationController < ActionController::Base
42
+ def link_if_admin
43
+ link if admin?
44
+ end
43
45
  end
44
46
 
45
47
  class Author < ActiveRecord::Base
@@ -0,0 +1,7 @@
1
+ class ApplicationController < ActionController::Base
2
+ helper_method :admin?
3
+
4
+ def admin?
5
+ true
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_decorator-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mizokami
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-22 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -154,6 +154,7 @@ files:
154
154
  - lib/active_decorator/rspec/version.rb
155
155
  - spec/decorators/author_decorator_spec.rb
156
156
  - spec/dummy_app.rb
157
+ - spec/dummy_app/app/controllers/application_controller.rb
157
158
  - spec/spec_helper.rb
158
159
  homepage: https://github.com/mizoR/active_decorator-rspec
159
160
  licenses:
@@ -175,11 +176,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  version: '0'
176
177
  requirements: []
177
178
  rubyforge_project:
178
- rubygems_version: 2.4.5
179
+ rubygems_version: 2.4.5.1
179
180
  signing_key:
180
181
  specification_version: 4
181
182
  summary: ActiveDecorator::RSpec
182
183
  test_files:
183
184
  - spec/decorators/author_decorator_spec.rb
184
185
  - spec/dummy_app.rb
186
+ - spec/dummy_app/app/controllers/application_controller.rb
185
187
  - spec/spec_helper.rb