cypress-on-rails 1.2.1 → 1.3.0

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: 651ff2a2ceeb3e680b7aebb2caa45f08eed82d0c1e19f764acc3b70dab8ff56e
4
- data.tar.gz: dd5036d3fe346f0d3d962c832313534b737cf9a3bfed1c8c52a2c919c8ebe878
3
+ metadata.gz: d8cd6d039bfcc0993cbf1f1c1888207e07925b743ba955537fcf53dfdbc5f31c
4
+ data.tar.gz: 4e0512ffff7f8d7a7c96110d562f645b644e49a4c521936d5ce95afec7d6c851
5
5
  SHA512:
6
- metadata.gz: b0cd309f049d622d06ba0cde5faae638659cbbade3741995f67812b8f449e41be8d90fb6863be1386e53b63c5cb90113d1ac821b93fb6c8a935074d48e7a3843
7
- data.tar.gz: 8b69c6c9623f6670398f8ee0f9363264e66554baff4cc867f3414e24ab74caa5e90b0a26b2f95885f39967e20bcb7032d27e3fb1facb6f86d6c24f04626403f1
6
+ metadata.gz: c0aeee57d5b38c12e75dd12028e658b0d67b757c2b439372ed227d4e3255ea89f5845c3d4a3c5c2c1adab832c909e01dac89d3538732a79c7e9aeb7f1f7579f6
7
+ data.tar.gz: b02576eb3edf7f79af8b4a055acb8360be1f7163843a902aef8d253b59ea1c2797d17111397672b8361165d4dfc8cd896e33e75925cab14a2269e0c86dc7390d
@@ -1,3 +1,7 @@
1
+ * send any arguments to simple rails factory, not only hashes
2
+ ### Tasks
3
+ * stop running cypress examples on CI
4
+
1
5
  ## 1.2.1
2
6
  ### Fixed
3
7
  * simple factory fails silently, changed to use create!
data/README.md CHANGED
@@ -68,15 +68,14 @@ RAILS_ENV=test bin/rake db:create db:schema:load
68
68
  bin/rails server -e test -p 5002
69
69
 
70
70
  # in separate window start cypress
71
- cd spec
72
- yarn run cypress open
71
+ yarn cypress open --project ./spec
73
72
  ```
74
73
 
75
74
  ### Example of using factory bot
76
75
  You can run your [factory_bot](https://github.com/thoughtbot/factory_bot) directly as well
77
76
 
78
77
  ```ruby
79
- # spec/cypress/app_commands/scenarios/basic.rb
78
+ # spec/cypress/app_commands/factory_bot.rb
80
79
  require 'cypress_dev/smart_factory_wrapper'
81
80
 
82
81
  CypressDev::SmartFactoryWrapper.configure(
@@ -2,13 +2,14 @@ require 'active_support/core_ext/string'
2
2
 
3
3
  module CypressDev
4
4
  module SimpleRailsFactory
5
- def self.create(type, params = {})
6
- type.camelize.constantize.create!(params)
5
+ def self.create(type, *params)
6
+ params = [{}] if params.empty?
7
+ type.camelize.constantize.create!(*params)
7
8
  end
8
9
 
9
- def self.create_list(type, amount, params = {})
10
+ def self.create_list(type, amount, *params)
10
11
  amount.to_i.times do
11
- create(type,params)
12
+ create(type,*params)
12
13
  end
13
14
  end
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module CypressDev
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -16,6 +16,18 @@ RSpec.describe CypressDev::SimpleRailsFactory do
16
16
  expect(AppRecord).to have_received(:create!).with( { my_args: 'Hello World' } )
17
17
  end
18
18
 
19
+ it do
20
+ subject.create('AppRecord', 'trait', { my_args: 'Hello World' })
21
+
22
+ expect(AppRecord).to have_received(:create!).with( 'trait', { my_args: 'Hello World' } )
23
+ end
24
+
25
+ it do
26
+ subject.create('AppRecord')
27
+
28
+ expect(AppRecord).to have_received(:create!).with( { } )
29
+ end
30
+
19
31
  it do
20
32
  expect{ subject.create('UnknownRecord', { my_args: 'Hello World' }) }.
21
33
  to raise_error(NameError)
@@ -14,7 +14,7 @@ bundle --version
14
14
  bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2 --path vendor/bundle
15
15
 
16
16
  echo '-- cypress install'
17
- bundle exec ./bin/rails g cypress_dev:install
17
+ bundle exec ./bin/rails g cypress_dev:install --no-install-cypress-examples
18
18
 
19
19
  echo '-- start rails server'
20
20
  # make sure the server is not running
@@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
4
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
5
  gem 'rails', '~> 5.2.0'
6
- gem 'sqlite3'
6
+ gem 'sqlite3', '~> 1.3.6'
7
7
 
8
8
  # Reduces boot times through caching; required in config/boot.rb
9
9
  gem 'bootsnap', '>= 1.1.0', require: false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - miceportal team
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-28 00:00:00.000000000 Z
12
+ date: 2019-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -131,13 +131,13 @@ files:
131
131
  - lib/generators/cypress_dev/templates/spec/cypress/support/index.js
132
132
  - lib/generators/cypress_dev/templates/spec/cypress/support/on-rails.js
133
133
  - spec/cypress_dev/command_executor/cypress_helper.rb
134
- - spec/cypress_dev/command_executor/simple_rails_factory_spec.rb
135
134
  - spec/cypress_dev/command_executor/test_command.rb
136
135
  - spec/cypress_dev/command_executor/test_command_with_options.rb
137
136
  - spec/cypress_dev/command_executor_spec.rb
138
137
  - spec/cypress_dev/configuration_spec.rb
139
138
  - spec/cypress_dev/middleware_spec.rb
140
139
  - spec/cypress_dev/railtie_spec.rb
140
+ - spec/cypress_dev/simple_rails_factory_spec.rb
141
141
  - spec/cypress_dev/smart_factory_wrapper_spec.rb
142
142
  - spec/integrations/cypress.json
143
143
  - spec/integrations/rails_3_2/.gitignore