cells 4.0.0.beta1 → 4.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cell.rb +1 -1
- data/lib/cell/testing.rb +23 -0
- data/lib/cell/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/url_helper_test.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d87f07c5656008a50a7a2386344a1517f311bfa
|
4
|
+
data.tar.gz: af694d3c7ce83a603481c49ccb7bf13d1f101347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a3d21440e92afd599d99e5c551be02c3684b970be815ad9a36f6570bd367c864286196a9756402bc3e0b134e4dbdec234cc7151f6f48dfdb86366e8309c7ee
|
7
|
+
data.tar.gz: 291658a9ee8cacc3c50656f68c46028fb6bd0c38e4914664ae8ce20ce7d281ea1d4e423e97597ad86ddda4c145c920cfa7ae5eacd12ad8cee040a44301fe527f
|
data/lib/cell.rb
CHANGED
data/lib/cell/testing.rb
CHANGED
@@ -9,7 +9,30 @@ module Cell
|
|
9
9
|
Concept.cell_for(name, controller, *args)
|
10
10
|
end
|
11
11
|
|
12
|
+
|
13
|
+
|
14
|
+
# Rails specific.
|
12
15
|
def controller
|
16
|
+
# TODO: test without controller.
|
17
|
+
return unless self.class.controller_class
|
18
|
+
|
19
|
+
# TODO: test with controller.
|
20
|
+
self.class.controller_class.new.tap do |ctl|
|
21
|
+
ctl.request = ActionController::TestRequest.new
|
22
|
+
ctl.instance_variable_set :@routes, Rails.application.routes.url_helpers
|
23
|
+
end
|
13
24
|
end
|
25
|
+
|
26
|
+
def self.included(base)
|
27
|
+
base.class_eval do
|
28
|
+
extend Uber::InheritableAttr
|
29
|
+
inheritable_attr :controller_class
|
30
|
+
|
31
|
+
def self.controller(name)
|
32
|
+
self.controller_class = name
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
14
37
|
end
|
15
38
|
end
|
data/lib/cell/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/url_helper_test.rb
CHANGED
@@ -4,7 +4,8 @@ class MusiciansController < ApplicationController
|
|
4
4
|
end
|
5
5
|
|
6
6
|
class UrlHelperTest < MiniTest::Spec
|
7
|
-
|
7
|
+
controller MusiciansController
|
8
|
+
|
8
9
|
let (:cellule) { SongCell.new(controller) }
|
9
10
|
|
10
11
|
class SongCell < Cell::ViewModel
|