Commit 647ae42aa5a8cf89651844d9438dd0980b659224

  • avatar
  • August Lilleaas <augustlilleaas @gm…l.com>
  • Fri Jun 12 13:20:12 CEST 2009
Always using https when logging in in production mode (according to SslRequirement settings).
  
452452 def avatar_wrapper(avatar)
453453 content_tag(:div, avatar, :class => "glossy_avatar_wrapper")
454454 end
455
456 def secure_login_url
457 if SslRequirement.disable_ssl_check?
458 sessions_path
459 else
460 sessions_url(:protocol => "https", :host => SslRequirement.ssl_host)
461 end
462 end
455463end
  
1<% form_tag sessions_path, :id => "big_header_login_box_form" do %>
1<% form_tag secure_login_url, :id => "big_header_login_box_form" do %>
22 <div id="big_header_login_box_fields">
33 <div id="big_header_login_box_regular">
44 <h3><%= t("views.sessions.regular_login_header") %></h3>
  
3131 assert_template "layouts/second_generation/application"
3232 end
3333
34 should "not use https if not configured to use https" do
35 SslRequirement.expects(:disable_ssl_check?).returns(true).at_least_once
36 get :index
37 assert_response :success
38 assert_select 'form#big_header_login_box_form[action=/sessions]'
39 end
40
41 should "use https to login if configured" do
42 SslRequirement.expects(:disable_ssl_check?).returns(false).at_least_once
43 SslRequirement.expects(:ssl_host).returns("foo.gitorious.org").at_least_once
44 get :index
45 assert_response :success
46 assert_select 'form#big_header_login_box_form[action=https://foo.gitorious.org/sessions]'
47 end
48
3449 should "gets a list of the most recent projects" do
3550 get :index
3651 assert assigns(:projects).is_a?(Array)