polyblock 0.9.9 → 1.0.0

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
  SHA1:
3
- metadata.gz: 0dbc9eda0536cf7f020fd91e2aa480106995d263
4
- data.tar.gz: 0d8573b3296243a4a17c74b9b56d3450158780ff
3
+ metadata.gz: 0c52d6a21538f4fedba2ce5f5306faf9d04fe87a
4
+ data.tar.gz: 57a354f14abc7f4a4ffe6152f6154f853fc2d294
5
5
  SHA512:
6
- metadata.gz: ac156e689cff5b6b14085c972ab1c9c03c44cd2fe5d94894fc1bf90467c4a86c01e0f206a42451e5ea5c6a2d875969f9cd3367cba0ec3f37268bc6cf56c3b27a
7
- data.tar.gz: f33025823d296e7cfb1eb117808cbee7bfb4546f437ccc88ff3b45ec09b3b3695467c228661f111c95275ed43ae0a9e06e5b0ca3d0a381292bdd6ef96db53c59
6
+ metadata.gz: 9dcd10e0cd6f0f897efef78204af39d4ed72a9b0fc7667221739324c99ba99cf8772251054fcf4da8c628b39f9525737e1700e3ac7d33e77d07a0daf3e80452a
7
+ data.tar.gz: 27cbd5e2df0eacf940fc02044e98a0cdf6dc8144734d63aabd0b3d83a614f9744291ffaac49dc5f77b2ba20bb007b9132d3adefbeceb3b401770c4b919745b71
@@ -2,13 +2,22 @@ module Polyblock
2
2
  module CapybaraHelpers
3
3
  def fill_in_polyblock(locator, params={})
4
4
  # Find out ckeditor id at runtime using its label
5
- locator = find('label', text: locator)[:for] if page.has_css?('label', text: locator)
5
+ # if page.has_css? "##{locator}"
6
+ if page.evaluate_script("$('##{locator}').is('*')")
7
+ # elsif page.has_css? 'label', text: locator
8
+ elsif page.evaluate_script("$(\"label:contains('#{locator}')\").is('*')")
9
+ locator = find('label', text: locator)[:for]
10
+ else
11
+ raise "Locator #{locator} not found!!"
12
+ end
6
13
  # Fill the editor content
7
14
  page.execute_script <<-SCRIPT
8
15
  var ckeditor = CKEDITOR.instances['#{locator}'];
9
16
  ckeditor.setData('#{params[:with]}');
10
17
  ckeditor.focus();
11
- ckeditor.updateElement();
18
+ setTimeout(function(){
19
+ ckeditor.updateElement();
20
+ }, 1);
12
21
  SCRIPT
13
22
  end
14
23
 
@@ -1,3 +1,3 @@
1
1
  module Polyblock
2
- VERSION = "0.9.9"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails