Sha256: 591c7231d8ffbe01790ee0f7deb10652e6a651bd71da66c241ec5e3dbece1e5e

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 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/update" do
  include UsersHelper

  before do
    login_and_assign
    assign(:user, @user = current_user)
  end

  describe "no errors:" do
    it "should flip [Edit Profile] form" do
      render
      expect(rendered).to include("crm.flip_form('edit_profile')")
    end

    it "should update Welcome, user!" do
      render
      expect(rendered).to include("$('#welcome_username').html('#{@user.first_name}')")
    end

    it "should update actual user profile information" do
      render
      expect(rendered).to include("$('#profile').html")
    end
  end # no errors

  describe "validation errors :" do
    before do
      @user.errors.add(:first_name)
    end

    it "should redraw the [Edit Profile] form and shake it" do
      render
      expect(rendered).to include("$('#edit_profile').html")
      expect(rendered).to include(%/$('#edit_profile').effect("shake"/)
      expect(rendered).to include("$('#user_email').focus();")
    end
  end # errors
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/users/update.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/users/update.js.haml_spec.rb
fat_free_crm-0.15.0.beta.2 spec/views/users/update.js.haml_spec.rb
fat_free_crm-0.15.0.beta spec/views/users/update.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/users/update.js.haml_spec.rb
reduced_fat_crm-0.15.0.beta spec/views/users/update.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/users/update.js.haml_spec.rb