Sha256: 339cfade29ad143658c73df96a10daaea3f056c3a71976c4c1fa2881cfe29718

Contents?: true

Size: 1.22 KB

Versions: 15

Compression:

Stored size: 1.22 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
    expect(rendered).to include("crm.flip_form('change_password')")
    expect(rendered).to 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

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

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.15.2 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.16.4 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.15.1 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.16.3 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.16.2 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.16.1 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.16.0 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.15.0 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.15.0.beta.2 spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.15.0.beta spec/views/users/password.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/users/password.js.haml_spec.rb
reduced_fat_crm-0.15.0.beta spec/views/users/password.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/users/password.js.haml_spec.rb