jsend-rails 1.2.1 → 1.2.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/lib/jsend-rails/test/matchers.rb +15 -11
- data/lib/jsend-rails/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: a3f3c4c95b7204dc1733fc3fa6ba21f0bd022346
|
4
|
+
data.tar.gz: 5e2590483389c6a2b4ed057c270eafadf8a99c11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a725e414b24eb2bd34c6484976307e642e5fe5169dade029fee007ede7f0da200807c80385379d379ac9d5df0b86d183c748cde4fd3016788de81b855d0bb6
|
7
|
+
data.tar.gz: c1c92dd23a7fe5628db70254af843b6045a4aefb4189dc3bfa4e812e98d0331348ab050d6b957a3e2ba548febc80bf517806a01d97339547f1aac846b31dfd4d
|
@@ -9,48 +9,52 @@ module JSend
|
|
9
9
|
match do |response|
|
10
10
|
response.content_type =~ /^application\/json/
|
11
11
|
end
|
12
|
-
|
12
|
+
failure_message do |response|
|
13
13
|
"Response should have application/json content type"
|
14
14
|
end
|
15
|
-
|
15
|
+
failure_message_when_negated do |response|
|
16
16
|
"Response should not have application/json content type"
|
17
17
|
end
|
18
|
+
alias negative_failure_message failure_message_when_negated
|
18
19
|
end
|
19
20
|
|
20
21
|
RSpec::Matchers.define :be_jsend_success do
|
21
22
|
match do |response|
|
22
|
-
response.json['status']
|
23
|
+
response.json['status'] == 'success'
|
23
24
|
end
|
24
|
-
|
25
|
+
failure_message do |response|
|
25
26
|
"Response should be JSend success"
|
26
27
|
end
|
27
|
-
|
28
|
+
failure_message_when_negated do |response|
|
28
29
|
"Response should not be JSend success"
|
29
30
|
end
|
31
|
+
alias negative_failure_message failure_message_when_negated
|
30
32
|
end
|
31
33
|
|
32
34
|
RSpec::Matchers.define :be_jsend_failure do
|
33
35
|
match do |response|
|
34
|
-
response.json['status']
|
36
|
+
response.json['status'] == 'fail'
|
35
37
|
end
|
36
|
-
|
38
|
+
failure_message do |response|
|
37
39
|
"Response should be JSend failure"
|
38
40
|
end
|
39
|
-
|
41
|
+
failure_message_when_negated do |response|
|
40
42
|
"Response should not be JSend failure"
|
41
43
|
end
|
44
|
+
alias negative_failure_message failure_message_when_negated
|
42
45
|
end
|
43
46
|
|
44
47
|
RSpec::Matchers.define :be_jsend_error do
|
45
48
|
match do |response|
|
46
|
-
response.json['status']
|
49
|
+
response.json['status'] == 'error'
|
47
50
|
end
|
48
|
-
|
51
|
+
failure_message do |response|
|
49
52
|
"Response should be JSend error"
|
50
53
|
end
|
51
|
-
|
54
|
+
failure_message_when_negated do |response|
|
52
55
|
"Response should not be JSend error"
|
53
56
|
end
|
57
|
+
alias negative_failure_message failure_message_when_negated
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
data/lib/jsend-rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsend-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Moseley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|