File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
spec/integration/rails/generators/graphql Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def create_folder_structure
122
122
if options . api?
123
123
say ( "Skipped graphiql, as this rails project is API only" )
124
124
say ( " You may wish to use GraphiQL.app for development: https://github.com/skevy/graphiql-app" )
125
- elsif !options [ :skip_graphiql ]
125
+ elsif !options [ :skip_graphiql ] && ! File . read ( Rails . root . join ( "Gemfile" ) ) . include? ( "graphiql-rails" )
126
126
gem ( "graphiql-rails" , group : :development )
127
127
128
128
# This is a little cheat just to get cleaner shell output:
Original file line number Diff line number Diff line change @@ -121,6 +121,14 @@ module BaseInterface
121
121
end
122
122
RUBY
123
123
assert_file "app/graphql/types/base_interface.rb" , expected_base_interface
124
+
125
+ # Run it again and make sure the gemfile only contains graphiql-rails once
126
+ FileUtils . cd ( File . join ( destination_root ) ) do
127
+ `rails g graphql:install --relay false`
128
+ end
129
+ assert_file "Gemfile" do |contents |
130
+ assert_equal 1 , contents . scan ( /graphiql-rails/ ) . length
131
+ end
124
132
end
125
133
126
134
test "it allows for a user-specified install directory" do
You can’t perform that action at this time.
0 commit comments