graphql_scaffold_fan 0.2.6 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132d797967560ca9aff1ca078a4ad7fe8d0febc255baebde4e6a5202c078b659
4
- data.tar.gz: 8effbef5b823d3e242c8820128cbc66c096adbee8e710a448ddbedf714980c08
3
+ metadata.gz: 9ba9d72db1f0fb0c651d27bc1921d51c2faba8cc256bf48619083d3c3759e43c
4
+ data.tar.gz: 14479b75e45e7d5db5a76d88018e57d85f0c9ad2385a45a3c3520004aad91b8f
5
5
  SHA512:
6
- metadata.gz: f65c5dba53e8772e766221bdd284b5306c58239a18913b1b3d5fb170b1dc41f3a8e8322acfbbd3712012d5bc9908fb52171e76165c034516be69e48f4fd97cd2
7
- data.tar.gz: c690eade0d07e8aec469266b284b45a59ba31b77bd7775686a2a01711d88377988b72e8c8e56ff9ff79efc04db1ab4291c720cfa0658e48f8fd64d749a526c46
6
+ metadata.gz: 75995831b11640fe0ba5fe8d308692b1f4366b51654bebe9517882239414b58bb1c2de4dd8185fe694804c8aca9ba97d41c475950ad0d2d526d82c2ca95061dd
7
+ data.tar.gz: 02442d7ad6976caeba210601d0a8883d50d6b50afacf0f6084fd168a138f8ea35ca11dceb71914d932923820f49f6e76f9983e03815f8781947e5e108d37ab9f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_scaffold_fan (0.2.6)
4
+ graphql_scaffold_fan (0.2.9)
5
5
  graphql
6
6
  graphql_playground-rails
7
7
 
@@ -22,7 +22,7 @@ module GraphqlScaffold
22
22
  generator_dir_path = admin_mutation_dir_path + ("/#{@module_name.underscore}" if @module_name.present?).to_s
23
23
  @generator_path = generator_dir_path + "/#{file_name}s"
24
24
 
25
- admin_mutation_test_dir_path = 'spec/graphql/mutations/admin'
25
+ admin_mutation_test_dir_path = 'spec/requests/mutations/admin'
26
26
  generator_test_dir_path = admin_mutation_test_dir_path + (if @module_name.present?
27
27
  "/#{@module_name.underscore}"
28
28
  end).to_s
@@ -122,13 +122,6 @@ module GraphqlScaffold
122
122
  template 'mutation_type.haml', generator_path
123
123
  end
124
124
  end
125
-
126
- def create_test_file
127
- test_dir_path = 'spec/requests/mutations'
128
- test_file_path = test_dir_path + "/#{file_name}_spec.rb"
129
- FileUtils.mkdir_p(test_dir_path) unless File.exist?(test_dir_path)
130
- template 'mutation_test.haml', test_file_path
131
- end
132
125
  end
133
126
  end
134
127
  end
@@ -11,10 +11,12 @@ module GraphqlScaffold
11
11
  dst_dir = 'app/graphql/types/admin'
12
12
  if File.exist?("app/graphql/types/#{file_name}_type.rb")
13
13
  FileUtils.mv(src_file, dst_dir)
14
+ p "Move #{file_name}_type.rb location"
14
15
  file = File.open("#{dst_dir}/#{file_name}_type.rb")
15
16
  file_data = file.read
16
- new_file_data = file_data.insert(21, 'Admin::')
17
+ new_file_data = file_data.insert(52, 'Admin::')
17
18
  File.write(file, new_file_data)
19
+ p "Write to #{file_name}_type.rb"
18
20
  else
19
21
  p "can not find #{file_name}_type file to move"
20
22
  end
@@ -67,7 +69,7 @@ module GraphqlScaffold
67
69
  end
68
70
 
69
71
  def create_test_file
70
- test_dir_path = 'spec/requests/queries'
72
+ test_dir_path = 'spec/requests/queries/admin'
71
73
  test_file_path = test_dir_path + "/#{file_name}_spec.rb"
72
74
  FileUtils.mkdir_p(test_dir_path) unless File.exist?(test_dir_path)
73
75
  template 'query_test.haml', test_file_path
@@ -13,7 +13,6 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Create<%= class_name %>, ty
13
13
  GQL
14
14
 
15
15
  expect do
16
- sign_in admin_user
17
16
  post '/api/admin/graphql', headers: admin_user.create_new_auth_token, params: { query: query, variables: variables }
18
17
  expect(response).to have_http_status(:success)
19
18
  json = JSON.parse(response.body)
@@ -8,8 +8,6 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Delete<%= class_name %>, ty
8
8
 
9
9
  describe '.resolve' do
10
10
  it 'should delete' do
11
- admin_user = create(:admin_user)
12
- sign_in admin_user
13
11
 
14
12
  variables = <<~GQL
15
13
  {
@@ -8,7 +8,6 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Update<%= class_name %>, ty
8
8
 
9
9
  describe '.resolve' do
10
10
  it 'should update' do
11
- sign_in admin_user
12
11
 
13
12
  variables = <<~GQL
14
13
  {
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'rails_helper'
4
4
 
5
- RSpec.describe Resolvers::<%= class_name %>, type: :request do
5
+ RSpec.describe Types::Admin::<%= class_name %>Type, type: :request do
6
6
  let(:query) do
7
7
  <<-GRAPHQL
8
8
  query {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlScaffoldFan
4
- VERSION = '0.2.6'
4
+ VERSION = '0.2.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_scaffold_fan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fan Zhang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-02 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql