Sha256: 21ec515ff370dd9d1bf7b5d3c7de519e6ba562331ca3802693fcc2b8f191c799

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 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 "/accounts/index" do
  include AccountsHelper

  before do
    login_and_assign
  end

  it "should render [account] template with @accounts collection if there are accounts" do
    assign(:accounts, [FactoryGirl.create(:account, id: 42)].paginate)

    render template: 'accounts/index', formats: [:js]

    expect(rendered).to include("$('#accounts').html")
    expect(rendered).to include("$('#paginate').html")
  end

  it "should render [empty] template if @accounts collection if there are no accounts" do
    assign(:accounts, [].paginate)

    render template: 'accounts/index', formats: [:js]

    expect(rendered).to include("$('#accounts').html('<div id=\\'empty\\'")
    expect(rendered).to include("$('#paginate').html")
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/accounts/index.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/accounts/index.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/accounts/index.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/accounts/index.js.haml_spec.rb