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 +4 -4
- data/CHANGES.md +4 -0
- data/lib/cell/rails/testing.rb +25 -0
- data/lib/cell/test_case.rb +1 -1
- data/lib/cells/rails.rb +1 -0
- data/lib/cells/rails/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40821ac015d8c060bd0a7256a50df3e1cd2bfbc4
|
4
|
+
data.tar.gz: c1b0af24dfd1e96b8ce41a4edfe5ed1706745628
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0f8edd58721c1bfa8c151dc410d20d6a4ad6841e0484f75bffddb49eaa85bde373d75de2fd735b6134b530ea0f38fbe24535f25c49dc7a37886204c6378f4a8
|
7
|
+
data.tar.gz: 928d93f1c90cc4676b701b6070569a6535390509f1e8595b2f4454d8b81040ca70362253009bba7608c41364b6626700edaecdb16a3e3d2192a62b3498c0cf81
|
data/CHANGES.md
CHANGED
@@ -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)
|
data/lib/cell/test_case.rb
CHANGED
data/lib/cells/rails.rb
CHANGED
data/lib/cells/rails/version.rb
CHANGED
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.
|
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-
|
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.
|
170
|
+
rubygems_version: 2.5.1
|
170
171
|
signing_key:
|
171
172
|
specification_version: 4
|
172
173
|
summary: Convenient Rails support for Cells.
|