subroutine 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/subroutine/association.rb +1 -1
- data/lib/subroutine/version.rb +1 -1
- data/test/subroutine/association_test.rb +10 -0
- 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: aa94532ef601e196c3dd4f4592a1bdcc18a4fd90
|
4
|
+
data.tar.gz: b8da58c3642568051893934fd92e227508907eaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce7d236825bd9b5e861913b717cbfbe9d4cdb5da7964cc3fc9ed6691645548dde4a7a2d0f5727839e2f30b0d03ba5bbd3fc05500455c6e9025df2a4077adc93
|
7
|
+
data.tar.gz: d31335231526c84b9e2bd118a21b88f51c005c1dab7d7a2afc586fb5211d8e8f0089aa2d733e2d55cda995a1ec0d404b43194549ce2597b22f4ed2f37d056a17
|
data/lib/subroutine/version.rb
CHANGED
@@ -27,6 +27,16 @@ module Subroutine
|
|
27
27
|
assert_equal doug, op.user
|
28
28
|
end
|
29
29
|
|
30
|
+
def test_it_sanitizes_types
|
31
|
+
all_mock = mock
|
32
|
+
|
33
|
+
::User.expects(:all).returns(all_mock)
|
34
|
+
all_mock.expects(:find).with(1).returns(doug)
|
35
|
+
|
36
|
+
op = SimpleAssociationOp.new user_type: "users", user_id: doug.id
|
37
|
+
assert_equal doug, op.user
|
38
|
+
end
|
39
|
+
|
30
40
|
def test_it_allows_an_association_to_be_looked_up_without_default_scoping
|
31
41
|
all_mock = mock
|
32
42
|
unscoped_mock = mock
|