transactional_capybara 0.1.0.pre.1 → 0.1.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,9 +10,12 @@ module TransactionalCapybara
10
10
  end
11
11
 
12
12
  def finished_all_ajax_requests?
13
- capybara_sessions.all? do |session|
14
- puts session.inspect
15
- PageWaiting.new(session).finished_ajax_requests?
13
+ capybara_sessions.all? do |name, session|
14
+ if is_session_touched?(session)
15
+ PageWaiting.new(session).finished_ajax_requests?
16
+ else
17
+ true
18
+ end
16
19
  end
17
20
  end
18
21
 
@@ -31,11 +34,18 @@ module TransactionalCapybara
31
34
  end
32
35
  end
33
36
 
37
+ private
38
+
39
+ # Hack into Capybara's private interface to get access to all sessions
34
40
  def capybara_sessions
35
41
  Capybara.send :session_pool
36
42
  end
37
43
 
38
- private
44
+ # Another hack, to see if Capybara sessions have been used
45
+ def is_session_touched?(session)
46
+ session.instance_variable_get(:@touched)
47
+ end
48
+
39
49
  def run_js(expr)
40
50
  @page.execute_script(expr)
41
51
  end
@@ -1,3 +1,3 @@
1
1
  module TransactionalCapybara
2
- VERSION = "0.1.0.pre.1"
2
+ VERSION = "0.1.0.pre.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transactional_capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.1
4
+ version: 0.1.0.pre.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: