red-api 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3247b741f6c7d6a10fab58ebeeb6ab51c355418b4b791d2c2ffc4f1018e28d4
4
- data.tar.gz: e27d1ceb69d5b89b2a4f87cc7ffaf20b5f19f8e3ce3e58cf9abdea2f92de8c50
3
+ metadata.gz: b953b6b0eb60428808e5e4e96bee115704ccb947e181d1ca00273607ee741a78
4
+ data.tar.gz: c4658cbf00f844f698f46ab5a3c0e68816d67f82af29971a76914b8337a5d7a7
5
5
  SHA512:
6
- metadata.gz: f8822fc4aaa6ffa7c0f8b824605365b86d65ab68eb1fe93e4144344686717590f1ad98df1f97b674e7c8eb1daf86101945f6bbbe7393d902b6918441668ce20c
7
- data.tar.gz: 59201a7157c80514c31bb61fcd9cc52daea985e2924bdc53aaca910b94d542f4ce1c7af9888d61b7f8f32d87870801cf834978888f190ef90e471cc02b23ff1c
6
+ metadata.gz: f075a31f36be34e96985768565d8e3a49c1644c5c3562b5290374d9cf8ec714a3b0d1d1a01db2af96f9cd84dff08307d8eafa615d984b7c1068444face8f6cc8
7
+ data.tar.gz: 3d6a8aaba3eb5448c479258d45ff3a0c9e9c1dfa136570c7923908c2915a5e8db5e2e25e0d29fa951d108d0837833d16bd051d7eec97df46cd10ca0cf396b222
@@ -27,7 +27,7 @@ class EndpointGenerator < Rails::Generators::NamedBase
27
27
  create_endpoint_params if options[:endpoint_params].present?
28
28
  create_helper_params if options[:include_helper_params].present?
29
29
 
30
- spec_file_name = 'endpoints_spec.rb';
30
+ spec_file_name = @endpoint_name.underscore + '_spec.rb';
31
31
  spec_dir = 'spec/services/'
32
32
  spec_api_dir = spec_dir + @api_service.underscore + '/'
33
33
  service_version_dir = spec_api_dir + @api_version.downcase + '/'
@@ -38,12 +38,7 @@ class EndpointGenerator < Rails::Generators::NamedBase
38
38
 
39
39
  spec_file_path = service_version_dir + spec_file_name
40
40
 
41
- template 'endpoint_spec.erb', spec_file_path unless File.exist? spec_file_path
42
-
43
- end_point_test = ERB.new load_template('endpoint_test.erb')
44
- inject_into_file spec_file_path, after: " # API Endpoint tests\n" do
45
- end_point_test.result(binding)
46
- end
41
+ template 'endpoint_spec.erb', spec_file_path
47
42
 
48
43
  service_dir_path = "app/services/#{@api_service}/"
49
44
  service_api_version_path = service_dir_path + @api_version + '/'
@@ -1,5 +1,11 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  RSpec.describe <%=@endpoint_reference%> do
4
- # API Endpoint tests
4
+ describe '<%=@endpoint_name.underscore%>' do
5
+ it 'returns expected data when successful' do
6
+ skip 'Write tests for <%=@endpoint_name.underscore%>'
7
+ <%='# Define endpoint parameters here' if @endpoint_params%>
8
+ response = <%=@full_endpoint_reference%><%="(#{@endpoint_params})" if @endpoint_params%>
9
+ end
10
+ end
5
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard DeSilvey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -79,7 +79,6 @@ files:
79
79
  - lib/generators/endpoint/templates/api_call.erb
80
80
  - lib/generators/endpoint/templates/endpoint_helper.erb
81
81
  - lib/generators/endpoint/templates/endpoint_spec.erb
82
- - lib/generators/endpoint/templates/endpoint_test.erb
83
82
  - lib/generators/endpoint/templates/mixin.erb
84
83
  - lib/generators/service/USAGE
85
84
  - lib/generators/service/service_generator.rb
@@ -1,8 +0,0 @@
1
-
2
- describe '#<%=@endpoint_name.underscore%>' do
3
- it 'returns expected data' do
4
- skip 'Write tests for <%=@endpoint_name.underscore%>'
5
- <%='# Define endpoint parameters here' if @endpoint_params%>
6
- response = <%=@full_endpoint_reference%><%="(#{@endpoint_params})" if @endpoint_params%>
7
- end
8
- end