spec/ajax/helpers_spec.rb in ajax-0.1.4 vs spec/ajax/helpers_spec.rb in ajax-0.1.5

- old
+ new

@@ -1,5 +1,6 @@ +# coding: utf-8 require 'spec_helper' context 'Ajax::UrlHelpers' do DOMAINS = %w[musicsocial.com.local altnet.com amusicstreamingservice.com stage.altnet.com rails1.creagency.com.au] @@ -18,11 +19,11 @@ it "should handle special characters" do Ajax.hashed_url_from_traditional('/beyoncé').should == '/#/beyonc%C3%A9' Ajax.hashed_url_from_traditional('/red hot').should == '/#/red%20hot' end - + DOMAINS.each do |domain| it "should work for domain #{domain}" do Ajax.hashed_url_from_traditional("http://#{domain}/playlists").should == "http://#{domain}/#/playlists" end end @@ -31,11 +32,11 @@ describe "(URL) hashed_url_from_fragment" do it "should strip double slashes" do Ajax.hashed_url_from_fragment('/Beyonce#/Akon').should == '/#/Akon' Ajax.hashed_url_from_fragment('/Beyonce#Akon').should == '/#/Akon' end - + it "should handle special characters" do Ajax.hashed_url_from_fragment('/#/beyoncé').should == '/#/beyonc%C3%A9' Ajax.hashed_url_from_fragment('/#/red hot').should == '/#/red%20hot' end @@ -64,11 +65,11 @@ end it "should support full URLs" do Ajax.is_hashed_url?('http://musicsocial.com.local/#/playlists').should be(true) end - + it "should support special characters" do Ajax.is_hashed_url?('http://musicsocial.com.local/#/beyoncé').should be(true) end end @@ -104,10 +105,10 @@ it "should handle no fragment" do Ajax.traditional_url_from_fragment('/Beyonce#/beyoncé').should == '/beyonc%C3%A9' Ajax.traditional_url_from_fragment('/#/red hot').should == '/red%20hot' end - + it "should handle special characters" do Ajax.traditional_url_from_fragment('/Beyonce#/Akon').should == '/Akon' end DOMAINS.each do |domain|