pageflow-support 15.1.2 → 15.2.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: ce2c0aaf4361f2210f379214e50b84c88672fd7c
4
- data.tar.gz: 53f9858177255c4a00f0f1fbd348ef1679e1cc81
3
+ metadata.gz: 7dff851c0e864899d86c230a45e7cf87264af49a
4
+ data.tar.gz: '08450dc8956eb095b105fb45b98f6c7d1858ef3b'
5
5
  SHA512:
6
- metadata.gz: b10014ac6da2f26ff1729c661a0e4a28529b8e47108760ed532889739f00b78c039d5f0aaf9cf0ff9a7c733b4945d6c47752b0ee4377a001753c956e6a0c9114
7
- data.tar.gz: 7a87b0af5869cc78d10a93a1e9d0817f85710cf4f3d9356fe0ddf923832ea94001ab42b0522dce15fcd7088ac39ce620246b4dc38f982947dc5eb76d6a011bb0
6
+ metadata.gz: 6387898f647524d61a4435a38625968015d78853660a9d056e196449ff756bcfc8671e944991e5681d273052d31d54d6edd45a863802193dd3199a716f5b1aee
7
+ data.tar.gz: 9496fe2453985763df389938bc4998634cd18b73868a06107956394c0bcd55b1120e0096f2850605e8ea21b07a8441bfcd69aea47032e034eae0c2f39b83a336
@@ -7,6 +7,16 @@ module Pageflow
7
7
  def destroy_button
8
8
  node.find('.destroy')
9
9
  end
10
+
11
+ def input_value(label_text)
12
+ node.find_field(label_text).value
13
+ end
14
+
15
+ def change_input(label_text, value)
16
+ field = node.find_field(label_text)
17
+ field.fill_in(with: value)
18
+ field.native.send_keys(:tab)
19
+ end
10
20
  end
11
21
  end
12
22
  end
@@ -0,0 +1,23 @@
1
+ RSpec.shared_context 'fake translations' do
2
+ around(:example) do |example|
3
+ i18n_backend_backup = I18n.backend
4
+ @fake_i18n_backend = I18n::Backend::Simple.new
5
+
6
+ I18n.backend = @fake_i18n_backend
7
+ example.run
8
+ I18n.backend = i18n_backend_backup
9
+ end
10
+
11
+ def translation(locale, key_path, value)
12
+ keys = key_path.split('.')
13
+ last_key = keys.pop
14
+ data = {}
15
+
16
+ inner = keys.inject(data) do |result, key|
17
+ result[key] = {}
18
+ end
19
+
20
+ inner[last_key] = value
21
+ @fake_i18n_backend.store_translations(locale, data)
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.1.2
4
+ version: 15.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 15.1.2
19
+ version: 15.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 15.1.2
26
+ version: 15.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mysql2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +223,7 @@ files:
223
223
  - pageflow/matchers/have_meta_tag.rb
224
224
  - pageflow/rails_version.rb
225
225
  - pageflow/render_page_test_helper.rb
226
+ - pageflow/shared_contexts/fake_translations.rb
226
227
  - pageflow/support.rb
227
228
  - pageflow/support/config/capybara.rb
228
229
  - pageflow/support/config/paperclip.rb