Skip to content

Commit

Permalink
Update spec for new default URL base. Update conformance test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Sanford committed Jan 22, 2010
1 parent ba7713d commit f105c60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/autolinking_spec.rb
Expand Up @@ -304,7 +304,7 @@ def original_text; "#{[0xFF03].pack('U')}twj_dev"; end
it "should be linked" do
link = Hpricot(@autolinked_text).at('a')
link.inner_text.should == "#{[0xFF03].pack('U')}twj_dev"
link['href'].should == '/search?q=%23twj_dev'
link['href'].should == 'http://twitter.com/search?q=%23twj_dev'
end
end

Expand Down Expand Up @@ -355,7 +355,7 @@ def url; "http://www.google.com/"; end
end
end

context "with a URL ending in forbidden characters" do
context "with a URL preceded in forbidden characters" do
it "should not be linked" do
matcher = TestAutolink.new
%w| \ ' / : ! = |.each do |char|
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Expand Up @@ -37,7 +37,7 @@
Spec::Matchers.define :link_to_screen_name do |screen_name|
match do |text|
@link = Hpricot(text).at("a.username")
@link && @link.inner_text == screen_name && "/#{screen_name}".downcase.should == @link['href']
@link && @link.inner_text == screen_name && "http://twitter.com/#{screen_name}".downcase.should == @link['href']
end

failure_message_for_should do |text|
Expand All @@ -56,7 +56,7 @@
Spec::Matchers.define :link_to_list_path do |list_path|
match do |text|
@link = Hpricot(text).at("a.list-slug")
!@link.nil? && @link.inner_text == list_path && "/#{list_path}".downcase.should == @link['href']
!@link.nil? && @link.inner_text == list_path && "http://twitter.com/#{list_path}".downcase.should == @link['href']
end

failure_message_for_should do |text|
Expand All @@ -74,7 +74,7 @@

Spec::Matchers.define :have_autolinked_hashtag do |hashtag|
match do |text|
@link = Hpricot(text).at("a[@href='/search?q=#{CGI.escape hashtag}']")
@link = Hpricot(text).at("a[@href='http://twitter.com/search?q=#{CGI.escape hashtag}']")
@link &&
@link.inner_text &&
@link.inner_text == hashtag
Expand Down
2 changes: 1 addition & 1 deletion test/twitter-text-conformance
Submodule twitter-text-conformance updated 1 files
+183 −5 autolink.yml

0 comments on commit f105c60

Please sign in to comment.