Sha256: 6bf6fbf0204b25498687fe1fad867b1d37f8ecca95bd3cabb20612f25bf538cc

Contents?: true

Size: 1.61 KB

Versions: 11

Compression:

Stored size: 1.61 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 File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/_new" do
  include ContactsHelper

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

  it "should render [create contact] form" do
    render
    view.should render_template(:partial => "contacts/_top_section")
    view.should render_template(:partial => "contacts/_extra")
    view.should render_template(:partial => "contacts/_web")
    view.should render_template(:partial => "entities/_permissions")

    rendered.should have_tag("form[class=new_contact]")
  end

  it "should pick default assignee (Myself)" do
    render
    rendered.should have_tag("select[id=contact_assigned_to]") do |options|
      options.to_s.should_not include(%Q/selected="selected"/)
    end
  end

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

    render
    rendered.should have_tag("textarea[id=contact_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=contact_background_info]")
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.5 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.4 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.3 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.2 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.12.3 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.12.2 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.1 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.12.1 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.13.0 spec/views/contacts/_new.haml_spec.rb
fat_free_crm-0.12.0 spec/views/contacts/_new.haml_spec.rb