This file contains hidden or 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
| require 'base64' | |
| def base64_url_decode(str) | |
| str += '=' * (4 - str.length.modulo(4)) | |
| Base64.decode64(str.gsub("-", "+").gsub("_", "/")) | |
| end # source: https://github.com/ptarjan/base64url/blob/master/ruby.rb | |
| require 'hmac' | |
| require 'hmac-sha2' ## used to decode facebook return values |
This file contains hidden or 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
| require "xpath" # XPath is a separate gem now | |
| module Cucumber | |
| module Rails | |
| module CapybaraSelectDatesAndTimes | |
| def select_date(field, options = {}) | |
| date = Date.parse(options[:with]) | |
| selector = %Q{.//fieldset[contains(./legend, "#{field}")]} | |
| within(:xpath, selector) do | |
| find(:xpath, '//select[contains(@id, "_1i")]').find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option |
NewerOlder