Skip to content

Instantly share code, notes, and snippets.

View thijsc's full-sized avatar

Thijs Cadier thijsc

View GitHub Profile
@thijsc
thijsc / gist:2652300
Created May 10, 2012 10:18
Professional delete this code after date x spec
scenario "make sure this feature is removed after July 1st" do
raise('Remove this feature!') if Time.now > Time.parse('2012-07-01')
end
@thijsc
thijsc / gist:1391107
Created November 24, 2011 11:08
Select item from chosen js select with Capybara and Selenium
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
class Tosti
def self.validate(*ingredients, preparation_method)
ingredients.include?(:brood) && ingredients.length > 1 && preparation_method == :grill
end
end
class Tosti
def self.validate(*ingredients)
ingredients.include?(:brood) && preparation_method == :grill
end
end