Sha256: 59b761b0cba52b08d27148103346bbc7f1189d04cb3f676044a6a3797a995481
Contents?: true
Size: 329 Bytes
Versions: 8
Compression:
Stored size: 329 Bytes
Contents
require 'uri' RSpec::Matchers.define :have_query_param do |key| match do |url| query_params_from(url)[key].present? end def query_params_from(url) Hash[query_for(url).split("&").map { |x| x.split('=', 2) }] end def uri_for(url) URI.parse(url) end def query_for(url) uri_for(url).query end end
Version data entries
8 entries across 8 versions & 1 rubygems