restfulness 0.3.2 → 0.3.3

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.
@@ -5,25 +5,25 @@ describe Restfulness::Sanitizer do
5
5
  it 'does nothing when not given any sensitive params' do
6
6
  subject = described_class::Hash.new()
7
7
  input = {:password => 'ok', :nested => {:password => 'okay'}}
8
- subject.sanitize(input).should eq input
8
+ expect(subject.sanitize(input)).to eq input
9
9
  end
10
10
 
11
11
  it 'filters sensitive param and not others' do
12
12
  subject = described_class::Hash.new(:password)
13
13
  input = {:PASSword => 'supersecret', :user => 'billy'}
14
- subject.sanitize(input).should eq({:PASSword => described_class::SANITIZED, :user => 'billy'})
14
+ expect(subject.sanitize(input)).to eq({:PASSword => described_class::SANITIZED, :user => 'billy'})
15
15
  end
16
16
 
17
17
  it 'filters nested sensitive params and not others' do
18
18
  subject = described_class::Hash.new(:password)
19
19
  input = {:user => {:passWORD => 'supersecret', :user => 'billy'}}
20
- subject.sanitize(input).should eq({:user => {:passWORD => described_class::SANITIZED, :user => 'billy'}})
20
+ expect(subject.sanitize(input)).to eq({:user => {:passWORD => described_class::SANITIZED, :user => 'billy'}})
21
21
  end
22
22
 
23
23
  it 'filters any parameter beginning with sensitive params (prefix)' do
24
24
  subject = described_class::Hash.new(:password)
25
25
  input = {:user => {:passWORD_confirmation => 'supersecret', :user => 'billy'}}
26
- subject.sanitize(input).should eq({:user => {:passWORD_confirmation => described_class::SANITIZED, :user => 'billy'}})
26
+ expect(subject.sanitize(input)).to eq({:user => {:passWORD_confirmation => described_class::SANITIZED, :user => 'billy'}})
27
27
  end
28
28
  end
29
29
 
@@ -31,31 +31,31 @@ describe Restfulness::Sanitizer do
31
31
  it 'does nothing when not given any sensitive params' do
32
32
  subject = described_class::QueryString.new()
33
33
  input = 'password=ok&other=false'
34
- subject.sanitize(input).should eq input
34
+ expect(subject.sanitize(input)).to eq input
35
35
  end
36
36
 
37
37
  it 'filters sensitive param and not others' do
38
38
  subject = described_class::QueryString.new(:password)
39
39
  input = 'PASSword=ok&other=false'
40
- subject.sanitize(input).should eq "PASSword=#{described_class::SANITIZED}&other=false"
40
+ expect(subject.sanitize(input)).to eq "PASSword=#{described_class::SANITIZED}&other=false"
41
41
  end
42
42
 
43
43
  it 'filters nested (with index) sensitive params and not others' do
44
44
  subject = described_class::QueryString.new(:password)
45
45
  input = 'password[0]=what&PASSword[1]=secret&other=false'
46
- subject.sanitize(input).should eq "password[0]=#{described_class::SANITIZED}&PASSword[1]=#{described_class::SANITIZED}&other=false"
46
+ expect(subject.sanitize(input)).to eq "password[0]=#{described_class::SANITIZED}&PASSword[1]=#{described_class::SANITIZED}&other=false"
47
47
  end
48
48
 
49
49
  it 'filters nested (no index) sensitive params and not others' do
50
50
  subject = described_class::QueryString.new(:password)
51
51
  input = 'password[]=what&password[]=secret&other=false'
52
- subject.sanitize(input).should eq "password[]=#{described_class::SANITIZED}&password[]=#{described_class::SANITIZED}&other=false"
52
+ expect(subject.sanitize(input)).to eq "password[]=#{described_class::SANITIZED}&password[]=#{described_class::SANITIZED}&other=false"
53
53
  end
54
54
 
55
55
  it 'filters any parameter beginning with sensitive params (prefix)' do
56
56
  subject = described_class::QueryString.new(:password)
57
57
  input = 'password_confirmation[]=what&password[]=secret&password=false'
58
- subject.sanitize(input).should eq "password_confirmation[]=#{described_class::SANITIZED}&password[]=#{described_class::SANITIZED}&password=#{described_class::SANITIZED}"
58
+ expect(subject.sanitize(input)).to eq "password_confirmation[]=#{described_class::SANITIZED}&password[]=#{described_class::SANITIZED}&password=#{described_class::SANITIZED}"
59
59
  end
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restfulness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Lown
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 2.14.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 2.14.1
110
+ version: '0'
111
111
  description: Simple REST server that focuses on resources instead of routes.
112
112
  email:
113
113
  - me@samlown.com
@@ -130,6 +130,8 @@ files:
130
130
  - lib/restfulness/dispatcher.rb
131
131
  - lib/restfulness/dispatchers/rack.rb
132
132
  - lib/restfulness/exceptions.rb
133
+ - lib/restfulness/headers/accept.rb
134
+ - lib/restfulness/headers/media_type.rb
133
135
  - lib/restfulness/http_authentication/basic.rb
134
136
  - lib/restfulness/path.rb
135
137
  - lib/restfulness/request.rb
@@ -150,6 +152,8 @@ files:
150
152
  - spec/unit/dispatcher_spec.rb
151
153
  - spec/unit/dispatchers/rack_spec.rb
152
154
  - spec/unit/exceptions_spec.rb
155
+ - spec/unit/headers/accept_spec.rb
156
+ - spec/unit/headers/media_type_spec.rb
153
157
  - spec/unit/http_authentication/basic_spec.rb
154
158
  - spec/unit/path_spec.rb
155
159
  - spec/unit/request_spec.rb
@@ -182,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
186
  version: '0'
183
187
  requirements: []
184
188
  rubyforge_project:
185
- rubygems_version: 2.2.2
189
+ rubygems_version: 2.4.6
186
190
  signing_key:
187
191
  specification_version: 4
188
192
  summary: Use to create a powerful, yet simple REST API in your application.
@@ -192,6 +196,8 @@ test_files:
192
196
  - spec/unit/dispatcher_spec.rb
193
197
  - spec/unit/dispatchers/rack_spec.rb
194
198
  - spec/unit/exceptions_spec.rb
199
+ - spec/unit/headers/accept_spec.rb
200
+ - spec/unit/headers/media_type_spec.rb
195
201
  - spec/unit/http_authentication/basic_spec.rb
196
202
  - spec/unit/path_spec.rb
197
203
  - spec/unit/request_spec.rb