cypress-rails 0.5.0 → 0.5.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: 562fe8191d39ef805cb9f6ff8cc82f7c1329acc61332425bd23a6c6ff1ccccd2
4
- data.tar.gz: 267ac2d8ef9c9969205798acbe5239d398eb35ba93a2a45bedaa18fba8056a60
3
+ metadata.gz: a89d2ae87c67c2df6c45dd8e3642a9ca52b0f3a88b29b4d7e7569dc22579ff76
4
+ data.tar.gz: 94d308d83c47086800430e3c8954e068637575f7c4d9e3f4327b1f325600c8dd
5
5
  SHA512:
6
- metadata.gz: 9b8b12ab6e9f8f565afd72dfc345d717fb8b957ebe6ca4e73f883d9a2f4278eef4ae89335b85e305065114bedbe797e4ba2fb5cdb5b4457ccd93ea9b245f7a51
7
- data.tar.gz: 90945b95efc3e0d58651af35d1a13a7740eea905103aa4b8263af380c789f6f0c8a605f58542d8077e26639136ca9f5f0e44ca915b216c8decabd4f2c8e20999
6
+ metadata.gz: b3630cfd6de6541c551163a34c6e513865743b3733a603a492a4328efd5a827d68925757eba5c0de3d7b095b7597f357f653a52e5040542e8e6c979c869805db
7
+ data.tar.gz: 0f80be8f0c63d8de21917913b02d83a59d6a436da223c9838b1a0421ca3317bbd5d71289fa60f5021e69d94167453c6b015d4469b61c209e05464449e1bb4034
@@ -0,0 +1,21 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request, workflow_dispatch]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby-version: ['2.7', '3.0']
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby-version }}
18
+ bundler-cache: true
19
+
20
+ - name: Run tests
21
+ run: ./script/test
data/.standard.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ignore:
2
2
  - 'vendor/bundle/**/*'
3
- - 'example/an_app/node_modules/**/*'
4
- - 'example/an_app/vendor/bundle/**/*'
3
+ - 'example/node_modules/**/*'
4
+ - 'example/vendor/bundle/**/*'
data/CHANGELOG.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.5.1
4
+
5
+ * Sprinkles two instance variables to the custom transaction manager that cribs
6
+ its implementation from ActiveRecord::TestFixtures (see f75f280)
7
+ [#88](https://github.com/testdouble/cypress-rails/issues/88)
8
+ [#89](https://github.com/testdouble/cypress-rails/pull/89)
9
+
3
10
  ## 0.5.0
4
11
 
5
- * Add hook `before_server_start`
12
+ * Add hook `after_server_start`
6
13
  [#63](https://github.com/testdouble/cypress-rails/pull/63)
7
14
  * Fix namespace bug
8
15
  [#64](https://github.com/testdouble/cypress-rails/pull/64)
data/Gemfile.lock CHANGED
@@ -1,53 +1,53 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cypress-rails (0.5.0)
4
+ cypress-rails (0.5.1)
5
5
  puma (>= 3.8.0)
6
6
  railties (>= 5.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (6.1.3.1)
12
- actionview (= 6.1.3.1)
13
- activesupport (= 6.1.3.1)
11
+ actionpack (6.1.4)
12
+ actionview (= 6.1.4)
13
+ activesupport (= 6.1.4)
14
14
  rack (~> 2.0, >= 2.0.9)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.3.1)
19
- activesupport (= 6.1.3.1)
18
+ actionview (6.1.4)
19
+ activesupport (= 6.1.4)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (6.1.3.1)
24
+ activesupport (6.1.4)
25
25
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
26
  i18n (>= 1.6, < 2)
27
27
  minitest (>= 5.1)
28
28
  tzinfo (~> 2.0)
29
29
  zeitwerk (~> 2.3)
30
- ast (2.4.1)
30
+ ast (2.4.2)
31
31
  builder (3.2.4)
32
- concurrent-ruby (1.1.8)
32
+ concurrent-ruby (1.1.9)
33
33
  crass (1.0.6)
34
34
  erubi (1.10.0)
35
35
  i18n (1.8.10)
36
36
  concurrent-ruby (~> 1.0)
37
- loofah (2.9.0)
37
+ loofah (2.10.0)
38
38
  crass (~> 1.0.2)
39
39
  nokogiri (>= 1.5.9)
40
40
  method_source (1.0.0)
41
- mini_portile2 (2.5.0)
42
- minitest (5.14.2)
41
+ mini_portile2 (2.5.3)
42
+ minitest (5.14.4)
43
43
  nio4r (2.5.7)
44
- nokogiri (1.11.2)
44
+ nokogiri (1.11.7)
45
45
  mini_portile2 (~> 2.5.0)
46
46
  racc (~> 1.4)
47
47
  parallel (1.20.1)
48
- parser (2.7.2.0)
48
+ parser (3.0.1.1)
49
49
  ast (~> 2.4.1)
50
- puma (5.2.2)
50
+ puma (5.3.2)
51
51
  nio4r (~> 2.0)
52
52
  racc (1.5.2)
53
53
  rack (2.2.3)
@@ -58,38 +58,38 @@ GEM
58
58
  nokogiri (>= 1.6)
59
59
  rails-html-sanitizer (1.3.0)
60
60
  loofah (~> 2.3)
61
- railties (6.1.3.1)
62
- actionpack (= 6.1.3.1)
63
- activesupport (= 6.1.3.1)
61
+ railties (6.1.4)
62
+ actionpack (= 6.1.4)
63
+ activesupport (= 6.1.4)
64
64
  method_source
65
- rake (>= 0.8.7)
65
+ rake (>= 0.13)
66
66
  thor (~> 1.0)
67
67
  rainbow (3.0.0)
68
- rake (13.0.1)
69
- regexp_parser (2.0.0)
70
- rexml (3.2.4)
71
- rubocop (1.4.2)
68
+ rake (13.0.4)
69
+ regexp_parser (2.1.1)
70
+ rexml (3.2.5)
71
+ rubocop (1.18.2)
72
72
  parallel (~> 1.10)
73
- parser (>= 2.7.1.5)
73
+ parser (>= 3.0.0.0)
74
74
  rainbow (>= 2.2.2, < 4.0)
75
- regexp_parser (>= 1.8)
75
+ regexp_parser (>= 1.8, < 3.0)
76
76
  rexml
77
- rubocop-ast (>= 1.1.1)
77
+ rubocop-ast (>= 1.7.0, < 2.0)
78
78
  ruby-progressbar (~> 1.7)
79
- unicode-display_width (>= 1.4.0, < 2.0)
80
- rubocop-ast (1.3.0)
81
- parser (>= 2.7.1.5)
82
- rubocop-performance (1.9.1)
83
- rubocop (>= 0.90.0, < 2.0)
79
+ unicode-display_width (>= 1.4.0, < 3.0)
80
+ rubocop-ast (1.7.0)
81
+ parser (>= 3.0.1.1)
82
+ rubocop-performance (1.11.3)
83
+ rubocop (>= 1.7.0, < 2.0)
84
84
  rubocop-ast (>= 0.4.0)
85
- ruby-progressbar (1.10.1)
86
- standard (0.10.2)
87
- rubocop (= 1.4.2)
88
- rubocop-performance (= 1.9.1)
85
+ ruby-progressbar (1.11.0)
86
+ standard (1.1.4)
87
+ rubocop (= 1.18.2)
88
+ rubocop-performance (= 1.11.3)
89
89
  thor (1.1.0)
90
90
  tzinfo (2.0.4)
91
91
  concurrent-ruby (~> 1.0)
92
- unicode-display_width (1.7.0)
92
+ unicode-display_width (2.0.0)
93
93
  zeitwerk (2.4.2)
94
94
 
95
95
  PLATFORMS
@@ -103,4 +103,4 @@ DEPENDENCIES
103
103
  standard (>= 0.2.0)
104
104
 
105
105
  BUNDLED WITH
106
- 2.2.3
106
+ 2.2.15
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cypress-rails
2
2
 
3
- [![CircleCI](https://circleci.com/gh/testdouble/cypress-rails/tree/master.svg?style=svg)](https://circleci.com/gh/testdouble/cypress-rails/tree/master)
3
+ [![CircleCI](https://circleci.com/gh/testdouble/cypress-rails/tree/main.svg?style=svg)](https://circleci.com/gh/testdouble/cypress-rails/tree/main)
4
4
 
5
5
  This is a simple gem to make it easier to start writing browser tests with
6
6
  [Cypress](http://cypress.io) for your [Rails](https://rubyonrails.org) apps,
@@ -120,7 +120,7 @@ end
120
120
 
121
121
  (You can find [an
122
122
  example
123
- initializer](/example/an_app/config/initializers/cypress_rails_initializer.rb)
123
+ initializer](/example/config/initializers/cypress_rails_initializer.rb)
124
124
  in this repo.)
125
125
 
126
126
  The gem also provides a special route on the test server:
@@ -170,7 +170,7 @@ preferred environment variables project-wide using a tool like
170
170
  general this means anything done during `cypress open` or `cypress run` will
171
171
  be rolled back on exit (similar to running a Rails System test)
172
172
  * **CYPRESS_RAILS_CYPRESS_OPTS** (default: _none_) any options you want to
173
- forward to the Cypress CLI when running its `open` or `run` commands.
173
+ forward to the Cypress CLI when running its `open` or `run` commands.
174
174
 
175
175
  #### Example: Running a single spec from the command line
176
176
 
@@ -228,7 +228,7 @@ of your test database. To set up the hook, pass a block to
228
228
  ## Configuring Rails
229
229
 
230
230
  Beyond the configuration options above, you'll probably also want to disable caching
231
- in your Rails app's [config/environments/test.rb](/example/an_app/config/environments/test.rb#L9)
231
+ in your Rails app's [config/environments/test.rb](/example/config/environments/test.rb#L9)
232
232
  file, so that changes to your Ruby code are reflected in your tests while you
233
233
  work on them with `rake cypress:open`. (If either option is set to
234
234
  `true`, any changes to your Ruby code will require a server restart to be reflected as you work
@@ -4,11 +4,8 @@ module CypressRails
4
4
  return default unless ENV.key?(name)
5
5
 
6
6
  if type == :boolean
7
- if ["", "0", "n", "no", "false"].include?(ENV.fetch(name))
8
- false
9
- else
10
- true
11
- end
7
+ no_like_flag = ["", "0", "n", "no", "false"].include?(ENV.fetch(name))
8
+ !no_like_flag
12
9
  else
13
10
  ENV.fetch(name)
14
11
  end
@@ -24,7 +24,7 @@ module CypressRails
24
24
  end
25
25
 
26
26
  def merge_existing_with_defaults(json_path)
27
- Hash[JSON.parse(File.read(json_path)).merge(DEFAULT_CONFIG).sort]
27
+ JSON.parse(File.read(json_path)).merge(DEFAULT_CONFIG).sort.to_h
28
28
  end
29
29
  end
30
30
  end
@@ -68,7 +68,10 @@ module CypressRails
68
68
  # need to share a connection pool so that the reading connection
69
69
  # can see data in the open transaction on the writing connection.
70
70
  def setup_shared_connection_pool
71
- ActiveRecord::TestFixtures.instance_method(:setup_shared_connection_pool).bind(self).call
71
+ @legacy_saved_pool_configs ||= Hash.new { |hash, key| hash[key] = {} }
72
+ @saved_pool_configs ||= Hash.new { |hash, key| hash[key] = {} }
73
+
74
+ ActiveRecord::TestFixtures.instance_method(:setup_shared_connection_pool).bind_call(self)
72
75
  end
73
76
  end
74
77
  end
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
data/script/test ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+
3
+ PS4='[script/test:${LINENO}] $ '
4
+ set -euo pipefail
5
+ set -x
6
+
7
+ echo "---> Installing dependencies"
8
+ bundle
9
+ cd example
10
+ bundle
11
+ yarn
12
+ cd ..
13
+
14
+ echo "---> Running tests"
15
+ bundle exec rake
16
+ ./script/test_example_app
17
+
18
+ echo "---> Job's done!"
19
+
@@ -4,7 +4,7 @@ set -e
4
4
 
5
5
  directory=$1
6
6
 
7
- cd example/an_app
7
+ cd example
8
8
  bundle
9
9
  yarn install
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-31 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -102,7 +102,7 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - ".circleci/config.yml"
105
+ - ".github/workflows/main.yml"
106
106
  - ".gitignore"
107
107
  - ".standard.yml"
108
108
  - ".travis.yml"
@@ -137,6 +137,7 @@ files:
137
137
  - lib/cypress-rails/starts_rails_server.rb
138
138
  - lib/cypress-rails/tracks_resets.rb
139
139
  - lib/cypress-rails/version.rb
140
+ - script/test
140
141
  - script/test_example_app
141
142
  homepage: https://github.com/testdouble/cypress-rails
142
143
  licenses:
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  - !ruby/object:Gem::Version
158
159
  version: '0'
159
160
  requirements: []
160
- rubygems_version: 3.2.3
161
+ rubygems_version: 3.2.15
161
162
  signing_key:
162
163
  specification_version: 4
163
164
  summary: Helps you write Cypress tests of your Rails app
data/.circleci/config.yml DELETED
@@ -1,53 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- docker:
5
- - image: circleci/ruby:2.6-node-browsers
6
- steps:
7
- - checkout
8
-
9
- # Bundle install dependencies
10
- - type: cache-restore
11
- key: v1-main-{{ checksum "Gemfile.lock" }}
12
-
13
- - run: gem install bundler --version `tail -1 Gemfile.lock`
14
- - run: bundle install --path vendor/bundle
15
-
16
- - type: cache-save
17
- key: v1-main-{{ checksum "Gemfile.lock" }}
18
- paths:
19
- - vendor/bundle
20
-
21
- # Bundle install dependencies for example app
22
- - type: cache-restore
23
- key: v1-example-{{ checksum "example/an_app/Gemfile.lock" }}
24
-
25
- - run: |
26
- cd example/an_app
27
- bundle install --path vendor/bundle
28
-
29
- - type: cache-save
30
- key: v1-example-{{ checksum "example/an_app/Gemfile.lock" }}
31
- paths:
32
- - example/an_app/vendor/bundle
33
-
34
- # Yarn dependencies
35
- - restore_cache:
36
- keys:
37
- - v4-yarn-{{ checksum "example/an_app/yarn.lock" }}
38
- # fallback to using the latest cache if no exact match is found
39
- - v4-yarn-
40
-
41
- - run: |
42
- cd example/an_app
43
- yarn install
44
-
45
- - save_cache:
46
- paths:
47
- - example/an_app/node_modules
48
- - ~/.cache
49
- key: v4-yarn-{{ checksum "example/an_app/yarn.lock" }}
50
-
51
- - run: bundle exec rake
52
- - run: ./script/test_example_app
53
-