clearance 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/NEWS.md +3 -0
- data/lib/clearance/testing/deny_access_matcher.rb +16 -5
- data/lib/clearance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b36c10484673f64ecf6621a00b290bb481731ca1
|
|
4
|
+
data.tar.gz: fd2a23e512ad678d7841128f9e7911cca174f0eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31afa57919c1be57c63f8cbfea0b28bb035cd9e2f5df11ccfd0ae730c379d6360fd5638535ce7f047f57aa95f2c35be5ebdb44d6fb4b952f02324222d2203c43
|
|
7
|
+
data.tar.gz: ea9b82a67c87ffeecae9163a3ed1a3868230d74301678e03dd5d92e09b67a668dc0eb50cfe5d64c146a251435d64f83f74ff4cd5ae2b9c28f637a5d8f0ddc0e4
|
data/Gemfile.lock
CHANGED
data/NEWS.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
Thank you to all the [contributors](https://github.com/thoughtbot/clearance/graphs/contributors)!
|
|
2
2
|
|
|
3
|
+
New for 1.4.2 (September 13, 2014)
|
|
4
|
+
* Eliminate deprecation message when using DenyAccess matcher with RSpec 3.
|
|
5
|
+
|
|
3
6
|
New for 1.4.1 (September 5, 2014)
|
|
4
7
|
* Prevent BCrypt strategy from raising an exception when `encypted_password`
|
|
5
8
|
is nil.
|
|
@@ -8,7 +8,7 @@ module Clearance
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
class DenyAccessMatcher
|
|
11
|
-
attr_reader :failure_message, :
|
|
11
|
+
attr_reader :failure_message, :failure_message_when_negated
|
|
12
12
|
|
|
13
13
|
def initialize(context, opts)
|
|
14
14
|
@context = context
|
|
@@ -16,7 +16,7 @@ module Clearance
|
|
|
16
16
|
@url = opts[:redirect]
|
|
17
17
|
|
|
18
18
|
@failure_message = ''
|
|
19
|
-
@
|
|
19
|
+
@failure_message_when_negated = ''
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def description
|
|
@@ -28,6 +28,14 @@ module Clearance
|
|
|
28
28
|
sets_the_flash? && redirects_to_url?
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def failure_message_for_should
|
|
32
|
+
failure_message
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def failure_message_for_should_not
|
|
36
|
+
failure_message_when_negated
|
|
37
|
+
end
|
|
38
|
+
|
|
31
39
|
private
|
|
32
40
|
|
|
33
41
|
def denied_access_url
|
|
@@ -55,7 +63,8 @@ module Clearance
|
|
|
55
63
|
|
|
56
64
|
begin
|
|
57
65
|
@context.send(:assert_redirected_to, @url)
|
|
58
|
-
@
|
|
66
|
+
@failure_message_when_negated <<
|
|
67
|
+
"Didn't expect to redirect to #{@url}."
|
|
59
68
|
true
|
|
60
69
|
rescue Clearance::Testing::AssertionError
|
|
61
70
|
@failure_message << "Expected to redirect to #{@url} but did not."
|
|
@@ -68,10 +77,12 @@ module Clearance
|
|
|
68
77
|
true
|
|
69
78
|
else
|
|
70
79
|
if flash_notice_value == @flash
|
|
71
|
-
@
|
|
80
|
+
@failure_message_when_negated <<
|
|
81
|
+
"Didn't expect to set the flash to #{@flash}"
|
|
72
82
|
true
|
|
73
83
|
else
|
|
74
|
-
@failure_message << "Expected the flash to be set to #{@flash}
|
|
84
|
+
@failure_message << "Expected the flash to be set to #{@flash} "\
|
|
85
|
+
"but was #{flash_notice_value}"
|
|
75
86
|
false
|
|
76
87
|
end
|
|
77
88
|
end
|
data/lib/clearance/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: clearance
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dan Croak
|
|
@@ -25,7 +25,7 @@ authors:
|
|
|
25
25
|
autorequire:
|
|
26
26
|
bindir: bin
|
|
27
27
|
cert_chain: []
|
|
28
|
-
date: 2014-09-
|
|
28
|
+
date: 2014-09-13 00:00:00.000000000 Z
|
|
29
29
|
dependencies:
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: bcrypt
|