Sha256: 43890f43c48db3dc3360540ff3f47bce28daaf98862a7ac79cad3bd280a95b3c

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 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 "/accounts/_edit" do
  include AccountsHelper

  before do
    login_and_assign
    assign(:account, @account = FactoryGirl.create(:account))
    assign(:users, [ current_user ])
  end

  it "should render [edit account] form" do
    render

    view.should render_template(:partial => "_top_section")
    view.should render_template(:partial => "_contact_info")
    view.should render_template(:partial => "_permissions")

    rendered.should have_tag("form[class=edit_account]") do |form|
      form.should have_tag "input[type=hidden][id=account_user_id][value='#{@account.user_id}']"
    end
  end

  it "should render background info field if settings require so" do
    Setting.background_info = [ :account ]

    render
    rendered.should have_tag("textarea[id=account_background_info]")
  end

  it "should not render background info field if settings do not require so" do
    Setting.background_info = []

    render
    rendered.should_not have_tag("textarea[id=account_background_info]")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.5 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.4 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.3 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.2 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.1 spec/views/accounts/_edit.haml_spec.rb
fat_free_crm-0.13.0 spec/views/accounts/_edit.haml_spec.rb