Commit 647ae42aa5a8cf89651844d9438dd0980b659224
Always using https when logging in in production mode (according to SslRequirement settings).
| |   |
| 452 | 452 | def avatar_wrapper(avatar) |
| 453 | 453 | content_tag(:div, avatar, :class => "glossy_avatar_wrapper") |
| 454 | 454 | end |
| |
| def secure_login_url |
| if SslRequirement.disable_ssl_check? |
| sessions_path |
| else |
| sessions_url(:protocol => "https", :host => SslRequirement.ssl_host) |
| end |
| end |
| 455 | 463 | end |
| |   |
| <% form_tag sessions_path, :id => "big_header_login_box_form" do %> |
| <% form_tag secure_login_url, :id => "big_header_login_box_form" do %> |
| 2 | 2 | <div id="big_header_login_box_fields"> |
| 3 | 3 | <div id="big_header_login_box_regular"> |
| 4 | 4 | <h3><%= t("views.sessions.regular_login_header") %></h3> |
| |   |
| 31 | 31 | assert_template "layouts/second_generation/application" |
| 32 | 32 | end |
| 33 | 33 | |
| should "not use https if not configured to use https" do |
| SslRequirement.expects(:disable_ssl_check?).returns(true).at_least_once |
| get :index |
| assert_response :success |
| assert_select 'form#big_header_login_box_form[action=/sessions]' |
| end |
| |
| should "use https to login if configured" do |
| SslRequirement.expects(:disable_ssl_check?).returns(false).at_least_once |
| SslRequirement.expects(:ssl_host).returns("foo.gitorious.org").at_least_once |
| get :index |
| assert_response :success |
| assert_select 'form#big_header_login_box_form[action=https://foo.gitorious.org/sessions]' |
| end |
| |
| 34 | 49 | should "gets a list of the most recent projects" do |
| 35 | 50 | get :index |
| 36 | 51 | assert assigns(:projects).is_a?(Array) |