capybara-angular 0.2.4 → 0.2.5

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
  SHA1:
3
- metadata.gz: ae9e40d2d66826f608bbb389bc7793d000adaf1c
4
- data.tar.gz: 146db77cb3aaa63f1e396d7c2a3407a98d862dfb
3
+ metadata.gz: 693dad6d8c4ff820c47a41b26d0c680179148256
4
+ data.tar.gz: 72e6b43dbe008965532ddc18b864476c37f50d60
5
5
  SHA512:
6
- metadata.gz: 01fd5ba3082598194bedf751132938d1b397108c440c623683f82cf64b0fe1c0295d5129e220429c4a53a0fd23492c66cb3e0e938313d0a794306f338e0ff00f
7
- data.tar.gz: 462f06476e0c76afda3462806cba8ed0ef315d5ec01e3fd7df6370d72195611b71355b60b7ef4ba54cd1bc1a6f971cdcdef09e94f78414fed0283244ab557009
6
+ metadata.gz: a2960689f9869d6a45f269a49d60e8b6d3c42e98740b5e64a14acc029b2bdebe2dea0b5c25e9f2cf311ca5391ea71d500ea14a3364dee66ba311f4c490d3b814
7
+ data.tar.gz: 325b2b29a1741e706cd361bc8235bff5d1cd8f8cf2dd3accbf2c8a43ad83e58fa0968400cec6fb4431862c9d6062b35bd5dbae1ede3f9b166fdec3704256991d
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Angular
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
@@ -47,7 +47,8 @@ module Capybara
47
47
 
48
48
  def setup_ready
49
49
  page.execute_script <<-JS
50
- var el = document.querySelector('body');
50
+ var el = document.querySelector('[ng-app], [data-ng-app]') || document.querySelector('body');
51
+
51
52
  window.angularReady = false;
52
53
 
53
54
  if (angular.getTestability) {
@@ -22,6 +22,11 @@ feature 'Waiting for angular' do
22
22
  timeout_page_should_have_waited
23
23
  end
24
24
 
25
+ scenario 'when using ng-app not on the body tag to bootstrap an application' do
26
+ open_ng_app_not_on_body_bootstrap_page
27
+ timeout_page_should_have_waited
28
+ end
29
+
25
30
  def open_manual_bootstrap_page
26
31
  visit '/manual.html'
27
32
  end
@@ -30,6 +35,10 @@ feature 'Waiting for angular' do
30
35
  visit '/ng-app.html'
31
36
  end
32
37
 
38
+ def open_ng_app_not_on_body_bootstrap_page
39
+ visit '/ng-app-not-on-body.html'
40
+ end
41
+
33
42
  def timeout_page_should_have_waited
34
43
  expect(page).to have_content('waited')
35
44
  end
@@ -0,0 +1,11 @@
1
+ <html>
2
+ <head>
3
+ <script src="/js/angular-1.5.8.js"></script>
4
+ <script src="/js/app.js"></script>
5
+ </head>
6
+ <body>
7
+ <div ng-app="app" ng-controller="waitingController">
8
+ {{text}}
9
+ </div>
10
+ </body>
11
+ </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-angular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Pierzchala
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-21 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -102,6 +102,7 @@ files:
102
102
  - spec/public/js/angular-1.5.8.js
103
103
  - spec/public/js/app.js
104
104
  - spec/public/manual.html
105
+ - spec/public/ng-app-not-on-body.html
105
106
  - spec/public/ng-app.html
106
107
  homepage: ''
107
108
  licenses:
@@ -132,4 +133,5 @@ test_files:
132
133
  - spec/public/js/angular-1.5.8.js
133
134
  - spec/public/js/app.js
134
135
  - spec/public/manual.html
136
+ - spec/public/ng-app-not-on-body.html
135
137
  - spec/public/ng-app.html