cucumber-rails 0.3.0 → 0.3.1
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.
- data/HACKING.rdoc +7 -17
- data/History.txt +30 -0
- data/README.rdoc +16 -10
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/cucumber-rails.gemspec +12 -10
- data/features/rails2.feature +51 -8
- data/features/rails3.feature +55 -14
- data/features/rerun_profile.feature +38 -0
- data/features/step_definitions/cucumber_rails_steps.rb +23 -0
- data/lib/cucumber/rails/capybara_javascript_emulation.rb +2 -2
- data/lib/cucumber/rails/rspec.rb +3 -5
- data/lib/cucumber/rails/test_unit.rb +4 -6
- data/lib/cucumber/rails/world.rb +1 -1
- data/lib/cucumber/web/tableish.rb +50 -9
- data/lib/generators/cucumber/skeleton/skeleton_base.rb +4 -4
- data/rvm.yml +2 -2
- data/spec/cucumber/web/tableish_spec.rb +36 -6
- data/templates/feature/feature.erb +10 -12
- data/templates/feature/steps.erb +1 -1
- data/templates/skeleton/config/cucumber.yml.erb +4 -3
- data/templates/skeleton/environments/cucumber.rb.erb +1 -1
- data/templates/skeleton/step_definitions/capybara_steps.rb.erb +40 -23
- data/templates/skeleton/step_definitions/web_steps_de.rb.erb +33 -33
- data/templates/skeleton/step_definitions/web_steps_ja.rb.erb +139 -0
- data/templates/skeleton/step_definitions/web_steps_ko.rb.erb +141 -0
- data/templates/skeleton/step_definitions/webrat_steps.rb.erb +36 -28
- data/templates/skeleton/support/{_rails_each_run.rb → _rails_each_run.rb.erb} +2 -1
- data/templates/skeleton/support/_rails_prefork.rb.erb +2 -0
- data/templates/skeleton/support/paths.rb +10 -4
- data/templates/skeleton/support/rails.rb.erb +1 -1
- data/templates/skeleton/support/rails_spork.rb.erb +1 -1
- data/templates/skeleton/tasks/cucumber.rake.erb +6 -0
- metadata +11 -9
- data/generators/cucumber/templates/step_definitions/web_steps_ja.rb.erb +0 -136
@@ -3,134 +3,134 @@
|
|
3
3
|
|
4
4
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
5
|
|
6
|
-
|
6
|
+
Angenommen /^(?:|ich )bin auf (.+)$/ do |page_name|
|
7
7
|
Given %{I am on #{page_name}}
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
Wenn /^(?:|ich )auf (.+) gehe$/ do |page_name|
|
11
11
|
When %{I go to #{page_name}}
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
Wenn /^(?:|ich )auf "([^\"]*)" drücke$/ do |button|
|
15
15
|
When %{I press "#{button}"}
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
Wenn /^(?:|ich )auf "([^\"]*)" klicke$/ do |link|
|
19
19
|
When %{I follow "#{link}"}
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
Wenn /^(?:|ich )auf "([^\"]*)" innerhalb "([^\"]*)" klicke$/ do |link, parent|
|
23
23
|
When %{I follow "#{link}" within "#{parent}"}
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
Wenn /^(?:|ich )"([^\"]*)" mit "([^\"]*)" ausfülle$/ do |field, value|
|
27
27
|
When %{I fill in "#{field}" with "#{value}"}
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
Wenn /^(?:|ich )"([^\"]*)" in "([^\"]*)" eingebe$/ do |value, field|
|
31
31
|
When %{I fill in "#{value}" for "#{field}"}
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
Wenn /^(?:|ich )folgendes eingebe:$/ do |fields|
|
35
35
|
When %{I fill in the following:}, fields
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
Wenn /^(?:|ich )"([^\"]*)" in "([^\"]*)" auswähle$/ do |value, field|
|
39
39
|
When %{I select "#{value}" from "#{field}"}
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
Wenn /^(?:|ich )"([^\"]*)" als Datum und Uhrzeit auswähle$/ do |time|
|
43
43
|
When %{I select "#{time}" as the date and time}
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
Wenn /^(?:|ich )"([^\"]*)" als "([^\"]*)" Datum und Uhrzeit auswähle$/ do |datetime, datetime_label|
|
47
47
|
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
Wenn /^(?:|ich )"([^\"]*)" als Uhrzeit auswähle$/ do |time|
|
51
51
|
When %{I select "#{time}" as the time}
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
Wenn /^(?:|ich )"([^\"]*)" als "([^\"]*)" Uhrzeit auswähle$/ do |time, time_label|
|
55
55
|
When %{I select "#{time}" as the "#{time_label}" time}
|
56
56
|
end
|
57
57
|
|
58
|
-
|
58
|
+
Wenn /^(?:|ich )"([^\"]*)" als Datum auswähle$/ do |date|
|
59
59
|
When %{I select "#{date}" as the date}
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
Wenn /^(?:|ich )"([^\"]*)" als "([^\"]*)" Datum auswähle$/ do |date, date_label|
|
63
63
|
When %{I select "#{date}" as the "#{date_label}" date}
|
64
64
|
end
|
65
65
|
|
66
|
-
|
66
|
+
Wenn /^(?:|ich )"([^\"]*)" anhake$/ do |field|
|
67
67
|
When %{I check "#{field}"}
|
68
68
|
end
|
69
69
|
|
70
|
-
|
70
|
+
Wenn /^(?:|ich )"([^\"]*)" abhake$/ do |field|
|
71
71
|
When %{I uncheck "#{field}"}
|
72
72
|
end
|
73
73
|
|
74
|
-
|
74
|
+
Wenn /^(?:|ich )"([^\"]*)" auswähle$/ do |field|
|
75
75
|
When %{I choose "#{field}"}
|
76
76
|
end
|
77
77
|
|
78
|
-
|
78
|
+
Wenn /^(?:|ich )die Datei "([^\"]*)" als "([^\"]*)" anhänge$/ do |path, field|
|
79
79
|
When %{I attach the file "#{path}" to "#{field}"}
|
80
80
|
end
|
81
81
|
|
82
|
-
|
82
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)"([^\"]*)" sehen$/ do |text|
|
83
83
|
Then %{I should see "#{text}"}
|
84
84
|
end
|
85
85
|
|
86
|
-
|
86
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)"([^\"]*)" innerhalb "([^\"]*)" sehen$/ do |text, selector|
|
87
87
|
Then %{I should see "#{text}" within "#{selector}"}
|
88
88
|
end
|
89
89
|
|
90
|
-
|
90
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)\/([^\/]*)\/ sehen$/ do |regexp|
|
91
91
|
Then %{I should see /#{regexp}/}
|
92
92
|
end
|
93
93
|
|
94
|
-
|
94
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)\/([^\/]*)\/ innerhalb "([^\"]*)" sehen$/ do |regexp, selector|
|
95
95
|
Then %{I should see /#{regexp}/ within "#{selector}"}
|
96
96
|
end
|
97
97
|
|
98
|
-
|
98
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht "([^\"]*)" sehen$/ do |text|
|
99
99
|
Then %{I should not see "#{text}"}
|
100
100
|
end
|
101
101
|
|
102
|
-
|
102
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht "([^\"]*)" innerhalb "([^\"]*)" sehen$/ do |text, selector|
|
103
103
|
Then %{I should not see "#{text}" within "#{selector}"}
|
104
104
|
end
|
105
105
|
|
106
|
-
|
106
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht \/([^\/]*)\/ sehen$/ do |regexp|
|
107
107
|
Then %{I should not see /#{regexp}/}
|
108
108
|
end
|
109
109
|
|
110
|
-
|
110
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht \/([^\/]*)\/ innerhalb "([^\"]*)" sehen$/ do |regexp, selector|
|
111
111
|
Then %{I should not see /#{regexp}/ within "#{selector}"}
|
112
112
|
end
|
113
113
|
|
114
|
-
|
114
|
+
Dann /^sollte das "([^\"]*)" Feld "([^\"]*)" enthalten$/ do |field, value|
|
115
115
|
Then %{the "#{field}" field should contain "#{value}"}
|
116
116
|
end
|
117
117
|
|
118
|
-
|
118
|
+
Dann /^sollte das "([^\"]*)" Feld nicht "([^\"]*)" enthalten$/ do |field, value|
|
119
119
|
Then %{the "#{field}" field should not contain "#{value}"}
|
120
120
|
end
|
121
121
|
|
122
|
-
|
122
|
+
Dann /^sollte die "([^\"]*)" Checkbox angehakt sein$/ do |label|
|
123
123
|
Then %{the "#{label}" checkbox should be checked}
|
124
124
|
end
|
125
125
|
|
126
|
-
|
126
|
+
Dann /^sollte die "([^\"]*)" Checkbox nicht angehakt sein$/ do |label|
|
127
127
|
Then %{the "#{label}" checkbox should not be checked}
|
128
128
|
end
|
129
129
|
|
130
|
-
|
130
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)auf (.+) sein$/ do |page_name|
|
131
131
|
Then %{I should be on #{page_name}}
|
132
132
|
end
|
133
133
|
|
134
|
-
|
134
|
+
Dann /^zeig mir die Seite$/ do
|
135
135
|
Then %{show me the page}
|
136
136
|
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/edit_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
|
6
|
+
前提 /^"([^\"]*)"ページを表示している$/ do |page_name|
|
7
|
+
Given %{I am on #{page_name}}
|
8
|
+
end
|
9
|
+
|
10
|
+
もし /^"([^\"]*)"ページを表示する$/ do |page_name|
|
11
|
+
When %{I go to #{page_name}}
|
12
|
+
end
|
13
|
+
|
14
|
+
もし /^"([^\"]*)"ボタンをクリックする$/ do |button|
|
15
|
+
When %{I press "#{button}"}
|
16
|
+
end
|
17
|
+
|
18
|
+
もし /^"([^\"]*)"リンクをクリックする$/ do |link|
|
19
|
+
When %{I follow "#{link}"}
|
20
|
+
end
|
21
|
+
|
22
|
+
もし /^"([^\"]*)"の"([^\"]*)"リンクをクリックする$/ do |parent, link|
|
23
|
+
When %{I follow "#{link}" within "#{parent}"}
|
24
|
+
end
|
25
|
+
|
26
|
+
もし /^"([^\"]*)"に"([^\"]*)"と入力する$/ do |field, value|
|
27
|
+
When %{I fill in "#{field}" with "#{value}"}
|
28
|
+
end
|
29
|
+
|
30
|
+
# less difference to %{I fill in "#{value}" for "#{field}"} with above in Japanese.
|
31
|
+
|
32
|
+
もし /^以下の項目を入力する:$/ do |fields|
|
33
|
+
When %{I fill in the following:}, fields
|
34
|
+
end
|
35
|
+
|
36
|
+
もし /^"([^\"]*)"から"([^\"]*)"を選択する$/ do |field, value|
|
37
|
+
When %{I select "#{value}" from "#{field}"}
|
38
|
+
end
|
39
|
+
|
40
|
+
もし /^日時として"([^\"]*)"を選択する$/ do |time|
|
41
|
+
When %{I select "#{time}" as the date and time}
|
42
|
+
end
|
43
|
+
|
44
|
+
もし /^"([^\"]*)"の日時として"([^\"]*)"を選択する$/ do |datetime_label, datetime|
|
45
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
46
|
+
end
|
47
|
+
|
48
|
+
もし /^時間として"([^\"]*)"を選択する$/ do |time|
|
49
|
+
When %{I select "#{time}" as the time}
|
50
|
+
end
|
51
|
+
|
52
|
+
もし /^"([^\"]*)"の時間として"([^\"]*)"を選択する$/ do |time_label, time|
|
53
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
54
|
+
end
|
55
|
+
|
56
|
+
もし /^日付として"([^\"]*)"を選択する$/ do |date|
|
57
|
+
When %{I select "#{date}" as the date}
|
58
|
+
end
|
59
|
+
|
60
|
+
もし /^"([^\"]*)"の日付として"([^\"]*)"を選択する$/ do |date_label, date|
|
61
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
62
|
+
end
|
63
|
+
|
64
|
+
もし /^"([^\"]*)"をチェックする$/ do |field|
|
65
|
+
When %{I check "#{field}"}
|
66
|
+
end
|
67
|
+
|
68
|
+
もし /^"([^\"]*)"のチェックを外す$/ do |field|
|
69
|
+
When %{I uncheck "#{field}"}
|
70
|
+
end
|
71
|
+
|
72
|
+
もし /^"([^\"]*)"を選択する$/ do |field|
|
73
|
+
When %{I choose "#{field}"}
|
74
|
+
end
|
75
|
+
|
76
|
+
もし /^"([^\"]*)"としてファイル"([^\"]*)"を選択する$/ do |field, path|
|
77
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
78
|
+
end
|
79
|
+
|
80
|
+
ならば /^"([^\"]*)"と表示されていること$/ do |text|
|
81
|
+
Then %{I should see "#{text}"}
|
82
|
+
end
|
83
|
+
|
84
|
+
ならば /^"([^\"]*)"に"([^\"]*)"と表示されていること$/ do |selector, text|
|
85
|
+
Then %{I should see "#{text}" within "#{selector}"}
|
86
|
+
end
|
87
|
+
|
88
|
+
ならば /^\/([^\/]*)\/と表示されていること$/ do |regexp|
|
89
|
+
Then %{I should see /#{regexp}/}
|
90
|
+
end
|
91
|
+
|
92
|
+
ならば /^"([^\"]*)"に\/([^\/]*)\/と表示されていること$/ do |selector, regexp|
|
93
|
+
Then %{I should see \/#{regexp}\/ within "#{selector}"}
|
94
|
+
end
|
95
|
+
|
96
|
+
ならば /^"([^\"]*)"と表示されていないこと$/ do |text|
|
97
|
+
Then %{I should not see "#{text}"}
|
98
|
+
end
|
99
|
+
|
100
|
+
ならば /^"([^\"]*)"に"([^\"]*)"と表示されていないこと$/ do |selector, text|
|
101
|
+
Then %{I should not see "#{text}" within "#{selector}"}
|
102
|
+
end
|
103
|
+
|
104
|
+
ならば /^\/([^\/]*)\/と表示されていないこと$/ do |regexp|
|
105
|
+
Then %{I should not see /#{regexp}/}
|
106
|
+
end
|
107
|
+
|
108
|
+
ならば /^"([^\"]*)"に\/([^\/]*)\/と表示されていないこと$/ do |selector, regexp|
|
109
|
+
Then %{I should not see \/#{regexp}\/ within "#{selector}"}
|
110
|
+
end
|
111
|
+
|
112
|
+
ならば /^入力項目"([^\"]*)"に"([^\"]*)"と表示されていること$/ do |field, value|
|
113
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
114
|
+
end
|
115
|
+
|
116
|
+
ならば /^入力項目"([^\"]*)"に"([^\"]*)"と表示されていないこと$/ do |field, value|
|
117
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
118
|
+
end
|
119
|
+
|
120
|
+
ならば /^"([^\"]*)"がチェックされていること$/ do |label|
|
121
|
+
Then %{the "#{label}" checkbox should be checked}
|
122
|
+
end
|
123
|
+
|
124
|
+
ならば /^"([^\"]*)"がチェックされていないこと$/ do |label|
|
125
|
+
Then %{the "#{label}" checkbox should not be checked}
|
126
|
+
end
|
127
|
+
|
128
|
+
ならば /^"([^\"]*)"ページを表示していること$/ do |page_name|
|
129
|
+
Then %{I should be on #{page_name}}
|
130
|
+
end
|
131
|
+
|
132
|
+
show_me_the_page = lambda { Then %{show me the page} }
|
133
|
+
|
134
|
+
ならば /^ページを表示する$/, &show_me_the_page
|
135
|
+
ならば /^画面を目視$/, &show_me_the_page
|
136
|
+
|
137
|
+
# backword-compat for old japanese translation.
|
138
|
+
ならば /^デバッグ(?:のため)?$/, &show_me_the_page
|
139
|
+
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/edit_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
|
6
|
+
조건 /^(.+)페이지에 있습니다$/ do |page_name|
|
7
|
+
Given %{I am on #{page_name}}
|
8
|
+
end
|
9
|
+
|
10
|
+
만일 /^(.+)페이지로 갑니다$/ do |page_name|
|
11
|
+
When %{I go to #{page_name}}
|
12
|
+
end
|
13
|
+
|
14
|
+
만일 /^"([^\"]*)"버튼을 누릅니다$/ do |button|
|
15
|
+
When %{I press "#{button}"}
|
16
|
+
end
|
17
|
+
|
18
|
+
만일 /^"([^\"]*)"링크를 클릭합니다$/ do |link|
|
19
|
+
When %{I follow "#{link}"}
|
20
|
+
end
|
21
|
+
|
22
|
+
만일 /^"([^\"]*)"안에 있는 "([^\"]*)"링크를 클릭합니다$/ do |parent, link|
|
23
|
+
When %{I follow "#{link}" within "#{parent}"}
|
24
|
+
end
|
25
|
+
|
26
|
+
만일 /^"([^\"]*)"에 "([^\"]*)"라고 적습니다$/ do |field, value|
|
27
|
+
When %{I fill in "#{field}" with "#{value}"}
|
28
|
+
end
|
29
|
+
|
30
|
+
만일 /^"([^\"]*)"라고 "([^\"]*)"에 적습니다$/ do |value, field|
|
31
|
+
When %{I fill in "#{value}" for "#{field}"}
|
32
|
+
end
|
33
|
+
|
34
|
+
만일 /^아레의 목록을 입력합니다$/ do |fields|
|
35
|
+
When %{I fill in the following:}, fields
|
36
|
+
end
|
37
|
+
|
38
|
+
만일 /^"([^\"]*)"를 "([^\"]*)"으로 합니다$/ do |field, value|
|
39
|
+
When %{I select "#{value}" from "#{field}"}
|
40
|
+
end
|
41
|
+
|
42
|
+
만일 /^날짜와 시간를 "([^\"]*)"으로 합니다$/ do |time|
|
43
|
+
When %{I select "#{time}" as the date and time}
|
44
|
+
end
|
45
|
+
|
46
|
+
만일 /^"([^\"]*)"의 날짜와 시간을 "([^\"]*)"으로 합니다$/ do |datetime_label, datetime|
|
47
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
48
|
+
end
|
49
|
+
|
50
|
+
만일 /^시간을 "([^\"]*)"으로 합니다$/ do |time|
|
51
|
+
When %{I select "#{time}" as the time}
|
52
|
+
end
|
53
|
+
|
54
|
+
만일 /^"([^\"]*)"의 시간을 "([^\"]*)"으로 합니다$/ do |time_label, time|
|
55
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
56
|
+
end
|
57
|
+
|
58
|
+
만일 /^날짜를 "([^\"]*)"으로 합니다$/ do |date|
|
59
|
+
When %{I select "#{date}" as the date}
|
60
|
+
end
|
61
|
+
|
62
|
+
만일 /^"([^\"]*)"의 날짜를 "([^\"]*)"으로 합니다$/ do |date_label, date|
|
63
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
64
|
+
end
|
65
|
+
|
66
|
+
만일 /^"([^\"]*)"를 체크합니다$/ do |field|
|
67
|
+
When %{I check "#{field}"}
|
68
|
+
end
|
69
|
+
|
70
|
+
만일 /^"([^\"]*)"의 체크를 해제합니다$/ do |field|
|
71
|
+
When %{I uncheck "#{field}"}
|
72
|
+
end
|
73
|
+
|
74
|
+
만일 /^"([^\"]*)"를 고릅니다$/ do |field|
|
75
|
+
When %{I choose "#{field}"}
|
76
|
+
end
|
77
|
+
|
78
|
+
만일 /^"([^\"]*)"에 "([^\"]*)"파일을 첨부합니다$/ do |field, path|
|
79
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
80
|
+
end
|
81
|
+
|
82
|
+
그러면 /^"([^\"]*)"가 보여야 합니다$/ do |text|
|
83
|
+
Then %{I should see "#{text}"}
|
84
|
+
end
|
85
|
+
|
86
|
+
그러면 /^"([^\"]*)"안에 "([^\"]*)"가 보여야 합니다$/ do |selector, text|
|
87
|
+
Then %{I should see "#{text}" within "#{selector}"}
|
88
|
+
end
|
89
|
+
|
90
|
+
그러면 /^\/([^\/]*)\/가 보여야 합니다$/ do |regexp|
|
91
|
+
Then %{I should see /#{regexp}/}
|
92
|
+
end
|
93
|
+
|
94
|
+
그러면 /^"([^\"]*)"안에 \/([^\/]*)\/가 보여야 합니다$/ do |selector, regexp|
|
95
|
+
Then %{I should see /#{regexp}/ within "#{selector}"}
|
96
|
+
end
|
97
|
+
|
98
|
+
그러면 /^"([^\"]*)"가 보이면 안됩니다$/ do |text|
|
99
|
+
Then %{I should not see "#{text}"}
|
100
|
+
end
|
101
|
+
|
102
|
+
그러면 /^"([^\"]*)"안에 "([^\"]*)"가 보이면 안됩니다$/ do |selector, text|
|
103
|
+
Then %{I should not see "#{text}" within "#{selector}"}
|
104
|
+
end
|
105
|
+
|
106
|
+
그러면 /^\/([^\/]*)\/가 보이면 안됩니다$/ do |regexp|
|
107
|
+
Then %{I should not see /#{regexp}/}
|
108
|
+
end
|
109
|
+
|
110
|
+
그러면 /^"([^\"]*)"안에 \/([^\/]*)\/가 보이면 안됩니다$/ do |selector, regexp|
|
111
|
+
Then %{I should not see /#{regexp}/ within "#{selector}"}
|
112
|
+
end
|
113
|
+
|
114
|
+
그러면 /^"([^\"]*)"는 "([^\"]*)"이어야 합니다$/ do |field, value|
|
115
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
116
|
+
end
|
117
|
+
|
118
|
+
그러면 /^"([^\"]*)"는 "([^\"]*)"이면 안됩니다$/ do |field, value|
|
119
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
120
|
+
end
|
121
|
+
|
122
|
+
그러면 /^"([^\"]*)"는 체크되어 있어야 합니다$/ do |label|
|
123
|
+
Then %{the "#{label}" checkbox should be checked}
|
124
|
+
end
|
125
|
+
|
126
|
+
그러면 /^"([^\"]*)"는 체크되어 있으면 안됩니다$/ do |label|
|
127
|
+
Then %{the "#{label}" checkbox should not be checked}
|
128
|
+
end
|
129
|
+
|
130
|
+
그러면 /^(.+)에 있어야 합니다$/ do |page_name|
|
131
|
+
Then %{I should be on #{page_name}}
|
132
|
+
end
|
133
|
+
|
134
|
+
그러면 /^다음 쿼리들이 나와야합니다:$/ do |expected_pairs|
|
135
|
+
Then %{I should have the following query string:}
|
136
|
+
end
|
137
|
+
|
138
|
+
그러면 /^페이지를 엽니다$/ do
|
139
|
+
Then %{show me the page}
|
140
|
+
end
|
141
|
+
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<%= embed_file('support/edit_warning.txt') %>
|
2
2
|
|
3
3
|
require 'uri'
|
4
|
+
require 'cgi'
|
4
5
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
6
|
|
6
7
|
# Commonly used webrat steps
|
@@ -135,7 +136,7 @@ When /^(?:|I )attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field|
|
|
135
136
|
end
|
136
137
|
|
137
138
|
Then /^(?:|I )should see "([^\"]*)"$/ do |text|
|
138
|
-
if
|
139
|
+
if response.respond_to? :should
|
139
140
|
response.should contain(text)
|
140
141
|
else
|
141
142
|
assert_contain text
|
@@ -144,7 +145,7 @@ end
|
|
144
145
|
|
145
146
|
Then /^(?:|I )should see "([^\"]*)" within "([^\"]*)"$/ do |text, selector|
|
146
147
|
within(selector) do |content|
|
147
|
-
if
|
148
|
+
if content.respond_to? :should
|
148
149
|
content.should contain(text)
|
149
150
|
else
|
150
151
|
hc = Webrat::Matchers::HasContent.new(text)
|
@@ -155,7 +156,7 @@ end
|
|
155
156
|
|
156
157
|
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
157
158
|
regexp = Regexp.new(regexp)
|
158
|
-
if
|
159
|
+
if response.respond_to? :should
|
159
160
|
response.should contain(regexp)
|
160
161
|
else
|
161
162
|
assert_match(regexp, response_body)
|
@@ -165,7 +166,7 @@ end
|
|
165
166
|
Then /^(?:|I )should see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, selector|
|
166
167
|
within(selector) do |content|
|
167
168
|
regexp = Regexp.new(regexp)
|
168
|
-
if
|
169
|
+
if content.respond_to? :should
|
169
170
|
content.should contain(regexp)
|
170
171
|
else
|
171
172
|
assert_match(regexp, content)
|
@@ -174,7 +175,7 @@ Then /^(?:|I )should see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, selector|
|
|
174
175
|
end
|
175
176
|
|
176
177
|
Then /^(?:|I )should not see "([^\"]*)"$/ do |text|
|
177
|
-
if
|
178
|
+
if response.respond_to? :should_not
|
178
179
|
response.should_not contain(text)
|
179
180
|
else
|
180
181
|
assert_not_contain(text)
|
@@ -183,7 +184,7 @@ end
|
|
183
184
|
|
184
185
|
Then /^(?:|I )should not see "([^\"]*)" within "([^\"]*)"$/ do |text, selector|
|
185
186
|
within(selector) do |content|
|
186
|
-
if
|
187
|
+
if content.respond_to? :should_not
|
187
188
|
content.should_not contain(text)
|
188
189
|
else
|
189
190
|
hc = Webrat::Matchers::HasContent.new(text)
|
@@ -194,7 +195,7 @@ end
|
|
194
195
|
|
195
196
|
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
196
197
|
regexp = Regexp.new(regexp)
|
197
|
-
if
|
198
|
+
if response.respond_to? :should_not
|
198
199
|
response.should_not contain(regexp)
|
199
200
|
else
|
200
201
|
assert_not_contain(regexp)
|
@@ -204,7 +205,7 @@ end
|
|
204
205
|
Then /^(?:|I )should not see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, selector|
|
205
206
|
within(selector) do |content|
|
206
207
|
regexp = Regexp.new(regexp)
|
207
|
-
if
|
208
|
+
if content.respond_to? :should_not
|
208
209
|
content.should_not contain(regexp)
|
209
210
|
else
|
210
211
|
assert_no_match(regexp, content)
|
@@ -213,50 +214,57 @@ Then /^(?:|I )should not see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, select
|
|
213
214
|
end
|
214
215
|
|
215
216
|
Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
|
216
|
-
|
217
|
-
|
217
|
+
field_value = field_labeled(field).value
|
218
|
+
if field_value.respond_to? :should
|
219
|
+
field_value.should =~ /#{value}/
|
218
220
|
else
|
219
|
-
assert_match(/#{value}/,
|
221
|
+
assert_match(/#{value}/, field_value)
|
220
222
|
end
|
221
223
|
end
|
222
224
|
|
223
225
|
Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
|
224
|
-
|
225
|
-
|
226
|
+
field_value = field_labeled(field).value
|
227
|
+
if field_value.respond_to? :should_not
|
228
|
+
field_value.should_not =~ /#{value}/
|
226
229
|
else
|
227
|
-
assert_no_match(/#{value}/,
|
230
|
+
assert_no_match(/#{value}/, field_value)
|
228
231
|
end
|
229
232
|
end
|
230
233
|
|
231
234
|
Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
|
232
|
-
|
233
|
-
|
235
|
+
field = field_labeled(label)
|
236
|
+
if field.respond_to? :should
|
237
|
+
field.should be_checked
|
234
238
|
else
|
235
|
-
assert
|
239
|
+
assert field.checked?
|
236
240
|
end
|
237
241
|
end
|
238
242
|
|
239
243
|
Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
|
240
|
-
|
241
|
-
|
244
|
+
field = field_labeled(label)
|
245
|
+
if field.respond_to? :should_not
|
246
|
+
field.should_not be_checked
|
242
247
|
else
|
243
|
-
assert !
|
248
|
+
assert !field.checked?
|
244
249
|
end
|
245
250
|
end
|
246
251
|
|
247
252
|
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
248
|
-
|
249
|
-
|
253
|
+
current_path = URI.parse(current_url).path
|
254
|
+
if current_path.respond_to? :should
|
255
|
+
current_path.should == path_to(page_name)
|
250
256
|
else
|
251
|
-
assert_equal path_to(page_name),
|
257
|
+
assert_equal path_to(page_name), current_path
|
252
258
|
end
|
253
259
|
end
|
254
260
|
|
255
261
|
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
262
|
+
query = URI.parse(current_url).query
|
263
|
+
actual_params = query ? CGI.parse(query) : {}
|
264
|
+
expected_params = {}
|
265
|
+
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
266
|
+
|
267
|
+
if actual_params.respond_to? :should
|
260
268
|
actual_params.should == expected_params
|
261
269
|
else
|
262
270
|
assert_equal expected_params, actual_params
|
@@ -265,4 +273,4 @@ end
|
|
265
273
|
|
266
274
|
Then /^show me the page$/ do
|
267
275
|
save_and_open_page
|
268
|
-
end
|
276
|
+
end
|