require './http_response_test' UA_MOBILE = 'Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0' UA_DEFAULT = nil class ResponseTest < HTTPResponseTest ### Setting Defaults for all subsequent class calls - except when overridden. self.ssl_no_verify = false # setting as default, except when overridden by @ssl_no_verify #self.useragent = 'My Own User Agent for all calls' # setting as default, except when overridden by @useragent ### Netdome Sites # Rainloop Mailer @ssl_no_verify = true uri_should_redirect :from => 'http://mail.netdome.biz', :to => 'https://mail.netdome.biz/', :by => '302' uri_be_success :uri => 'https://mail.netdome.biz/' # Grafana uri_should_redirect :from => 'http://grafana.netdome.biz', :to => 'https://grafana.netdome.biz/' uri_should_redirect :from => 'https://grafana.netdome.biz', :to => '/login' uri_be_code :uri => 'https://grafana.netdome.biz/login', :code => '200' # 200 = OK # Confluence uri_should_redirect :from => 'https://netdome.biz', :to => 'https://www.netdome.biz/', :by => '301' uri_should_redirect :from => 'https://www.netdome.biz', :to => 'http://www.netdome.biz/homepage.action', :by => '302' uri_should_redirect :from => 'https://netdome.biz/display/ndpub/Home', :to => 'https://www.netdome.biz/display/ndpub/Home', :by => '301' #uri_be_success :uri => 'http://www.netdome.biz/display/ndpub' # leitet leider per Post 302 auf JSESSIONID weiter uri_be_code :uri => 'https://www.netdome.biz/display/ndpub', :code => '302' #### User Agent testing @ssl_no_verify = false @useragent = UA_MOBILE uri_should_redirect :from => 'https://youtube.com/', :to => 'https://www.youtube.com/' uri_should_redirect :to => 'https://m.youtube.com/' # :from is being defaulted to @last_to @useragent = UA_DEFAULT #### DM Sites @ssl_no_verify = false ### DM Germany (.de) uri_should_redirect :from => 'http://dm.de', :to => 'https://www.dm.de/' uri_should_redirect :from => 'https://dm.de', :to => @last_to uri_should_redirect :from => 'http://www.dm.de', :to => @last_to uri_be_success :uri => @last_to # any of 2xx http response codes uri_should_redirect :from => 'http://helferherzen.de/', :to => 'http://www.helferherzen.de/' uri_be_success :uri => @last_to uri_should_redirect :from => 'https://helferherzen.de/', :to => 'https://www.helferherzen.de/' uri_be_success :uri => 'https://www.helferherzen.de/' ### DM Austria (.at) uri_should_redirect :from => 'http://dm.at', :to => 'https://www.meindm.at/mein-dm/' uri_should_redirect :from => 'https://dm.at', :to => @last_to uri_should_redirect :from => 'http://www.dm.at', :to => @last_to uri_should_redirect :from => 'https://www.dm.at', :to => @last_to uri_be_success :uri => @last_to uri_should_redirect :from => 'http://dm-drogeriemarkt.at/', :to => 'http://www.dm-drogeriemarkt.at/' uri_be_success :uri => @last_to uri_should_redirect :from => 'https://dm-drogeriemarkt.at/', :to => 'https://www.dm-drogeriemarkt.at/' uri_be_success :uri => 'https://www.dm-drogeriemarkt.at' ### DM Czech Republic (.cz) uri_should_redirect :from => 'http://dm.cz', :to => 'http://www.dm-drogeriemarkt.cz/' uri_should_redirect :from => 'https://dm.cz', :to => 'https://www.dm-drogeriemarkt.cz/' uri_should_redirect :from => 'http://www.dm.cz', :to => 'http://www.dm-drogeriemarkt.cz/' uri_should_redirect :from => 'https://www.dm.cz', :to => 'https://www.dm-drogeriemarkt.cz/' uri_should_redirect :from => 'http://dm-drogeriemarkt.cz', :to => 'http://www.dm-drogeriemarkt.cz/' uri_be_success :uri => @last_to uri_should_redirect :from => 'https://dm-drogeriemarkt.cz', :to => 'https://www.dm-drogeriemarkt.cz/' uri_be_success :uri => @last_to ### DM Hungary (.hu) uri_should_redirect :from => 'http://dm.hu', :to => 'http://www.dm-drogeriemarkt.hu/', :by => 301 uri_should_redirect :from => 'https://dm.hu', :to => 'https://www.dm-drogeriemarkt.hu/' uri_should_redirect :from => 'http://www.dm.hu', :to => 'http://www.dm-drogeriemarkt.hu/' uri_should_redirect :from => 'https://www.dm.hu', :to => 'https://www.dm-drogeriemarkt.hu/' uri_should_redirect :from => 'http://dm-drogeriemarkt.hu', :to => 'http://www.dm-drogeriemarkt.hu/' uri_be_success :uri => 'http://www.dm-drogeriemarkt.hu' uri_should_redirect :from => 'https://dm-drogeriemarkt.hu', :to => 'https://www.dm-drogeriemarkt.hu/' uri_be_success :uri => 'https://www.dm-drogeriemarkt.hu' ### DM Slovakia (.sk) uri_should_redirect :from => 'http://dm-drogeriemarkt.sk', :to => 'http://www.dm-drogeriemarkt.sk/' uri_should_redirect :from => 'https://dm-drogeriemarkt.sk', :to => 'https://www.dm-drogeriemarkt.sk/' uri_be_success :uri => 'http://www.dm-drogeriemarkt.sk' uri_body_contains :uri => 'http://www.dm-drogeriemarkt.sk', :strings => [ '