test.rb 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. require './http_response_test'
  2. UA_MOBILE = 'Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0'
  3. UA_DEFAULT = nil
  4. class ResponseTest < HTTPResponseTest
  5. ### Setting Defaults for all subsequent class calls - except when overridden.
  6. self.ssl_no_verify = false # setting as default, except when overridden by @ssl_no_verify
  7. #self.useragent = 'My Own User Agent for all calls' # setting as default, except when overridden by @useragent
  8. ### Netdome Sites
  9. # Rainloop Mailer
  10. @ssl_no_verify = true
  11. uri_should_redirect :from => 'http://mail.netdome.biz', :to => 'https://mail.netdome.biz/', :by => '302'
  12. uri_be_success :uri => 'https://mail.netdome.biz/'
  13. # Grafana
  14. uri_should_redirect :from => 'http://grafana.netdome.biz', :to => 'https://grafana.netdome.biz/'
  15. uri_should_redirect :from => 'https://grafana.netdome.biz', :to => '/login'
  16. uri_be_code :uri => 'https://grafana.netdome.biz/login', :code => '200' # 200 = OK
  17. # Confluence
  18. uri_should_redirect :from => 'https://netdome.biz', :to => 'https://www.netdome.biz/', :by => '301'
  19. uri_should_redirect :from => 'https://www.netdome.biz', :to => 'http://www.netdome.biz/homepage.action', :by => '302'
  20. uri_should_redirect :from => 'https://netdome.biz/display/ndpub/Home',
  21. :to => 'https://www.netdome.biz/display/ndpub/Home',
  22. :by => '301'
  23. #uri_be_success :uri => 'http://www.netdome.biz/display/ndpub' # leitet leider per Post 302 auf JSESSIONID weiter
  24. uri_be_code :uri => 'https://www.netdome.biz/display/ndpub', :code => '302'
  25. #### User Agent testing
  26. @ssl_no_verify = false
  27. @useragent = UA_MOBILE
  28. uri_should_redirect :from => 'https://youtube.com/',
  29. :to => 'https://www.youtube.com/'
  30. uri_should_redirect :to => 'https://m.youtube.com/' # :from is being defaulted to @last_to
  31. @useragent = UA_DEFAULT
  32. #### DM Sites
  33. @ssl_no_verify = false
  34. ### DM Germany (.de)
  35. uri_should_redirect :from => 'http://dm.de', :to => 'https://www.dm.de/'
  36. uri_should_redirect :from => 'https://dm.de', :to => @last_to
  37. uri_should_redirect :from => 'http://www.dm.de', :to => @last_to
  38. uri_be_success :uri => @last_to # any of 2xx http response codes
  39. uri_should_redirect :from => 'http://helferherzen.de/', :to => 'http://www.helferherzen.de/'
  40. uri_be_success :uri => @last_to
  41. uri_should_redirect :from => 'https://helferherzen.de/', :to => 'https://www.helferherzen.de/'
  42. uri_be_success :uri => 'https://www.helferherzen.de/'
  43. ### DM Austria (.at)
  44. uri_should_redirect :from => 'http://dm.at', :to => 'https://www.meindm.at/mein-dm/'
  45. uri_should_redirect :from => 'https://dm.at', :to => @last_to
  46. uri_should_redirect :from => 'http://www.dm.at', :to => @last_to
  47. uri_should_redirect :from => 'https://www.dm.at', :to => @last_to
  48. uri_be_success :uri => @last_to
  49. uri_should_redirect :from => 'http://dm-drogeriemarkt.at/', :to => 'http://www.dm-drogeriemarkt.at/'
  50. uri_be_success :uri => @last_to
  51. uri_should_redirect :from => 'https://dm-drogeriemarkt.at/', :to => 'https://www.dm-drogeriemarkt.at/'
  52. uri_be_success :uri => 'https://www.dm-drogeriemarkt.at'
  53. ### DM Czech Republic (.cz)
  54. uri_should_redirect :from => 'http://dm.cz', :to => 'http://www.dm-drogeriemarkt.cz/'
  55. uri_should_redirect :from => 'https://dm.cz', :to => 'https://www.dm-drogeriemarkt.cz/'
  56. uri_should_redirect :from => 'http://www.dm.cz', :to => 'http://www.dm-drogeriemarkt.cz/'
  57. uri_should_redirect :from => 'https://www.dm.cz', :to => 'https://www.dm-drogeriemarkt.cz/'
  58. uri_should_redirect :from => 'http://dm-drogeriemarkt.cz', :to => 'http://www.dm-drogeriemarkt.cz/'
  59. uri_be_success :uri => @last_to
  60. uri_should_redirect :from => 'https://dm-drogeriemarkt.cz', :to => 'https://www.dm-drogeriemarkt.cz/'
  61. uri_be_success :uri => @last_to
  62. ### DM Hungary (.hu)
  63. uri_should_redirect :from => 'http://dm.hu', :to => 'http://www.dm-drogeriemarkt.hu/', :by => 301
  64. uri_should_redirect :from => 'https://dm.hu', :to => 'https://www.dm-drogeriemarkt.hu/'
  65. uri_should_redirect :from => 'http://www.dm.hu', :to => 'http://www.dm-drogeriemarkt.hu/'
  66. uri_should_redirect :from => 'https://www.dm.hu', :to => 'https://www.dm-drogeriemarkt.hu/'
  67. uri_should_redirect :from => 'http://dm-drogeriemarkt.hu', :to => 'http://www.dm-drogeriemarkt.hu/'
  68. uri_be_success :uri => 'http://www.dm-drogeriemarkt.hu'
  69. uri_should_redirect :from => 'https://dm-drogeriemarkt.hu', :to => 'https://www.dm-drogeriemarkt.hu/'
  70. uri_be_success :uri => 'https://www.dm-drogeriemarkt.hu'
  71. ### DM Slovakia (.sk)
  72. uri_should_redirect :from => 'http://dm-drogeriemarkt.sk', :to => 'http://www.dm-drogeriemarkt.sk/'
  73. uri_should_redirect :from => 'https://dm-drogeriemarkt.sk', :to => 'https://www.dm-drogeriemarkt.sk/'
  74. uri_be_success :uri => 'http://www.dm-drogeriemarkt.sk'
  75. uri_body_contains :uri => 'http://www.dm-drogeriemarkt.sk',
  76. :strings => [
  77. '<title>dm drogerie markt Slovensko</title>'
  78. ]
  79. uri_be_success :uri => 'https://www.dm-drogeriemarkt.sk'
  80. uri_body_contains :uri => 'https://www.dm-drogeriemarkt.sk',
  81. :strings => [
  82. '<title>dm drogerie markt Slovensko</title>',
  83. ]
  84. end