Sha256: 667e43921efad2057b148f9c7e6b662e80b5752c62a4650ee106c8e4a9e4f5e3
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 "/leads/index" do include LeadsHelper before do login_and_assign end it "should render [lead] template with @leads collection if there are leads" do assign(:leads, [FactoryGirl.build_stubbed(:lead, id: 42)].paginate(page: 1, per_page: 20)) render template: 'leads/index', formats: [:js] expect(rendered).to include("$('#leads').html('<li class=\\'highlight lead\\' id=\\'lead_42\\'") expect(rendered).to include("#paginate") end it "should render [empty] template if @leads collection if there are no leads" do assign(:leads, [].paginate(page: 1, per_page: 20)) render template: 'leads/index', formats: [:js] expect(rendered).to include("$('#leads').html('<div id=\\'empty\\'>") expect(rendered).to include("#paginate") end end
Version data entries
11 entries across 11 versions & 2 rubygems