daddy 0.5.8 → 0.5.9

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: fd84ec760040befe54cf03451b5600897a7d2f34
4
- data.tar.gz: 08c50e66fe1fc69b0bdb4662b27609809260f692
3
+ metadata.gz: ea48edcfc25dedcd96397530b2a15e6483e322be
4
+ data.tar.gz: 06b2167055540fb56803bb1b44b06479c4b27a01
5
5
  SHA512:
6
- metadata.gz: 8d384d34b6969e022ac99ad7cc1d21ff5cc0bc871b5347faac7a1edff9e5402fb1f0c30d70013dd9ae8c6254ef6f25cb26cedbd81a57ac4fa06e6d3aed0e44d6
7
- data.tar.gz: 8a9e3bd7ffd799ee856cfda176b229a97795604a57586047be96b604a2bcc4bb182c87c3b2795cc7b53e152a9a2e548daff116cda38906660c8bd96e577c0438
6
+ metadata.gz: 80b81ec1affa34f9083925d131df8f9f23032df69ad040321ea54cffef4e2eba68659d1d021a4f852c564af05891b8d3866801dcd9fdc6e214b0ca4887a67b67
7
+ data.tar.gz: cfb01067dbe44185dce6f2bb83831e5781e7e98e5547a5981fdc1cf89fb7faa75ffe077630f4f8582ba0f86ff0520395f4be35e6ca5cb2a2c5b831ebdfd897d7
@@ -4,11 +4,11 @@ module Daddy
4
4
  def assert_url(path, params = {})
5
5
  # スクリーンショットの保存
6
6
  capture
7
-
7
+
8
8
  # パスのチェック
9
9
  re = path.gsub(/\//, '\/')
10
- assert /#{re}/ =~ current_path, "想定しているパスではありません。想定 #{path} : 実際 #{current_path}"
11
-
10
+ assert has_current_path?(/#{re}/), "想定しているパスではありません。想定 #{path} : 実際 #{current_path}"
11
+
12
12
  # パラメータのチェック
13
13
  current_params = get_current_params()
14
14
  params.each do |key, value|
@@ -16,7 +16,7 @@ module Daddy
16
16
  assert /#{re}/ =~ current_params[key], "#{key}が想定している値ではありません。想定 #{value} : 実際 #{current_params[key]}"
17
17
  end
18
18
  end
19
-
19
+
20
20
  def assert_visit(path, params = {})
21
21
  query_string = ''
22
22
  params.each do |key, value|
@@ -27,68 +27,68 @@ module Daddy
27
27
  end
28
28
  query_string += (key.to_s + '=' + value.to_s)
29
29
  end
30
-
30
+
31
31
  visit path + query_string
32
32
  assert_url path, params
33
33
  end
34
-
34
+
35
35
  def assert_fill_in(field_name, value)
36
36
  fill_in field_name, :with => value
37
37
  capture
38
38
  end
39
-
39
+
40
40
  def assert_check(field_name)
41
41
  check field_name
42
42
  capture
43
43
  end
44
-
44
+
45
45
  def assert_uncheck(field_name)
46
46
  uncheck field_name
47
47
  capture
48
48
  end
49
-
49
+
50
50
  def assert_choose(field_name)
51
51
  choose field_name
52
52
  capture
53
53
  end
54
-
54
+
55
55
  def assert_select(name, value)
56
56
  select value, :from => name
57
57
  capture
58
58
  end
59
-
59
+
60
60
  def assert_selector(selector, options = {})
61
61
  assert page.has_selector?(selector), options[:message]
62
62
  capture if options[:capture]
63
63
  end
64
-
64
+
65
65
  def assert_no_selector(selector, options = {})
66
66
  assert page.has_no_selector?(selector), options[:message]
67
67
  capture if options[:capture]
68
68
  end
69
-
69
+
70
70
  def assert_present(value, message = nil)
71
71
  assert value.present?, message
72
72
  end
73
-
73
+
74
74
  def assert_not_present(value, message = nil)
75
75
  assert ! value.present?, message
76
76
  end
77
-
77
+
78
78
  def assert_content_type(content_type)
79
79
  assert_equal content_type, page.response_headers['Content-Type']
80
80
  end
81
-
81
+
82
82
  def assert_iterate(array)
83
83
  iterated = false
84
-
84
+
85
85
  array.each do |x|
86
86
  iterated ||= yield x
87
87
  end
88
-
88
+
89
89
  fail 'テスト対象のデータがありません。' unless iterated
90
90
  end
91
-
91
+
92
92
  def get_current_params
93
93
  ret = {}
94
94
  if current_url.include?('?')
data/lib/daddy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Daddy
2
- VERSION = '0.5.8'
2
+ VERSION = '0.5.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara