Sha256: cb9aa1b94972938836a448cb67fa33b3d365e34fb4f2bdc263bf27646f068b62

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require 'spec_helper'

describe "/users/password" do
  include UsersHelper

  before do
    login_and_assign
    assign(:user, current_user)
  end

  it "cancel: should hide [Change Password] form and restore title" do
    params[:cancel] = "true"

    render
    rendered.should include("crm.flip_form('change_password')")
    rendered.should include("crm.set_title('change_password', 'My Profile')")
  end

  it "edit profile: should hide [Edit Profile] and [Upload Avatar] forms and show [Change Password]" do
    render

    rendered.should include("$('#change_password').html")
    rendered.should include("crm.hide_form('edit_profile');")
    rendered.should include("crm.hide_form('upload_avatar');")
    rendered.should include("crm.flip_form('change_password');")
    rendered.should include("crm.set_title('change_password', 'Change Password');")
    rendered.should include("$('#current_password').focus();")
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.13.5 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.13.4 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.13.3 spec/views/users/password.js.haml_spec.rb