# 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.create(:contact, user: current_user)) assign(:users, [current_user]) assign(:account, @account = FactoryGirl.create(: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('