Sha256: 47b480c37f453e0fc0952d7b959e6e2700c9e3a7f45302effbe2ab6786a51742

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 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 File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/home/index" do
  include HomeHelper

  before do
    login_and_assign!
  end

  it "should render [activity] template with @activities collection" do
    assign(:activities, [FactoryGirl.build_stubbed(:version, id: 42, event: "update", item: FactoryGirl.build_stubbed(:account), whodunnit: current_user.id.to_s)])

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

    expect(rendered).to include("$('#activities').html")
    expect(rendered).to include("li class=\\'version\\' id=\\'version_42\\'")
  end

  it "should render a message if there're no activities" do
    assign(:activities, [])

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

    expect(rendered).to include("No activity records found.")
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
fat_free_crm-0.15.2 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.16.4 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.15.1 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.16.3 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.16.2 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.16.1 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.16.0 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.15.0 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.15.0.beta.2 spec/views/home/index.js.haml_spec.rb
fat_free_crm-0.15.0.beta spec/views/home/index.js.haml_spec.rb
reduced_fat_crm-0.15.0.beta spec/views/home/index.js.haml_spec.rb