pundit_helpers 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/pundit_helpers.rb +1 -1
- data/lib/pundit_helpers/version.rb +1 -1
- data/pundit_helpers.gemspec +1 -1
- data/spec/pundit_helpers_spec.rb +4 -4
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2c918a4ce721d081f323108d9f9830044fd87a
|
4
|
+
data.tar.gz: 9fface794f302352233d3d5619be061aa3021f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d50d8f6b6799208d26696852a5752e4f341ec6a1b50c425be39d25cc806ff049e49bc963d6da1f80a6f70ea829817ab2da9dffecb36385d307c9224e7c28c6a9
|
7
|
+
data.tar.gz: 6207bc04306bb95083495a2fa3c2530505586e292a01a6a47f109413f28cd92606458d43611ebe109226db61559b53dbb2aef9fe631d7f448fc3c505ec0807e5
|
data/CHANGELOG.md
ADDED
data/lib/pundit_helpers.rb
CHANGED
data/pundit_helpers.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "pundit", "~> 0.2"
|
21
|
+
spec.add_dependency "pundit", ">= 0.2.2", "~> 0.2"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
24
24
|
spec.add_development_dependency "rake"
|
data/spec/pundit_helpers_spec.rb
CHANGED
@@ -6,8 +6,8 @@ class Harness
|
|
6
6
|
@helper_methods = []
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
10
|
-
:
|
9
|
+
def pundit_user
|
10
|
+
:spec_pundit_user
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.helper_methods
|
@@ -47,7 +47,7 @@ describe PunditHelpers, "#can?" do
|
|
47
47
|
policy = double(:edit? => true)
|
48
48
|
harness = Harness.new
|
49
49
|
|
50
|
-
expect(Pundit).to receive(:policy!).with(:
|
50
|
+
expect(Pundit).to receive(:policy!).with(:spec_pundit_user, record).and_return(policy)
|
51
51
|
expect(harness.can?(:edit, record)).to be_true
|
52
52
|
end
|
53
53
|
|
@@ -56,7 +56,7 @@ describe PunditHelpers, "#can?" do
|
|
56
56
|
policy = double(:edit? => false)
|
57
57
|
harness = Harness.new
|
58
58
|
|
59
|
-
expect(Pundit).to receive(:policy!).with(:
|
59
|
+
expect(Pundit).to receive(:policy!).with(:spec_pundit_user, record).and_return(policy)
|
60
60
|
expect(harness.can?(:edit, record)).to be_false
|
61
61
|
end
|
62
62
|
|
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pundit_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendon Murphy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pundit
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.2
|
17
20
|
- - "~>"
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: '0.2'
|
@@ -21,6 +24,9 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.2.2
|
24
30
|
- - "~>"
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: '0.2'
|
@@ -74,6 +80,7 @@ extensions: []
|
|
74
80
|
extra_rdoc_files: []
|
75
81
|
files:
|
76
82
|
- ".gitignore"
|
83
|
+
- CHANGELOG.md
|
77
84
|
- Gemfile
|
78
85
|
- LICENSE.txt
|
79
86
|
- README.md
|