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
BROWSER_WIDTH = 1600 | |
BROWSER_HEIGHT = 1200 | |
Capybara.default_driver = :selenium | |
include Capybara::DSL | |
def take_screenshot(path, name, convert_options={}) | |
# Wait for JS to load data and so on | |
sleep 2 | |
retinafy_screen |
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
scenario "make sure this feature is removed after July 1st" do | |
raise('Remove this feature!') if Time.now > Time.parse('2012-07-01') | |
end |
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
def select_from_chosen(item_text, options) | |
field = find_field(options[:from]) | |
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
end |
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
class Tosti | |
def self.validate(*ingredients, preparation_method) | |
ingredients.include?(:brood) && ingredients.length > 1 && preparation_method == :grill | |
end | |
end |
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
class Tosti | |
def self.validate(*ingredients) | |
ingredients.include?(:brood) && preparation_method == :grill | |
end | |
end |
NewerOlder