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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -3
- data/lib/cypress_dev/simple_rails_factory.rb +5 -4
- data/lib/cypress_dev/version.rb +1 -1
- data/spec/cypress_dev/{command_executor/simple_rails_factory_spec.rb → simple_rails_factory_spec.rb} +12 -0
- data/spec/integrations/rails_4_2/test.sh +1 -1
- data/spec/integrations/rails_5_2/Gemfile +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8cd6d039bfcc0993cbf1f1c1888207e07925b743ba955537fcf53dfdbc5f31c
|
4
|
+
data.tar.gz: 4e0512ffff7f8d7a7c96110d562f645b644e49a4c521936d5ce95afec7d6c851
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0aeee57d5b38c12e75dd12028e658b0d67b757c2b439372ed227d4e3255ea89f5845c3d4a3c5c2c1adab832c909e01dac89d3538732a79c7e9aeb7f1f7579f6
|
7
|
+
data.tar.gz: b02576eb3edf7f79af8b4a055acb8360be1f7163843a902aef8d253b59ea1c2797d17111397672b8361165d4dfc8cd896e33e75925cab14a2269e0c86dc7390d
|
data/CHANGELOG.md
CHANGED
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
|
-
|
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/
|
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
|
-
|
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
|
12
|
+
create(type,*params)
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
data/lib/cypress_dev/version.rb
CHANGED
data/spec/cypress_dev/{command_executor/simple_rails_factory_spec.rb → simple_rails_factory_spec.rb}
RENAMED
@@ -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.
|
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:
|
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
|