kalibro_client 0.0.1 → 0.0.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/.travis.yml +1 -1
- data/features/kalibro_configuration/all.feature +6 -6
- data/features/kalibro_configuration/creation.feature +5 -5
- data/features/kalibro_configuration/destroy.feature +6 -6
- data/features/kalibro_configuration/metric_configurations.feature +4 -4
- data/features/{range → kalibro_range}/destroy.feature +2 -2
- data/features/{range → kalibro_range}/exists.feature +2 -2
- data/features/{range → kalibro_range}/find.feature +2 -2
- data/features/{range → kalibro_range}/ranges_of.feature +4 -4
- data/features/{range → kalibro_range}/save.feature +2 -2
- data/features/kalibro_range/update.feature +54 -0
- data/features/metric_configuration/creation.feature +2 -2
- data/features/metric_configuration/destroy.feature +2 -2
- data/features/metric_configuration/find.feature +2 -2
- data/features/metric_configuration/metric_configurations_of.feature +8 -8
- data/features/metric_result/descendant_values.feature +2 -2
- data/features/metric_result/history_of.feature +2 -2
- data/features/metric_result/metric_results_of.feature +2 -2
- data/features/module_result/children.feature +2 -2
- data/features/module_result/find.feature +2 -2
- data/features/module_result/history_of.feature +2 -2
- data/features/processing/first_processing_after.feature +2 -2
- data/features/processing/first_processing_of.feature +2 -2
- data/features/processing/has_processing.feature +2 -2
- data/features/processing/has_processing_after.feature +2 -2
- data/features/processing/has_processing_before.feature +2 -2
- data/features/processing/has_ready_processing.feature +2 -2
- data/features/processing/last_processing_before.feature +2 -2
- data/features/processing/last_processing_of.feature +2 -2
- data/features/processing/last_processing_state_of.feature +2 -2
- data/features/processing/last_ready_processing_of.feature +2 -2
- data/features/processing/processing_of.feature +4 -4
- data/features/processing/processing_with_date_of.feature +4 -4
- data/features/project/update.feature +13 -0
- data/features/repository/all.feature +1 -1
- data/features/repository/cancel_processing.feature +1 -1
- data/features/repository/destroy.feature +1 -1
- data/features/repository/exists.feature +1 -1
- data/features/repository/find.feature +1 -1
- data/features/repository/of.feature +1 -1
- data/features/repository/process.feature +2 -2
- data/features/step_definitions/kalibro_configuration_steps.rb +40 -0
- data/features/step_definitions/metric_configuration_steps.rb +9 -9
- data/features/step_definitions/module_result_steps.rb +1 -1
- data/features/step_definitions/project_steps.rb +12 -0
- data/features/step_definitions/range_steps.rb +25 -1
- data/features/step_definitions/reading_steps.rb +1 -1
- data/features/step_definitions/repository_steps.rb +1 -1
- data/lib/kalibro_client/entities/base.rb +53 -19
- data/lib/kalibro_client/entities/configurations/base.rb +4 -1
- data/lib/kalibro_client/entities/configurations/kalibro_configuration.rb +1 -1
- data/lib/kalibro_client/entities/configurations/kalibro_range.rb +8 -8
- data/lib/kalibro_client/entities/configurations/metric_configuration.rb +7 -5
- data/lib/kalibro_client/entities/configurations/reading.rb +4 -4
- data/lib/kalibro_client/entities/configurations/reading_group.rb +4 -0
- data/lib/kalibro_client/entities/processor/base.rb +2 -1
- data/lib/kalibro_client/entities/processor/kalibro_module.rb +1 -0
- data/lib/kalibro_client/entities/processor/metric_collector_details.rb +7 -2
- data/lib/kalibro_client/entities/processor/metric_result.rb +9 -10
- data/lib/kalibro_client/entities/processor/module_result.rb +10 -2
- data/lib/kalibro_client/entities/processor/processing.rb +26 -10
- data/lib/kalibro_client/entities/processor/project.rb +4 -0
- data/lib/kalibro_client/entities/processor/repository.rb +63 -4
- data/lib/kalibro_client/helpers/date_attributes.rb +11 -0
- data/lib/kalibro_client/helpers/request_methods.rb +9 -0
- data/lib/kalibro_client/version.rb +1 -1
- data/spec/entities/base_spec.rb +106 -24
- data/spec/entities/configurations/kalibro_configuration_spec.rb +8 -8
- data/spec/entities/configurations/kalibro_range_spec.rb +18 -24
- data/spec/entities/configurations/metric_configuration_spec.rb +22 -23
- data/spec/entities/configurations/reading_group_spec.rb +27 -0
- data/spec/entities/configurations/reading_spec.rb +15 -7
- data/spec/entities/processor/metric_collector_details_spec.rb +19 -7
- data/spec/entities/processor/metric_result_spec.rb +40 -54
- data/spec/entities/processor/module_result_spec.rb +52 -3
- data/spec/entities/processor/processing_spec.rb +35 -92
- data/spec/entities/processor/project_spec.rb +52 -5
- data/spec/entities/processor/repository_spec.rb +255 -5
- data/spec/factories/kalibro_configurations.rb +3 -3
- data/spec/factories/kalibro_ranges.rb +9 -3
- data/spec/factories/metrics.rb +1 -1
- data/spec/factories/readings.rb +1 -1
- data/spec/factories/repositories.rb +1 -1
- data/spec/helpers/date_attributes_spec.rb +30 -0
- metadata +21 -14
- data/features/step_definitions/configuration_steps.rb +0 -40
@@ -17,9 +17,8 @@
|
|
17
17
|
require 'spec_helper'
|
18
18
|
|
19
19
|
describe KalibroClient::Entities::Processor::Project do
|
20
|
+
subject { FactoryGirl.build(:project, {id: 42}) }
|
20
21
|
describe 'initialize' do
|
21
|
-
subject { FactoryGirl.build(:project, {id: 42}) }
|
22
|
-
|
23
22
|
it 'should have the id set to 42' do
|
24
23
|
expect(subject.id).to eq(42)
|
25
24
|
end
|
@@ -52,9 +51,9 @@ describe KalibroClient::Entities::Processor::Project do
|
|
52
51
|
|
53
52
|
before :each do
|
54
53
|
KalibroClient::Entities::Processor::Project.
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
expects(:request).
|
55
|
+
with('', {}, :get).
|
56
|
+
returns({"projects" => [project.to_hash, another_project.to_hash]})
|
58
57
|
end
|
59
58
|
|
60
59
|
it 'should return a list with projects' do
|
@@ -65,4 +64,52 @@ describe KalibroClient::Entities::Processor::Project do
|
|
65
64
|
end
|
66
65
|
end
|
67
66
|
end
|
67
|
+
|
68
|
+
describe 'repositories' do
|
69
|
+
let(:project) { FactoryGirl.build(:project) }
|
70
|
+
let(:repository) { FactoryGirl.build(:repository) }
|
71
|
+
|
72
|
+
context 'with a repository' do
|
73
|
+
|
74
|
+
before :each do
|
75
|
+
KalibroClient::Entities::Processor::Project.
|
76
|
+
expects(:request).
|
77
|
+
with(':id/repositories', {id: project.id}, :get).
|
78
|
+
returns({"repositories" => [repository.to_hash]})
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'should return a list with repositories' do
|
82
|
+
expect(project.repositories).to eq([repository])
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context 'without a repository' do
|
87
|
+
before :each do
|
88
|
+
KalibroClient::Entities::Processor::Project.
|
89
|
+
expects(:request).
|
90
|
+
with(':id/repositories', {id: project.id}, :get).
|
91
|
+
returns({"repositories" => []})
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'should return an empty list' do
|
95
|
+
expect(project.repositories).to eq([])
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe 'update' do
|
101
|
+
context 'with attributes' do
|
102
|
+
before :each do
|
103
|
+
KalibroClient::Entities::Processor::Project.
|
104
|
+
expects(:request).
|
105
|
+
with(':id', {project: {"name" => "Another Name", "description" => subject.description, "id" => subject.id.to_s}, id: subject.id}, :put, '').
|
106
|
+
returns({"project" => {"id" => subject.id, "name" => "Another Name", "kalibro_errors" => []}})
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'is expected to have name Another Name' do
|
110
|
+
subject.update(name: "Another Name")
|
111
|
+
expect(subject.name).to eq("Another Name")
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
68
115
|
end
|
@@ -18,6 +18,7 @@ require 'spec_helper'
|
|
18
18
|
|
19
19
|
describe KalibroClient::Entities::Processor::Repository do
|
20
20
|
subject { FactoryGirl.build(:repository) }
|
21
|
+
let(:date) { DateTime.now }
|
21
22
|
|
22
23
|
describe 'repository_types' do
|
23
24
|
before :each do
|
@@ -67,10 +68,10 @@ describe KalibroClient::Entities::Processor::Repository do
|
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
|
-
describe "
|
71
|
-
it 'should set the
|
72
|
-
subject.
|
73
|
-
expect(subject.
|
71
|
+
describe "kalibro_configuration_id=" do
|
72
|
+
it 'should set the kalibro_configuration_id attribute values as integer' do
|
73
|
+
subject.kalibro_configuration_id = "222"
|
74
|
+
expect(subject.kalibro_configuration_id).to eq(222)
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
@@ -90,7 +91,7 @@ describe KalibroClient::Entities::Processor::Repository do
|
|
90
91
|
before :each do
|
91
92
|
KalibroClient::Entities::Processor::Repository.
|
92
93
|
expects(:request).
|
93
|
-
with('cancel_process', {id: subject.id})
|
94
|
+
with(':id/cancel_process', {id: subject.id}, :get)
|
94
95
|
end
|
95
96
|
|
96
97
|
it 'should call the request method' do
|
@@ -137,4 +138,253 @@ describe KalibroClient::Entities::Processor::Repository do
|
|
137
138
|
expect(subject.kalibro_errors).to be_empty
|
138
139
|
end
|
139
140
|
end
|
141
|
+
|
142
|
+
describe 'has_processing' do
|
143
|
+
before :each do
|
144
|
+
KalibroClient::Entities::Processor::Repository.
|
145
|
+
expects(:request).once.
|
146
|
+
with("#{subject.id}/has_processing", {}, :get).
|
147
|
+
returns({'has_processing' => false})
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should convert the hash to a Boolean class' do
|
151
|
+
response = subject.has_processing
|
152
|
+
expect(response).to be_a_kind_of(FalseClass)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
describe 'has_ready_processing' do
|
157
|
+
before :each do
|
158
|
+
KalibroClient::Entities::Processor::Repository.
|
159
|
+
expects(:request).once.
|
160
|
+
with("#{subject.id}/has_ready_processing", {}, :get).
|
161
|
+
returns({'has_ready_processing' => false})
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'should convert the hash to a Boolean class' do
|
165
|
+
response = subject.has_ready_processing
|
166
|
+
expect(response).to be_a_kind_of(FalseClass)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
describe 'has_processing_after' do
|
171
|
+
before :each do
|
172
|
+
KalibroClient::Entities::Processor::Repository.
|
173
|
+
expects(:request).once.
|
174
|
+
with("#{subject.id}/has_processing/after", {date: date}).
|
175
|
+
returns({'has_processing_in_time' => false})
|
176
|
+
end
|
177
|
+
|
178
|
+
it 'should convert the hash to a Boolean class' do
|
179
|
+
response = subject.has_processing_after(date)
|
180
|
+
expect(response).to be_a_kind_of(FalseClass)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
describe 'has_processing_before' do
|
185
|
+
before :each do
|
186
|
+
KalibroClient::Entities::Processor::Repository.
|
187
|
+
expects(:request).once.
|
188
|
+
with("#{subject.id}/has_processing/before", {date: date}).
|
189
|
+
returns({'has_processing_in_time' => false})
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'should convert the hash to a Boolean class' do
|
193
|
+
response = subject.has_processing_before(date)
|
194
|
+
expect(response).to be_a_kind_of(FalseClass)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
describe 'last_processing_state' do
|
199
|
+
let(:any_state) { "READY" }
|
200
|
+
before :each do
|
201
|
+
KalibroClient::Entities::Processor::Repository.
|
202
|
+
expects(:request).once.
|
203
|
+
with("#{subject.id}/last_processing_state", {}, :get).
|
204
|
+
returns({'processing_state' => any_state})
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'should return the state as string' do
|
208
|
+
response = subject.last_processing_state
|
209
|
+
expect(response).to eq(any_state)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
context 'getting processing entity from Kalibro web service' do
|
214
|
+
let(:processing) { FactoryGirl.build(:processing) }
|
215
|
+
|
216
|
+
describe 'processing' do
|
217
|
+
context 'when the repository has a ready processing' do
|
218
|
+
before do
|
219
|
+
KalibroClient::Entities::Processor::Repository.
|
220
|
+
expects(:request).once.
|
221
|
+
with("#{subject.id}/has_ready_processing", {}, :get).
|
222
|
+
returns({'has_ready_processing' => true})
|
223
|
+
|
224
|
+
KalibroClient::Entities::Processor::Repository.
|
225
|
+
expects(:request).once.
|
226
|
+
with(':id/last_ready_processing', {id: subject.id}, :get).
|
227
|
+
returns({'last_ready_processing' => processing.to_hash})
|
228
|
+
end
|
229
|
+
|
230
|
+
it 'should return the last ready processing' do
|
231
|
+
response = subject.processing
|
232
|
+
expect(response.state).to eq(processing.state)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
context 'when the repository has not a ready processing' do
|
237
|
+
before do
|
238
|
+
KalibroClient::Entities::Processor::Repository.
|
239
|
+
expects(:request).once.
|
240
|
+
with("#{subject.id}/has_ready_processing", {}, :get).
|
241
|
+
returns({'exists' => false})
|
242
|
+
|
243
|
+
KalibroClient::Entities::Processor::Repository.
|
244
|
+
expects(:request).once.
|
245
|
+
with("#{subject.id}/last_processing").
|
246
|
+
returns({'processing' => processing.to_hash})
|
247
|
+
end
|
248
|
+
|
249
|
+
it 'should return the last processing' do
|
250
|
+
response = subject.processing
|
251
|
+
expect(response.state).to eq(processing.state)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
describe 'processing_with_date' do
|
257
|
+
context 'when the repository has a processing after the given date' do
|
258
|
+
before do
|
259
|
+
KalibroClient::Entities::Processor::Repository.
|
260
|
+
expects(:request).once.
|
261
|
+
with("#{subject.id}/has_processing/after", {date: date}).
|
262
|
+
returns({'has_processing_in_time' => true})
|
263
|
+
|
264
|
+
KalibroClient::Entities::Processor::Repository.
|
265
|
+
expects(:request).once.
|
266
|
+
with("#{subject.id}/first_processing/after", {date: date}).
|
267
|
+
returns({'processing' => processing.to_hash})
|
268
|
+
end
|
269
|
+
|
270
|
+
it 'should return the first processing after the given date' do
|
271
|
+
response = subject.processing_with_date(date)
|
272
|
+
expect(response.state).to eq(processing.state)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
context 'when the repository has a processing before the given date' do
|
277
|
+
before do
|
278
|
+
KalibroClient::Entities::Processor::Repository.
|
279
|
+
expects(:request).once.
|
280
|
+
with("#{subject.id}/has_processing/after", {date: date}).
|
281
|
+
returns({'has_processing_in_time' => false})
|
282
|
+
|
283
|
+
KalibroClient::Entities::Processor::Repository.
|
284
|
+
expects(:request).once.
|
285
|
+
with("#{subject.id}/has_processing/before", {date: date}).
|
286
|
+
returns({'has_processing_in_time' => true})
|
287
|
+
|
288
|
+
KalibroClient::Entities::Processor::Repository.
|
289
|
+
expects(:request).once.
|
290
|
+
with("#{subject.id}/last_processing/before", {date: date}).
|
291
|
+
returns({'processing' => processing.to_hash})
|
292
|
+
end
|
293
|
+
|
294
|
+
it 'should return the last ready processing' do
|
295
|
+
response = subject.processing_with_date(date)
|
296
|
+
expect(response.state).to eq(processing.state)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
context 'when the repository has not a processing after or before the given date' do
|
301
|
+
before do
|
302
|
+
KalibroClient::Entities::Processor::Repository.
|
303
|
+
expects(:request).once.
|
304
|
+
with("#{subject.id}/has_processing/after", {date: date}).
|
305
|
+
returns({'has_processing_in_time' => false})
|
306
|
+
|
307
|
+
KalibroClient::Entities::Processor::Repository.
|
308
|
+
expects(:request).once.
|
309
|
+
with("#{subject.id}/has_processing/before", {date: date}).
|
310
|
+
returns({'has_processing_in_time' => false})
|
311
|
+
end
|
312
|
+
|
313
|
+
it 'should return the last ready processing' do
|
314
|
+
response = subject.processing_with_date(date)
|
315
|
+
expect(response).to be_nil
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
describe 'last_ready_processing' do
|
321
|
+
before :each do
|
322
|
+
KalibroClient::Entities::Processor::Repository.
|
323
|
+
expects(:request).once.
|
324
|
+
with(':id/last_ready_processing', {id: subject.id}, :get).
|
325
|
+
returns({'last_ready_processing' => processing.to_hash})
|
326
|
+
end
|
327
|
+
|
328
|
+
it 'should return a processing object' do
|
329
|
+
response = subject.last_ready_processing
|
330
|
+
expect(response.state).to eq(processing.state)
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
describe 'first_processing' do
|
335
|
+
before :each do
|
336
|
+
KalibroClient::Entities::Processor::Repository.
|
337
|
+
expects(:request).once.
|
338
|
+
with("#{subject.id}/first_processing").
|
339
|
+
returns({'processing' => processing.to_hash})
|
340
|
+
end
|
341
|
+
|
342
|
+
it 'should return a processing object' do
|
343
|
+
response = subject.first_processing
|
344
|
+
expect(response.state).to eq(processing.state)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
describe 'last_processing' do
|
349
|
+
before :each do
|
350
|
+
KalibroClient::Entities::Processor::Repository.
|
351
|
+
expects(:request).once.
|
352
|
+
with("#{subject.id}/last_processing").
|
353
|
+
returns({'processing' => processing.to_hash})
|
354
|
+
end
|
355
|
+
|
356
|
+
it 'should return a processing object' do
|
357
|
+
response = subject.last_processing
|
358
|
+
expect(response.state).to eq(processing.state)
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
describe 'first_processing_after' do
|
363
|
+
before :each do
|
364
|
+
KalibroClient::Entities::Processor::Repository.
|
365
|
+
expects(:request).once.
|
366
|
+
with("#{subject.id}/first_processing/after", {date: date}).
|
367
|
+
returns({'processing' => processing.to_hash})
|
368
|
+
end
|
369
|
+
|
370
|
+
it 'should return a processing object' do
|
371
|
+
response = subject.first_processing_after(date)
|
372
|
+
expect(response.state).to eq(processing.state)
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
describe 'last_processing_before' do
|
377
|
+
before :each do
|
378
|
+
KalibroClient::Entities::Processor::Repository.
|
379
|
+
expects(:request).once.
|
380
|
+
with("#{subject.id}/last_processing/before", {date: date}).
|
381
|
+
returns({'processing' => processing.to_hash})
|
382
|
+
end
|
383
|
+
|
384
|
+
it 'should return a processing object' do
|
385
|
+
response = subject.last_processing_before(date)
|
386
|
+
expect(response.state).to eq(processing.state)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
140
390
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
FactoryGirl.define do
|
18
|
-
factory :
|
18
|
+
factory :kalibro_configuration, class: KalibroClient::Entities::Configurations::KalibroConfiguration do
|
19
19
|
name "Java"
|
20
20
|
description "Code metrics for Java."
|
21
21
|
|
@@ -23,10 +23,10 @@ FactoryGirl.define do
|
|
23
23
|
id 1
|
24
24
|
end
|
25
25
|
|
26
|
-
factory :
|
26
|
+
factory :kalibro_configuration_with_id, traits: [:with_id]
|
27
27
|
end
|
28
28
|
|
29
|
-
factory :
|
29
|
+
factory :another_kalibro_configuration, class: KalibroClient::Entities::Configurations::KalibroConfiguration do
|
30
30
|
id 12
|
31
31
|
name "Perl"
|
32
32
|
description "Code metrics for Perl."
|
@@ -16,8 +16,8 @@
|
|
16
16
|
|
17
17
|
FactoryGirl.define do
|
18
18
|
factory :range, class: KalibroClient::Entities::Configurations::KalibroRange do
|
19
|
-
beginning 1.1
|
20
|
-
self.end 5.1
|
19
|
+
beginning "1.1"
|
20
|
+
self.end "5.1"
|
21
21
|
reading_id 3
|
22
22
|
comments "Comment"
|
23
23
|
metric_configuration_id 1
|
@@ -34,7 +34,13 @@ FactoryGirl.define do
|
|
34
34
|
id 2
|
35
35
|
end
|
36
36
|
|
37
|
+
trait :another_threshold do
|
38
|
+
beginning "0"
|
39
|
+
self.end "1.1"
|
40
|
+
end
|
41
|
+
|
37
42
|
factory :range_with_id, traits: [:with_id]
|
38
|
-
factory :another_range, traits: [:another_comment, :
|
43
|
+
factory :another_range, traits: [:another_comment, :another_threshold]
|
44
|
+
factory :another_range_with_id, traits: [:another_comment, :another_threshold, :another_id]
|
39
45
|
end
|
40
46
|
end
|
data/spec/factories/metrics.rb
CHANGED
data/spec/factories/readings.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'kalibro_client/helpers/date_attributes'
|
3
|
+
|
4
|
+
include DateAttributes
|
5
|
+
|
6
|
+
class Klass
|
7
|
+
include DateAttributes
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
describe 'DateAttributes' do
|
12
|
+
subject { Klass.new }
|
13
|
+
let(:time){ "2015-02-04T15:53:18.452Z" }
|
14
|
+
|
15
|
+
describe 'created_at=' do
|
16
|
+
it 'is expected to parse it to DateTime' do
|
17
|
+
DateTime.expects(:parse).with(time)
|
18
|
+
|
19
|
+
subject.created_at = time
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'updated_at=' do
|
24
|
+
it 'is expected to parse it to DateTime' do
|
25
|
+
DateTime.expects(:parse).with(time)
|
26
|
+
|
27
|
+
subject.updated_at = time
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|