Sha256: a64d95e12d10733c8f3c266c0dd9e7fd5562113630d5cee89bd9bf9c546d6de7
Contents?: true
Size: 1.08 KB
Versions: 11
Compression:
Stored size: 1.08 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 "/contacts/index" do include ContactsHelper before do login_and_assign end it "should render [contact] template with @contacts collection if there are contacts" do assign(:contacts, [FactoryGirl.build_stubbed(:contact, id: 42)].paginate) render template: 'contacts/index', formats: [:js] expect(rendered).to include("$('#contacts').html('<li class=\\'contact highlight\\' id=\\'contact_42\\'") expect(rendered).to include("#paginate") end it "should render [empty] template if @contacts collection if there are no contacts" do assign(:contacts, [].paginate) render template: 'contacts/index', formats: [:js] expect(rendered).to include("$('#contacts').html('<div id=\\'empty\\'>") expect(rendered).to include("#paginate") end end
Version data entries
11 entries across 11 versions & 2 rubygems