# 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/edit" do include ContactsHelper before do login_and_assign assign(:contact, @contact = FactoryGirl.build_stubbed(:contact, user: current_user)) assign(:users, [current_user]) assign(:account, @account = FactoryGirl.build_stubbed(:account)) assign(:accounts, [@account]) end it "cancel from contact index page: should replace [Edit Contact] form with contact partial" do params[:cancel] = "true" render expect(rendered).to include("$('#contact_#{@contact.id}').replaceWith('