Created
November 18, 2008 02:29
-
-
Save moro/26024 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commonly used webrat steps | |
# http://github.com/brynary/webrat | |
When /言語は"(.*)"/ do |lang| | |
header("ACCEPT_LANGUAGE", lang) | |
end | |
When /^"(.*)"ボタンをクリックする$/ do |button| | |
clicks_button(button) | |
end | |
When /^"(.*)"リンクをクリックする$/ do |link| | |
clicks_link(link) | |
end | |
When /再読み込みする/ do | |
visit request.request_uri | |
end | |
When /^"(.*)"に"(.*)"と入力する$/ do |field, value| | |
fills_in(field, :with => value) | |
end | |
# opposite order from Engilsh one(original) | |
When /^"(.*)"から"(.*)"を選択$/ do |field, value| | |
selects(value, :from => field) | |
end | |
When /^"(.*)"をチェックする$/ do |field| | |
checks(field) | |
end | |
When /^"(.*)"のチェックを外す$/ do |field| | |
unchecks(field) | |
end | |
When /^"(.*)"を選択する$/ do |field| | |
chooses(field) | |
end | |
# opposite order from Engilsh one(original) | |
When /^"(.*)"としてをファイル"(.*)"を添付する$/ do |field, path| | |
attaches_file(field, path) | |
end | |
Then /^"(.*)"と表示されていること$/ do |text| | |
response.body.should =~ /#{Regexp.escape(text)}/m | |
end | |
Then /^"(.*)"と表示されていないこと$/ do |text| | |
response.body.should_not =~ /#{text}/m | |
end | |
Then /^"(.*)"がチェックされていること$/ do |label| | |
field_labeled(label).should be_checked | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment