Created a test for the new URL format.
class Youtube < Website
- VALID_YOUTUBE_URL_REGEX = /^(http:\/\/)?([a-z0-9]+\.)?youtube\.com\/((watch\?v=)|(v\/))[a-z0-9_\-]+(\&.*)?\#?$/i
+ VALID_YOUTUBE_URL_REGEX = /^(http:\/\/)?([a-z0-9]+\.)?youtube\.com\/((watch\?v=)|(v\/)|([a-z]+\#[a-z]\/[a-z]\/[0-9]\/))[a-z0-9_\-]+(\&.*)?\#?$/i
def self.owns_url?(url)
return url =~ VALID_YOUTUBE_URL_REGEX
assert(Youtube.owns_url?('http://www.youtube.com/watch?v=83-hlYMH1XE&feature=dir'))
assert(Youtube.owns_url?('http://in.youtube.com/watch?v=VcydqSpYN00&feature=channel_page'))
assert(Youtube.owns_url?('http://uk.youtube.com/watch?v=LN4Ov6ZLcrI'))
+ assert(Youtube.owns_url?('http://www.youtube.com/meetlocalbiz#p/u/0/rJVWV4aA6Jk'))
end