atdis 0.3.11 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +46 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +0 -4
  5. data/Gemfile +9 -7
  6. data/Guardfile +4 -3
  7. data/Rakefile +4 -2
  8. data/atdis.gemspec +10 -5
  9. data/lib/atdis.rb +2 -0
  10. data/lib/atdis/feed.rb +32 -24
  11. data/lib/atdis/model.rb +108 -95
  12. data/lib/atdis/models/address.rb +10 -4
  13. data/lib/atdis/models/application.rb +12 -9
  14. data/lib/atdis/models/authority.rb +11 -6
  15. data/lib/atdis/models/document.rb +8 -6
  16. data/lib/atdis/models/event.rb +10 -8
  17. data/lib/atdis/models/info.rb +73 -49
  18. data/lib/atdis/models/land_title_ref.rb +15 -7
  19. data/lib/atdis/models/location.rb +9 -7
  20. data/lib/atdis/models/page.rb +36 -21
  21. data/lib/atdis/models/pagination.rb +91 -32
  22. data/lib/atdis/models/person.rb +7 -5
  23. data/lib/atdis/models/reference.rb +7 -5
  24. data/lib/atdis/models/response.rb +5 -3
  25. data/lib/atdis/models/torrens_title.rb +9 -7
  26. data/lib/atdis/separated_url.rb +17 -15
  27. data/lib/atdis/validators.rb +46 -39
  28. data/lib/atdis/version.rb +3 -1
  29. data/spec/atdis/feed_spec.rb +128 -34
  30. data/spec/atdis/model_spec.rb +124 -51
  31. data/spec/atdis/models/address_spec.rb +18 -9
  32. data/spec/atdis/models/application_spec.rb +222 -155
  33. data/spec/atdis/models/authority_spec.rb +45 -15
  34. data/spec/atdis/models/document_spec.rb +10 -4
  35. data/spec/atdis/models/event_spec.rb +23 -11
  36. data/spec/atdis/models/info_spec.rb +197 -113
  37. data/spec/atdis/models/land_title_ref_spec.rb +32 -16
  38. data/spec/atdis/models/location_spec.rb +75 -60
  39. data/spec/atdis/models/page_spec.rb +244 -135
  40. data/spec/atdis/models/pagination_spec.rb +177 -77
  41. data/spec/atdis/models/person_spec.rb +8 -4
  42. data/spec/atdis/models/reference_spec.rb +29 -16
  43. data/spec/atdis/models/response_spec.rb +2 -1
  44. data/spec/atdis/models/torrens_title_spec.rb +24 -18
  45. data/spec/atdis/separated_url_spec.rb +14 -15
  46. data/spec/spec_helper.rb +14 -10
  47. metadata +62 -33
@@ -1,21 +1,30 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe ATDIS::Models::Address do
4
6
  context "valid address" do
5
- let(:a) { ATDIS::Models::Address.new(
6
- street: "123 Fourfivesix Street",
7
- suburb: "Neutral Bay",
8
- postcode: "2780",
9
- state: "NSW"
10
- )}
7
+ let(:a) do
8
+ ATDIS::Models::Address.new(
9
+ {
10
+ street: "123 Fourfivesix Street",
11
+ suburb: "Neutral Bay",
12
+ postcode: "2780",
13
+ state: "NSW"
14
+ },
15
+ "UTC"
16
+ )
17
+ end
11
18
 
12
- it { a.should be_valid }
19
+ it { expect(a).to be_valid }
13
20
 
14
21
  context "postcode that is too short" do
15
22
  before(:each) { a.postcode = "278" }
16
23
  it {
17
- a.should_not be_valid
18
- a.errors.messages.should == {postcode: [ATDIS::ErrorMessage.new("is not a valid postcode", "4.3.3")]}
24
+ expect(a).to_not be_valid
25
+ expect(a.errors.messages).to eq(
26
+ postcode: [ATDIS::ErrorMessage.new("is not a valid postcode", "4.3.3")]
27
+ )
19
28
  }
20
29
  end
21
30
  end
@@ -1,39 +1,51 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe ATDIS::Models::Application do
4
6
  context "extra parameter in json" do
5
7
  it "should not be valid" do
6
- expect(ATDIS::Models::Location).to receive(:interpret).with("location").and_return(double(valid?: true))
7
- expect(ATDIS::Models::Document).to receive(:interpret).with("document").and_return(double(valid?: true))
8
- expect(ATDIS::Models::Event).to receive(:interpret).with("event").and_return(double(valid?: true))
8
+ expect(ATDIS::Models::Location).to receive(:interpret).with("location", "UTC")
9
+ .and_return(double(valid?: true))
10
+ expect(ATDIS::Models::Document).to receive(:interpret).with("document", "UTC")
11
+ .and_return(double(valid?: true))
12
+ expect(ATDIS::Models::Event).to receive(:interpret).with("event", "UTC")
13
+ .and_return(double(valid?: true))
9
14
 
10
15
  a = ATDIS::Models::Application.interpret(
11
- info: {
12
- dat_id: "DA2013-0381",
13
- development_type: "residential",
14
- application_type: "DA",
15
- last_modified_date: "2013-04-20T02:01:07Z",
16
- description: "New pool plus deck",
17
- authority: {
18
- ref: "http://www.council.nsw.gov.au/atdis/1.0",
19
- name: "Example Council Shire Council"
16
+ {
17
+ info: {
18
+ dat_id: "DA2013-0381",
19
+ development_type: "residential",
20
+ application_type: "DA",
21
+ last_modified_date: "2013-04-20T02:01:07Z",
22
+ description: "New pool plus deck",
23
+ authority: {
24
+ ref: "http://www.council.nsw.gov.au/atdis/1.0",
25
+ name: "Example Council Shire Council"
26
+ },
27
+ lodgement_date: "2013-04-20T02:01:07Z",
28
+ determination_date: "2013-06-20",
29
+ determination_type: "Pending",
30
+ status: "OPEN"
20
31
  },
21
- lodgement_date: "2013-04-20T02:01:07Z",
22
- determination_date: "2013-06-20",
23
- determination_type: "Pending",
24
- status: "OPEN"
25
- },
26
- reference: {
27
- more_info_url: "http://foo.com/bar"
32
+ reference: {
33
+ more_info_url: "http://foo.com/bar"
34
+ },
35
+ # This is the extra parameter that shouldn't be here
36
+ foo: "bar",
37
+ locations: ["location"],
38
+ events: ["event"],
39
+ documents: ["document"]
28
40
  },
29
- # This is the extra parameter that shouldn't be here
30
- foo: "bar",
31
- locations: ["location"],
32
- events: ["event"],
33
- documents: ["document"]
41
+ "UTC"
42
+ )
43
+ expect(a).to_not be_valid
44
+ expect(a.errors.messages).to eq(
45
+ json: [
46
+ ATDIS::ErrorMessage['Unexpected parameters in json data: {"foo":"bar"}', "4"]
47
+ ]
34
48
  )
35
- a.should_not be_valid
36
- a.errors.messages.should == {json: [ATDIS::ErrorMessage['Unexpected parameters in json data: {"foo":"bar"}', "4"]]}
37
49
  end
38
50
  end
39
51
 
@@ -42,211 +54,266 @@ describe ATDIS::Models::Application do
42
54
  application = double
43
55
 
44
56
  expect(ATDIS::Models::Application).to receive(:new).with(
45
- info: {
46
- dat_id: "DA2013-0381",
47
- development_type: "residential",
48
- last_modified_date: "2013-04-20T02:01:07Z",
49
- description: "New pool plus deck",
50
- authority: "Example Council Shire Council",
51
- lodgement_date: "2013-04-20T02:01:07Z",
52
- determination_date: "2013-06-20",
53
- notification_start_date: "2013-04-20T02:01:07Z",
54
- notification_end_date: "2013-05-20T02:01:07Z",
55
- officer: "Ms Smith",
56
- estimated_cost: "50,000",
57
- status: "OPEN",
58
- },
59
- reference: {
60
- more_info_url: "http://foo.com/bar",
61
- comments_url: "http://foo.com/comment",
57
+ {
58
+ info: {
59
+ dat_id: "DA2013-0381",
60
+ development_type: "residential",
61
+ last_modified_date: "2013-04-20T02:01:07Z",
62
+ description: "New pool plus deck",
63
+ authority: "Example Council Shire Council",
64
+ lodgement_date: "2013-04-20T02:01:07Z",
65
+ determination_date: "2013-06-20",
66
+ notification_start_date: "2013-04-20T02:01:07Z",
67
+ notification_end_date: "2013-05-20T02:01:07Z",
68
+ officer: "Ms Smith",
69
+ estimated_cost: "50,000",
70
+ status: "OPEN"
71
+ },
72
+ reference: {
73
+ more_info_url: "http://foo.com/bar",
74
+ comments_url: "http://foo.com/comment"
75
+ },
76
+ locations: [{ address: "123 Fourfivesix Street" }],
77
+ events: [{ id: "event1" }, { id: "event2" }],
78
+ documents: [{ ref: "27B/6/a" }, { ref: "27B/6/b" }],
79
+ people: [{ name: "Tuttle" }, { name: "Buttle" }],
80
+ extended: { another_parameter: "with some value", anything: "can go here" },
81
+ json_left_overs: {}
62
82
  },
63
- locations: [{ address: "123 Fourfivesix Street" }],
64
- events: [ { id: "event1" }, { id: "event2" } ],
65
- documents: [ { ref: "27B/6/a" }, { ref: "27B/6/b" } ],
66
- people: [ { name: "Tuttle" }, { name: "Buttle" } ],
67
- extended: {another_parameter: "with some value", anything: "can go here"},
68
- json_left_overs: {}
83
+ "UTC"
69
84
  ).and_return(application)
70
85
 
71
- ATDIS::Models::Application.interpret(
72
- info: {
73
- dat_id: "DA2013-0381",
74
- development_type: "residential",
75
- last_modified_date: "2013-04-20T02:01:07Z",
76
- description: "New pool plus deck",
77
- authority: "Example Council Shire Council",
78
- lodgement_date: "2013-04-20T02:01:07Z",
79
- determination_date: "2013-06-20",
80
- notification_start_date: "2013-04-20T02:01:07Z",
81
- notification_end_date: "2013-05-20T02:01:07Z",
82
- officer: "Ms Smith",
83
- # TODO: In ATDIS-1.0.3 it does not specify whether this is a float or a string
84
- # and whether to include (or not) AUD or dollar sign. For the time being we'll
85
- # just assume it's a free-form string
86
- estimated_cost: "50,000",
87
- status: "OPEN"
88
- },
89
- reference: {
90
- more_info_url: "http://foo.com/bar",
91
- comments_url: "http://foo.com/comment"
92
- },
93
- locations: [{ address: "123 Fourfivesix Street" }],
94
- events: [ { id: "event1" }, { id: "event2" } ],
95
- documents: [ { ref: "27B/6/a" }, { ref: "27B/6/b" } ],
96
- people: [ { name: "Tuttle" }, { name: "Buttle" } ],
97
- extended: {another_parameter: "with some value", anything: "can go here"}
98
- ).should == application
86
+ expect(
87
+ ATDIS::Models::Application.interpret(
88
+ {
89
+ info: {
90
+ dat_id: "DA2013-0381",
91
+ development_type: "residential",
92
+ last_modified_date: "2013-04-20T02:01:07Z",
93
+ description: "New pool plus deck",
94
+ authority: "Example Council Shire Council",
95
+ lodgement_date: "2013-04-20T02:01:07Z",
96
+ determination_date: "2013-06-20",
97
+ notification_start_date: "2013-04-20T02:01:07Z",
98
+ notification_end_date: "2013-05-20T02:01:07Z",
99
+ officer: "Ms Smith",
100
+ # TODO: In ATDIS-1.0.3 it does not specify whether this is a float or a string
101
+ # and whether to include (or not) AUD or dollar sign. For the time being we'll
102
+ # just assume it's a free-form string
103
+ estimated_cost: "50,000",
104
+ status: "OPEN"
105
+ },
106
+ reference: {
107
+ more_info_url: "http://foo.com/bar",
108
+ comments_url: "http://foo.com/comment"
109
+ },
110
+ locations: [{ address: "123 Fourfivesix Street" }],
111
+ events: [{ id: "event1" }, { id: "event2" }],
112
+ documents: [{ ref: "27B/6/a" }, { ref: "27B/6/b" }],
113
+ people: [{ name: "Tuttle" }, { name: "Buttle" }],
114
+ extended: { another_parameter: "with some value", anything: "can go here" }
115
+ },
116
+ "UTC"
117
+ )
118
+ ).to eq application
99
119
  end
100
120
 
101
121
  it "should create a nil valued application when there is no information in the json" do
102
122
  application = double
103
- expect(ATDIS::Models::Application).to receive(:new).with({json_left_overs:{}, info: {},
104
- reference: {}}).and_return(application)
123
+ expect(ATDIS::Models::Application).to receive(:new)
124
+ .with({ json_left_overs: {}, info: {}, reference: {} }, "UTC").and_return(application)
105
125
 
106
- ATDIS::Models::Application.interpret(info: {}, reference: {}).should == application
126
+ expect(
127
+ ATDIS::Models::Application.interpret({ info: {}, reference: {} }, "UTC")
128
+ ).to eq application
107
129
  end
108
130
  end
109
131
 
110
132
  describe "#extended" do
111
133
  it "should do no typecasting" do
112
- a = ATDIS::Models::Application.new(extended: {another_parameter: "with some value", anything: "can go here"})
113
- a.extended.should == {another_parameter: "with some value", anything: "can go here"}
134
+ a = ATDIS::Models::Application.new(
135
+ { extended: { another_parameter: "with some value", anything: "can go here" } },
136
+ "UTC"
137
+ )
138
+ expect(a.extended).to eq(another_parameter: "with some value", anything: "can go here")
114
139
  end
115
140
  end
116
141
 
117
142
  describe "#location=" do
118
- let(:a) { ATDIS::Models::Application.new }
143
+ let(:a) { ATDIS::Models::Application.new({}, "UTC") }
119
144
  it "should type cast to a location" do
120
145
  location = double
121
- expect(ATDIS::Models::Location).to receive(:interpret).with(address: "123 Fourfivesix Street").and_return(location)
146
+ expect(ATDIS::Models::Location).to receive(:interpret).with(
147
+ { address: "123 Fourfivesix Street" },
148
+ "UTC"
149
+ ).and_return(location)
122
150
  a.locations = [{ address: "123 Fourfivesix Street" }]
123
- a.locations.should == [location]
151
+ expect(a.locations).to eq [location]
124
152
  end
125
153
 
126
154
  it "should not cast when it's already a location" do
127
- l = ATDIS::Models::Location.new
155
+ l = ATDIS::Models::Location.new({}, "UTC")
128
156
  a.locations = [l]
129
- a.locations.should == [l]
157
+ expect(a.locations).to eq [l]
130
158
  end
131
159
  end
132
160
 
133
161
  describe "#events" do
134
- let(:a) { ATDIS::Models::Application.new }
162
+ let(:a) { ATDIS::Models::Application.new({}, "UTC") }
135
163
  it "should type cast to several events" do
136
- event1, event2 = double, double
137
- expect(ATDIS::Models::Event).to receive(:interpret).with(id: "event1").and_return(event1)
138
- expect(ATDIS::Models::Event).to receive(:interpret).with(id: "event2").and_return(event2)
139
- a.events = [ { id: "event1" }, { id: "event2" } ]
140
- a.events.should == [event1, event2]
164
+ event1 = double
165
+ event2 = double
166
+ expect(ATDIS::Models::Event).to receive(:interpret).with(
167
+ { id: "event1" },
168
+ "UTC"
169
+ ).and_return(event1)
170
+ expect(ATDIS::Models::Event).to receive(:interpret).with(
171
+ { id: "event2" },
172
+ "UTC"
173
+ ).and_return(event2)
174
+ a.events = [{ id: "event1" }, { id: "event2" }]
175
+ expect(a.events).to eq [event1, event2]
141
176
  end
142
177
  end
143
178
 
144
179
  describe "#documents" do
145
- let(:a) { ATDIS::Models::Application.new }
180
+ let(:a) { ATDIS::Models::Application.new({}, "UTC") }
146
181
  it "should type cast to several documents" do
147
- document1, document2 = double, double
148
- expect(ATDIS::Models::Document).to receive(:interpret).with(ref: "27B/6/a").and_return(document1)
149
- expect(ATDIS::Models::Document).to receive(:interpret).with(ref: "27B/6/b").and_return(document2)
150
- a.documents = [ { ref: "27B/6/a" }, { ref: "27B/6/b" } ]
151
- a.documents.should == [document1, document2]
182
+ document1 = double
183
+ document2 = double
184
+ expect(ATDIS::Models::Document).to receive(:interpret).with({ ref: "27B/6/a" }, "UTC")
185
+ .and_return(document1)
186
+ expect(ATDIS::Models::Document).to receive(:interpret).with({ ref: "27B/6/b" }, "UTC")
187
+ .and_return(document2)
188
+ a.documents = [{ ref: "27B/6/a" }, { ref: "27B/6/b" }]
189
+ expect(a.documents).to eq [document1, document2]
152
190
  end
153
191
  end
154
192
 
155
193
  describe "#people" do
156
- let(:a) { ATDIS::Models::Application.new }
194
+ let(:a) { ATDIS::Models::Application.new({}, "UTC") }
157
195
  it "should type cast to several people" do
158
- tuttle, buttle = double, double
159
- expect(ATDIS::Models::Person).to receive(:interpret).with(name: "Tuttle").and_return(tuttle)
160
- expect(ATDIS::Models::Person).to receive(:interpret).with(name: "Buttle").and_return(buttle)
161
- a.people = [ { name: "Tuttle" }, { name: "Buttle" } ]
162
- a.people.should == [tuttle, buttle]
196
+ tuttle = double
197
+ buttle = double
198
+ expect(ATDIS::Models::Person).to(
199
+ receive(:interpret).with({ name: "Tuttle" }, "UTC").and_return(tuttle)
200
+ )
201
+ expect(ATDIS::Models::Person).to(
202
+ receive(:interpret).with({ name: "Buttle" }, "UTC").and_return(buttle)
203
+ )
204
+ a.people = [{ name: "Tuttle" }, { name: "Buttle" }]
205
+ expect(a.people).to eq [tuttle, buttle]
163
206
  end
164
207
  end
165
208
 
166
- # TODO This should really be a test on the Model base class
209
+ # TODO: This should really be a test on the Model base class
167
210
  describe "#attribute_names" do
168
211
  it do
169
- # These are also ordered in a way that corresponds to the specification. Makes for easy reading by humans.
170
- ATDIS::Models::Application.attribute_names.should == [
171
- "info",
172
- "reference",
173
- "locations",
174
- "events",
175
- "documents",
176
- "people",
177
- "extended"
212
+ # These are also ordered in a way that corresponds to the specification.
213
+ # Makes for easy reading by humans.
214
+ expect(ATDIS::Models::Application.attribute_names).to eq %w[
215
+ info
216
+ reference
217
+ locations
218
+ events
219
+ documents
220
+ people
221
+ extended
178
222
  ]
179
223
  end
180
224
  end
181
225
 
182
226
  describe "validations" do
183
227
  before :each do
184
- expect(ATDIS::Models::Location).to receive(:interpret).with("address").and_return(double(valid?: true))
185
- expect(ATDIS::Models::Document).to receive(:interpret).with("document").and_return(double(valid?: true))
186
- expect(ATDIS::Models::Event).to receive(:interpret).with("event").and_return(double(valid?: true))
228
+ expect(ATDIS::Models::Location).to receive(:interpret).with("address", "UTC")
229
+ .and_return(double(valid?: true))
230
+ expect(ATDIS::Models::Document).to receive(:interpret).with("document", "UTC")
231
+ .and_return(double(valid?: true))
232
+ expect(ATDIS::Models::Event).to receive(:interpret).with("event", "UTC")
233
+ .and_return(double(valid?: true))
187
234
  end
188
235
 
189
- let(:a) { ATDIS::Models::Application.new(
190
- info: ATDIS::Models::Info.new(
191
- dat_id: "DA2013-0381",
192
- development_type: "residential",
193
- application_type: "DA",
194
- last_modified_date: DateTime.new(2013,4,20,2,1,7),
195
- description: "New pool plus deck",
196
- authority: {
197
- ref: "http://www.council.nsw.gov.au/atdis/1.0",
198
- name: "Example Council Shire Council"
236
+ let(:a) do
237
+ ATDIS::Models::Application.new(
238
+ {
239
+ info: ATDIS::Models::Info.new(
240
+ {
241
+ dat_id: "DA2013-0381",
242
+ development_type: "residential",
243
+ application_type: "DA",
244
+ last_modified_date: DateTime.new(2013, 4, 20, 2, 1, 7),
245
+ description: "New pool plus deck",
246
+ authority: {
247
+ ref: "http://www.council.nsw.gov.au/atdis/1.0",
248
+ name: "Example Council Shire Council"
249
+ },
250
+ lodgement_date: DateTime.new(2013, 4, 20, 2, 1, 7),
251
+ determination_date: DateTime.new(2013, 6, 20),
252
+ determination_type: "Pending",
253
+ status: "OPEN"
254
+ },
255
+ "UTC"
256
+ ),
257
+ reference: ATDIS::Models::Reference.new(
258
+ {
259
+ more_info_url: URI.parse("http://foo.com/bar")
260
+ },
261
+ "UTC"
262
+ ),
263
+ locations: ["address"],
264
+ events: ["event"],
265
+ documents: ["document"]
199
266
  },
200
- lodgement_date: DateTime.new(2013,4,20,2,1,7),
201
- determination_date: DateTime.new(2013,6,20),
202
- determination_type: "Pending",
203
- status: "OPEN",
204
- ),
205
- reference: ATDIS::Models::Reference.new(
206
- more_info_url: URI.parse("http://foo.com/bar"),
207
- ),
208
- locations: ["address"],
209
- events: ["event"],
210
- documents: ["document"]
211
- ) }
212
-
213
- it { a.should be_valid }
267
+ "UTC"
268
+ )
269
+ end
270
+
271
+ it { expect(a).to be_valid }
214
272
 
215
273
  describe ".location" do
216
274
  it "should not be valid if the location is not valid" do
217
275
  l = double(valid?: false)
218
- expect(ATDIS::Models::Location).to receive(:interpret).with(foo: "some location data").and_return(l)
219
- a.locations = [{foo: "some location data"}]
220
- a.should_not be_valid
276
+ expect(ATDIS::Models::Location).to(
277
+ receive(:interpret).with({ foo: "some location data" }, "UTC").and_return(l)
278
+ )
279
+ a.locations = [{ foo: "some location data" }]
280
+ expect(a).to_not be_valid
221
281
  end
222
282
  end
223
283
 
224
284
  describe "events" do
225
285
  it "has to be an array" do
226
- expect(ATDIS::Models::Event).to receive(:interpret).with(foo: "bar").and_return(double(valid?: true))
227
- a.events = {foo: "bar"}
228
- #a.events.should be_nil
229
- a.should_not be_valid
230
- a.errors.messages.should == {events: [ATDIS::ErrorMessage["should be an array", "4.3"]]}
286
+ expect(ATDIS::Models::Event).to receive(:interpret).with({ foo: "bar" }, "UTC")
287
+ .and_return(double(valid?: true))
288
+ a.events = { foo: "bar" }
289
+ # expect(a.events).to be_nil
290
+ expect(a).to_not be_valid
291
+ expect(a.errors.messages).to eq(
292
+ events: [ATDIS::ErrorMessage["should be an array", "4.3"]]
293
+ )
231
294
  end
232
295
 
233
296
  it "can not be an empty array" do
234
297
  a.events = []
235
- a.should_not be_valid
236
- a.errors.messages.should == {events: [ATDIS::ErrorMessage.new("should not be an empty array", "4.3")]}
298
+ expect(a).to_not be_valid
299
+ expect(a.errors.messages).to eq(
300
+ events: [ATDIS::ErrorMessage.new("should not be an empty array", "4.3")]
301
+ )
237
302
  end
238
303
 
239
304
  it "can not be empty" do
240
305
  a.events = nil
241
- a.should_not be_valid
242
- a.errors.messages.should == {events: [ATDIS::ErrorMessage["can't be blank", "4.3"]]}
306
+ expect(a).to_not be_valid
307
+ expect(a.errors.messages).to eq(
308
+ events: [ATDIS::ErrorMessage["can't be blank", "4.3"]]
309
+ )
243
310
  end
244
311
  end
245
312
 
246
313
  describe "documents" do
247
314
  it "can be an empty array" do
248
315
  a.documents = []
249
- a.should be_valid
316
+ expect(a).to be_valid
250
317
  end
251
318
  end
252
319
  end