Permalink
Browse files

phone_spec: AsyncHttp & URI tests fixed

  • Loading branch information...
1 parent 2424848 commit 5cc9fc9c8cec799cad1cba86732be2eb68ce6d58 @timashev timashev committed Nov 29, 2012
Showing with 9 additions and 9 deletions.
  1. +7 −7 spec/phone_spec/app/spec/asynchttp_spec.rb
  2. +2 −2 spec/phone_spec/app/spec/uri_spec.rb
@@ -43,35 +43,35 @@
File.exists?(file_name).should == false
res = Rho::AsyncHttp.download_file(
- :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app.jpg',
+ :url => 'http://www.google.com/images/icons/product/chrome-48.png',
:filename => file_name )
puts "res : #{res}"
res['status'].should == 'ok'
- res['headers']['content-length'].to_i.should == 14451
- res['headers']['content-type'].should == 'image/jpeg'
+ res['headers']['content-length'].to_i.should == 1834
+ res['headers']['content-type'].should == 'image/png'
File.exists?(file_name).should == true
orig_len = File.size(file_name)
orig_len.should == res['headers']['content-length'].to_i
#check that in case of one more download, files keeps the same
res = Rho::AsyncHttp.download_file(
- :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app.jpg',
+ :url => 'http://www.google.com/images/icons/product/chrome-48.png',
:filename => file_name )
puts "res : #{res}"
res['status'].should == 'ok'
- #res['headers']['content-length'].to_i.should == 12562
+ #res['headers']['content-length'].to_i.should == 1834
res['http_error'].should == '206'
- #res['headers']['content-type'].should == 'image/jpeg'
+ #res['headers']['content-type'].should == 'image/png'
File.exists?(file_name).should == true
File.size(file_name).should == orig_len
#check that in case of network error, files keeps the same
res = Rho::AsyncHttp.download_file(
- :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app_BAD.jpg',
+ :url => 'http://www.google.com/images/icons/product/chrome-48_BAD.png',
:filename => file_name )
puts "res : #{res}"
res['status'].should == 'error'
@@ -21,7 +21,7 @@
end
it "test navigate external http" do
- WebView.navigate "http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg?rho_open_target=_blanck"
+ WebView.navigate "http://www.google.com/images/icons/product/chrome-48.png?rho_open_target=_blanck"
end
it "test navigate local file" do
@@ -50,7 +50,7 @@
end
it "test open external http" do
- WebView.navigate "http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg?rho_open_target=_blanck"
+ WebView.navigate "http://www.google.com/images/icons/product/chrome-48.png?rho_open_target=_blanck"
end
it "test open local file" do

0 comments on commit 5cc9fc9

Please sign in to comment.