Sha256: 992b6b96a3ea9c5a971bd20929f76c148f2aa617c1b8020904783a8e227ccffa
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 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 view.lookup_context.prefixes << 'entities' assign :per_page, Contact.per_page assign :sort_by, Contact.sort_by assign :ransack_search, Contact.search login_and_assign end it "should render a list of contacts if it's not empty" do assign(:contacts, [FactoryGirl.build_stubbed(:contact)].paginate) render expect(view).to render_template(partial: "_contact") expect(view).to render_template(partial: "shared/_paginate_with_per_page") end it "should render a message if there're no contacts" do assign(:contacts, [].paginate) render expect(view).not_to render_template(partial: "_contact") expect(view).to render_template(partial: "shared/_empty") expect(view).to render_template(partial: "shared/_paginate_with_per_page") end end
Version data entries
3 entries across 3 versions & 2 rubygems