# 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 "/contacts/create" do include ContactsHelper before do login_and_assign end describe "create success" do before do assign(:contact, @contact = FactoryGirl.create(:contact)) assign(:contacts, [ @contact ].paginate) end it "should hide [Create Contact] form and insert contact partial" do render rendered.should include("$('#contacts').prepend('
  • nil)) # make it invalid @account = FactoryGirl.create(:account) assign(:users, [ FactoryGirl.create(:user) ]) assign(:account, @account) assign(:accounts, [ @account ]) render rendered.should include("$('#create_contact').html") rendered.should include(%Q/$('#create_contact').effect("shake"/) end end end