Sha256: 317fd0fa0b2bcb9546c9bca70c4aa95256f5aeed2af5680b4387466bae5272bf

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 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.create(:version, id: 42, event: "update", item: FactoryGirl.create(: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

4 entries across 4 versions & 2 rubygems

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