cypress-on-rails 1.4.0 → 1.4.1

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: c5f09d5e33b22fb99ee869c2872dbcf2deccbe24ead5fb7ef831ea92f86841cf
4
- data.tar.gz: 57ed1bb945c66b17f9363d33f98e126fcfba82004bcc817554be0772a968610b
3
+ metadata.gz: 2ad5c4692223a528962627ffc94284528d76c24cdbcca7ea139c539b0c249a18
4
+ data.tar.gz: 1de6cf1dfb288a59b61c9e4f46522889f96fda4b24941bcdef77eeb90880ff4c
5
5
  SHA512:
6
- metadata.gz: de223cbc75d2e6390639269d7a809a4dd9b6761aba9d2202b2dd06b2c26c83ffc1c1d6b38d362e6cdecca17f6f823b648cf879fceb388ad7a4d48fac04b5e056
7
- data.tar.gz: bc858ab72ca05da05399aa867f4919a7c2cb58dc7070f2272c3a95cd4c500f1649a355223633a66e09925ec3ec2c819c62d434b333eb47cdd80a6b1ad786bcf1
6
+ metadata.gz: '0974c4609d55bd09873faa21f3968e7ce3fc6bb0e7e5807faaaa42dcdae97ac9d7be42464ef9b0711d8f75219b452a5164f936b70e61dd49da9c72c906e0c478'
7
+ data.tar.gz: f5dc0a78f0ada8d1e2ac2b0b0a72c407dbe6ca900908cad6cbc97be22d713917c27db7a9be06e876e4f141a9468c7c2ddd552d8aafb06cf7b5dbbe667627b86c
@@ -21,6 +21,7 @@ cache:
21
21
  before_install:
22
22
  - sudo apt-get -qq update
23
23
  - sudo apt-get install -y build-essential patch ruby-dev zlib1g-dev liblzma-dev libxml2-dev
24
+ - sudo apt-get install -y xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
24
25
 
25
26
  script:
26
27
  - bundle exec rake
@@ -1,27 +1,40 @@
1
- ## 1.4.0
2
- * Accept an options argument for scenarios
1
+ ## [1.4.1]
3
2
 
4
- ### Tasks
5
- * renamed to CypressOnRails
3
+ ### Fixed
4
+ * fix install generator when using npm [PR 22](https://github.com/shakacode/cypress-on-rails/pull/22) by [josephan](https://github.com/josephan).
6
5
 
7
- ## 1.3.0
8
- * send any arguments to simple rails factory, not only hashes
9
6
  ### Tasks
7
+ * Fix typo in authentication docs [PR 29](https://github.com/shakacode/cypress-on-rails/pull/27) by [badimalex](https://github.com/badimalex)
8
+ * Gemspec: Drop EOL'd property rubyforge_project [PR 27](https://github.com/shakacode/cypress-on-rails/pull/27) by [olleolleolle](https://github.com/olleolleolle)
9
+ * Update Travis CI badge in README [PR 31](https://github.com/shakacode/cypress-on-rails/pull/31)
10
+ * Fix CI by Installing cypress dependencies on Travis CI [PR 31](https://github.com/shakacode/cypress-on-rails/pull/31)
11
+
12
+ ## [1.4.0]
13
+ * Accept an options argument for scenarios. [PR 18](https://github.com/shakacode/cypress-on-rails/pull/18) by [ericraio](https://github.com/ericraio).
14
+
15
+ ### Changed
16
+ * renamed CypressDev to CypressOnRails
17
+
18
+ ## [1.3.0]
19
+ ### Added
20
+ * Send any arguments to simple rails factory, not only hashes by [grantspeelman](https://github.com/grantspeelman).
21
+
22
+ ### Improved
10
23
  * stop running cypress examples on CI
11
24
 
12
- ## 1.2.1
25
+ ## [1.2.1]
13
26
  ### Fixed
14
27
  * simple factory fails silently, changed to use create!
15
28
 
16
- ## 1.2.0
29
+ ## [1.2.0]
17
30
  ### Tasks
18
31
  * adding additional log failure logging
19
32
 
20
- ## 1.1.1
33
+ ## [1.1.1]
21
34
  ### Fixed
22
35
  * smart factory wrapper can handle when factory files get deleted
23
36
 
24
- ## 1.1.0
37
+ ## [1.1.0]
25
38
  ### Tasks
26
39
  * add cypress examples to install generator
27
40
  * add active record integration specs
@@ -59,3 +72,12 @@
59
72
 
60
73
  ## 0.1.2 (2017-10-31)
61
74
  * First release.
75
+
76
+ [Unreleased]: https://github.com/shakacode/cypress-on-rails/compare/v1.4.1...master
77
+ [1.4.1]: https://github.com/shakacode/cypress-on-rails/compare/v1.4.0...v1.4.1
78
+ [1.4.0]: https://github.com/shakacode/cypress-on-rails/compare/v1.3.0...v1.4.0
79
+ [1.3.0]: https://github.com/shakacode/cypress-on-rails/compare/v1.2.1...v1.3.0
80
+ [1.2.1]: https://github.com/shakacode/cypress-on-rails/compare/v1.2.0...v1.2.1
81
+ [1.2.0]: https://github.com/shakacode/cypress-on-rails/compare/v1.1.1...v1.2.0
82
+ [1.1.1]: https://github.com/shakacode/cypress-on-rails/compare/v1.1.0...v1.1.1
83
+ [1.1.0]: https://github.com/shakacode/cypress-on-rails/compare/v1.0.0...v1.1.0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CypressOnRails
2
2
 
3
- [![Build Status](https://travis-ci.org/grantspeelman/cypress-on-rails.svg?branch=master)](https://travis-ci.org/grantspeelman/cypress-on-rails)
3
+ [![Build Status](https://travis-ci.com/shakacode/cypress-on-rails.svg?branch=master)](https://travis-ci.org/shakacode/cypress-on-rails) [![Gem Version](https://badge.fury.io/rb/cypress-on-rails.svg)](https://badge.fury.io/rb/cypress-on-rails)
4
4
 
5
5
  Gem for using [cypress.io](http://github.com/cypress-io/) in Rails and ruby rack applications
6
6
  with the goal of controlling State as mentioned in [Cypress Best Practices](https://docs.cypress.io/guides/references/best-practices.html#Organizing-Tests-Logging-In-Controlling-State)
@@ -11,7 +11,6 @@ Gem::Specification.new do |s|
11
11
  s.summary = "Integrates cypress with rails or rack applications"
12
12
  s.description = "Integrates cypress with rails or rack applications"
13
13
  s.post_install_message = 'The CypressDev constant is being deprecated and will be completely removed and replaced with CypressOnRails.'
14
- s.rubyforge_project = s.name
15
14
  s.files = `git ls-files`.split("\n")
16
15
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
17
16
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -0,0 +1,51 @@
1
+ # Example for Authenticating a User
2
+
3
+ in routes.rb
4
+ ```rb
5
+ Rails.application.routes.draw do
6
+ # ...... your other routes
7
+ unless Rails.env.production?
8
+ scope path: "/__cypress__", controller: 'cypress' do
9
+ post "forceLogin", action: 'force_login'
10
+ end
11
+ end
12
+ end
13
+ ```
14
+
15
+ app/controllers/cypress_controller.rb
16
+ ```rb
17
+ class CypressController < ApplicationController
18
+ skip_before_action :verify_authenticity_token
19
+
20
+ def force_login
21
+ if params[:email].present?
22
+ user = User.find_by!(email: params.require(:email))
23
+ else
24
+ user = User.first!
25
+ end
26
+ sign_in(user)
27
+ redirect_to URI.parse(params.require(:redirect_to)).path
28
+ end
29
+ end
30
+ ```
31
+
32
+ in cypress/support/on-rails.js
33
+ ```js
34
+ Cypress.Commands.add("forceLogin", (details) => {
35
+ if(!details)
36
+ details = {}
37
+
38
+ if(!details.redirect_to)
39
+ details.redirect_to = '/'
40
+
41
+ cy.visit("__cypress__/forceLogin",
42
+ { method: "POST", body: { email: details.email, redirect_to: details.redirect_to } })
43
+ });
44
+ ```
45
+
46
+ examples of usage in cypress specs
47
+ ```js
48
+ cy.forceLogin()
49
+ cy.forceLogin({redirect_to: '/profile'})
50
+ cy.forceLogin({email: 'someuser@mail.com'})
51
+ ```
@@ -1,3 +1,3 @@
1
1
  module CypressOnRails
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -14,7 +14,7 @@ module CypressOnRails
14
14
  if options.install_cypress_with == 'yarn'
15
15
  command = "yarn --cwd=#{install_dir} add cypress --dev --silent"
16
16
  elsif options.install_cypress_with == 'npm'
17
- command = "cd #{install_dir}; npm add cypress --save-dev --silent"
17
+ command = "cd #{install_dir}; npm install cypress --save-dev --silent"
18
18
  end
19
19
  if command
20
20
  say command
File without changes
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.0
4
+ version: 1.4.1
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: 2019-06-20 00:00:00.000000000 Z
12
+ date: 2019-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -84,6 +84,7 @@ files:
84
84
  - README.md
85
85
  - Rakefile
86
86
  - cypress-on-rails.gemspec
87
+ - docs/authentication.md
87
88
  - lib/cypress-on-rails.rb
88
89
  - lib/cypress/smart_factory_wrapper.rb
89
90
  - lib/cypress_dev.rb
@@ -216,6 +217,7 @@ files:
216
217
  - spec/integrations/rails_4_2/public/500.html
217
218
  - spec/integrations/rails_4_2/public/favicon.ico
218
219
  - spec/integrations/rails_4_2/public/robots.txt
220
+ - spec/integrations/rails_4_2/spec/.keep
219
221
  - spec/integrations/rails_4_2/test.sh
220
222
  - spec/integrations/rails_4_2/vendor/.keep
221
223
  - spec/integrations/rails_5_2/.gitignore
@@ -299,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
301
  - !ruby/object:Gem::Version
300
302
  version: '0'
301
303
  requirements: []
302
- rubyforge_project: cypress-on-rails
304
+ rubyforge_project:
303
305
  rubygems_version: 2.7.6
304
306
  signing_key:
305
307
  specification_version: 4