power_api 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,6 +62,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
62
62
 
63
63
  it { expect(attributes).to include(params[:blog]) }
64
64
  it { expect(response.status).to eq(201) }
65
+
65
66
  context 'with invalid attributes' do
66
67
  let(:params) do
67
68
  {
@@ -91,6 +92,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
91
92
  end
92
93
 
93
94
  it { expect(response.status).to eq(200) }
95
+
94
96
  context 'with resource not found' do
95
97
  let(:blog_id) { '666' }
96
98
  it { expect(response.status).to eq(404) }
@@ -123,6 +125,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
123
125
 
124
126
  it { expect(attributes).to include(params[:blog]) }
125
127
  it { expect(response.status).to eq(200) }
128
+
126
129
  context 'with invalid attributes' do
127
130
  let(:params) do
128
131
  {
@@ -145,14 +148,15 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
145
148
  let(:blog_id) { blog.id.to_s }
146
149
 
147
150
  def perform
148
- get '/api/v1/blogs/' + blog_id
151
+ delete '/api/v1/blogs/' + blog_id
149
152
  end
150
153
 
151
154
  before do
152
155
  perform
153
156
  end
154
157
 
155
- it { expect(response.status).to eq(200) }
158
+ it { expect(response.status).to eq(204) }
159
+
156
160
  context 'with resource not found' do
157
161
  let(:blog_id) { '666' }
158
162
  it { expect(response.status).to eq(404) }
@@ -237,6 +241,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
237
241
 
238
242
  it { expect(attributes).to include(params[:blog]) }
239
243
  it { expect(response.status).to eq(201) }
244
+
240
245
  context 'with invalid attributes' do
241
246
  let(:params) do
242
247
  {
@@ -276,6 +281,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
276
281
  end
277
282
 
278
283
  it { expect(response.status).to eq(200) }
284
+
279
285
  context 'with resource not found' do
280
286
  let(:blog_id) { '666' }
281
287
  it { expect(response.status).to eq(404) }
@@ -318,6 +324,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
318
324
 
319
325
  it { expect(attributes).to include(params[:blog]) }
320
326
  it { expect(response.status).to eq(200) }
327
+
321
328
  context 'with invalid attributes' do
322
329
  let(:params) do
323
330
  {
@@ -348,7 +355,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
348
355
  let(:blog_id) { blog.id.to_s }
349
356
 
350
357
  def perform
351
- get '/api/v1/blogs/' + blog_id
358
+ delete '/api/v1/blogs/' + blog_id
352
359
  end
353
360
 
354
361
  context 'with authorized user' do
@@ -357,7 +364,8 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
357
364
  perform
358
365
  end
359
366
 
360
- it { expect(response.status).to eq(200) }
367
+ it { expect(response.status).to eq(204) }
368
+
361
369
  context 'with resource not found' do
362
370
  let(:blog_id) { '666' }
363
371
  it { expect(response.status).to eq(404) }
@@ -437,6 +445,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
437
445
 
438
446
  it { expect(attributes).to include(params[:blog]) }
439
447
  it { expect(response.status).to eq(201) }
448
+
440
449
  context 'with invalid attributes' do
441
450
  let(:params) do
442
451
  {
@@ -466,6 +475,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
466
475
  end
467
476
 
468
477
  it { expect(response.status).to eq(200) }
478
+
469
479
  context 'with resource not found' do
470
480
  let(:blog_id) { '666' }
471
481
  it { expect(response.status).to eq(404) }
@@ -498,6 +508,7 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
498
508
 
499
509
  it { expect(attributes).to include(params[:blog]) }
500
510
  it { expect(response.status).to eq(200) }
511
+
501
512
  context 'with invalid attributes' do
502
513
  let(:params) do
503
514
  {
@@ -520,14 +531,15 @@ describe PowerApi::GeneratorHelper::RspecControllerHelper, type: :generator do
520
531
  let(:blog_id) { blog.id.to_s }
521
532
 
522
533
  def perform
523
- get '/api/v1/blogs/' + blog_id
534
+ delete '/api/v1/blogs/' + blog_id
524
535
  end
525
536
 
526
537
  before do
527
538
  perform
528
539
  end
529
540
 
530
- it { expect(response.status).to eq(200) }
541
+ it { expect(response.status).to eq(204) }
542
+
531
543
  context 'with resource not found' do
532
544
  let(:blog_id) { '666' }
533
545
  it { expect(response.status).to eq(404) }
@@ -3,12 +3,12 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
3
3
  describe "#resource_attributes" do
4
4
  let(:expected_attributes) do
5
5
  [
6
- { name: :id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false },
7
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true },
8
- { name: :body, type: :text, swagger_type: :string, example: "'Some body'", required: true },
9
- { name: :created_at, type: :datetime, swagger_type: :string, example: "'1984-06-04 09:00'", required: false },
10
- { name: :updated_at, type: :datetime, swagger_type: :string, example: "'1984-06-04 09:00'", required: false },
11
- { name: :portfolio_id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false }
6
+ { name: :id, type: :integer, example: kind_of(Integer), required: false },
7
+ { name: :title, type: :string, example: "'Some title'", required: true },
8
+ { name: :body, type: :text, example: "'Some body'", required: true },
9
+ { name: :created_at, type: :datetime, example: "'1984-06-04 09:00'", required: false },
10
+ { name: :updated_at, type: :datetime, example: "'1984-06-04 09:00'", required: false },
11
+ { name: :portfolio_id, type: :integer, example: kind_of(Integer), required: false }
12
12
  ]
13
13
  end
14
14
 
@@ -22,9 +22,9 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
22
22
  let(attributes_key) { %w{title body} }
23
23
  let(:expected_attributes) do
24
24
  [
25
- { name: :id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false },
26
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true },
27
- { name: :body, type: :text, swagger_type: :string, example: "'Some body'", required: true }
25
+ { name: :id, type: :integer, example: kind_of(Integer), required: false },
26
+ { name: :title, type: :string, example: "'Some title'", required: true },
27
+ { name: :body, type: :text, example: "'Some body'", required: true }
28
28
  ]
29
29
  end
30
30
 
@@ -35,8 +35,8 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
35
35
  let(attributes_key) { %w{title bloody} }
36
36
  let(:expected_attributes) do
37
37
  [
38
- { name: :id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false },
39
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true }
38
+ { name: :id, type: :integer, example: kind_of(Integer), required: false },
39
+ { name: :title, type: :string, example: "'Some title'", required: true }
40
40
  ]
41
41
  end
42
42
 
@@ -48,8 +48,8 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
48
48
  let(:include_id) { false }
49
49
  let(:expected_attributes) do
50
50
  [
51
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true },
52
- { name: :body, type: :text, swagger_type: :string, example: "'Some body'", required: true }
51
+ { name: :title, type: :string, example: "'Some title'", required: true },
52
+ { name: :body, type: :text, example: "'Some body'", required: true }
53
53
  ]
54
54
  end
55
55
 
@@ -63,9 +63,9 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
63
63
  let(:include_id) { true }
64
64
  let(:expected_attributes) do
65
65
  [
66
- { name: :id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false },
67
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true },
68
- { name: :body, type: :text, swagger_type: :string, example: "'Some body'", required: true }
66
+ { name: :id, type: :integer, example: kind_of(Integer), required: false },
67
+ { name: :title, type: :string, example: "'Some title'", required: true },
68
+ { name: :body, type: :text, example: "'Some body'", required: true }
69
69
  ]
70
70
  end
71
71
 
@@ -91,7 +91,7 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
91
91
  describe "#optional_resource_attributes" do
92
92
  let(:expected_attributes) do
93
93
  [
94
- { name: :portfolio_id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false }
94
+ { name: :portfolio_id, type: :integer, example: kind_of(Integer), required: false }
95
95
  ]
96
96
  end
97
97
 
@@ -124,9 +124,9 @@ shared_examples 'ActiveRecord resource attributes' do |attributes_key|
124
124
  describe "#permitted_attributes" do
125
125
  let(:expected_attributes) do
126
126
  [
127
- { name: :title, type: :string, swagger_type: :string, example: "'Some title'", required: true },
128
- { name: :body, type: :text, swagger_type: :string, example: "'Some body'", required: true },
129
- { name: :portfolio_id, type: :integer, swagger_type: :integer, example: kind_of(Integer), required: false }
127
+ { name: :title, type: :string, example: "'Some title'", required: true },
128
+ { name: :body, type: :text, example: "'Some body'", required: true },
129
+ { name: :portfolio_id, type: :integer, example: kind_of(Integer), required: false }
130
130
  ]
131
131
  end
132
132
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: power_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-02-01 00:00:00.000000000 Z
12
+ date: 2022-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -95,34 +95,6 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: rswag-api
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :runtime
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: rswag-ui
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :runtime
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
98
  - !ruby/object:Gem::Dependency
127
99
  name: simple_token_authentication
128
100
  requirement: !ruby/object:Gem::Requirement
@@ -249,20 +221,6 @@ dependencies:
249
221
  - - ">="
250
222
  - !ruby/object:Gem::Version
251
223
  version: '0'
252
- - !ruby/object:Gem::Dependency
253
- name: rswag-specs
254
- requirement: !ruby/object:Gem::Requirement
255
- requirements:
256
- - - ">="
257
- - !ruby/object:Gem::Version
258
- version: '0'
259
- type: :development
260
- prerelease: false
261
- version_requirements: !ruby/object:Gem::Requirement
262
- requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- version: '0'
266
224
  - !ruby/object:Gem::Dependency
267
225
  name: rubocop
268
226
  requirement: !ruby/object:Gem::Requirement
@@ -369,7 +327,6 @@ files:
369
327
  - lib/power_api/generator_helper/rspec_controller_helper.rb
370
328
  - lib/power_api/generator_helper/rubocop_helper.rb
371
329
  - lib/power_api/generator_helper/simple_token_auth_helper.rb
372
- - lib/power_api/generator_helper/swagger_helper.rb
373
330
  - lib/power_api/generator_helper/template_builder_helper.rb
374
331
  - lib/power_api/generator_helpers.rb
375
332
  - lib/power_api/version.rb
@@ -454,7 +411,6 @@ files:
454
411
  - spec/dummy/spec/lib/power_api/generator_helper/routes_helper_spec.rb
455
412
  - spec/dummy/spec/lib/power_api/generator_helper/rspec_controller_helper_spec.rb
456
413
  - spec/dummy/spec/lib/power_api/generator_helper/simple_token_auth_helper_spec.rb
457
- - spec/dummy/spec/lib/power_api/generator_helper/swagger_helper_spec.rb
458
414
  - spec/dummy/spec/support/shared_examples/active_record_resource.rb
459
415
  - spec/dummy/spec/support/shared_examples/active_record_resource_atrributes.rb
460
416
  - spec/dummy/spec/support/test_generator_helpers.rb
@@ -564,7 +520,6 @@ test_files:
564
520
  - spec/dummy/spec/lib/power_api/generator_helper/routes_helper_spec.rb
565
521
  - spec/dummy/spec/lib/power_api/generator_helper/rspec_controller_helper_spec.rb
566
522
  - spec/dummy/spec/lib/power_api/generator_helper/simple_token_auth_helper_spec.rb
567
- - spec/dummy/spec/lib/power_api/generator_helper/swagger_helper_spec.rb
568
523
  - spec/dummy/spec/support/shared_examples/active_record_resource.rb
569
524
  - spec/dummy/spec/support/shared_examples/active_record_resource_atrributes.rb
570
525
  - spec/dummy/spec/support/test_generator_helpers.rb