cells-rails 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: 1d254ad5793b6bb528c1caf55fea32164aa7b017
4
- data.tar.gz: e343d9fdc2ee243d5565d3e3465866413cc73b02
3
+ metadata.gz: 40821ac015d8c060bd0a7256a50df3e1cd2bfbc4
4
+ data.tar.gz: c1b0af24dfd1e96b8ce41a4edfe5ed1706745628
5
5
  SHA512:
6
- metadata.gz: 821f0e27dc5262fea87356c131ee237ac8b1cf3edb1aa3d26b542c8aa44ef292255d40061721409c06d787c7153db9d541a659e2b3192f87735205bc90278e3e
7
- data.tar.gz: fa7bff904466cba75b6557a076a7edae1eff36823373e0ae317ae36c61a97decb9616700d0a1c6b45a4e3272f7f48bcc3eafb36d72b83091bf96b9d67313d8d9
6
+ metadata.gz: f0f8edd58721c1bfa8c151dc410d20d6a4ad6841e0484f75bffddb49eaa85bde373d75de2fd735b6134b530ea0f38fbe24535f25c49dc7a37886204c6378f4a8
7
+ data.tar.gz: 928d93f1c90cc4676b701b6070569a6535390509f1e8595b2f4454d8b81040ca70362253009bba7608c41364b6626700edaecdb16a3e3d2192a62b3498c0cf81
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.6
2
+
3
+ * `Testing` fixed with Rails 5.
4
+
1
5
  ## 0.0.5
2
6
 
3
7
  * Fix an annoying bundler loading bug. Thanks to @RKushnir.
@@ -0,0 +1,25 @@
1
+ module Cell
2
+ module RailsExtensions
3
+ # This modules overrides Cell::Testing#controller_for and provides Rails-specific logic.
4
+ module Testing
5
+ def controller_for(controller_class)
6
+ return unless controller_class
7
+
8
+ controller_class.new.tap do |ctl|
9
+ ctl.request = action_controller_test_request
10
+ ctl.instance_variable_set :@routes, ::Rails.application.routes.url_helpers
11
+ end
12
+ end
13
+
14
+ def action_controller_test_request
15
+ if ::Rails.version.start_with?('5')
16
+ ::ActionController::TestRequest.create
17
+ else
18
+ ::ActionController::TestRequest.new
19
+ end
20
+ end
21
+ end # Testing
22
+ end
23
+ end
24
+
25
+ Cell::Testing.send(:include, Cell::RailsExtensions::Testing)
@@ -9,4 +9,4 @@ module Cell
9
9
  end
10
10
  end
11
11
 
12
- Cell::Testing.capybara = true if Object.const_defined?(:"Capybara")
12
+ Cell::Testing.capybara = true if Object.const_defined?(:"Capybara")
@@ -4,6 +4,7 @@ require "cells"
4
4
  require "cell/caching/notification"
5
5
  require "cell/rails"
6
6
  require "cell/railtie"
7
+ require "cell/rails/testing"
7
8
 
8
9
  module Cell
9
10
  autoload :Translation, "cell/translation"
@@ -1,5 +1,5 @@
1
1
  module Cells
2
2
  module Rails
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cells-rails
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
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-24 00:00:00.000000000 Z
11
+ date: 2016-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cells
@@ -127,6 +127,7 @@ files:
127
127
  - lib/cell/rails.rb
128
128
  - lib/cell/rails/collection.rb
129
129
  - lib/cell/rails/constant_for.rb
130
+ - lib/cell/rails/testing.rb
130
131
  - lib/cell/railtie.rb
131
132
  - lib/cell/test_case.rb
132
133
  - lib/cell/translation.rb
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  requirements: []
168
169
  rubyforge_project:
169
- rubygems_version: 2.4.8
170
+ rubygems_version: 2.5.1
170
171
  signing_key:
171
172
  specification_version: 4
172
173
  summary: Convenient Rails support for Cells.