Sha256: 73e881c256039cc996fb62be48892b09cea4b664f684124e4d0e5e7978ad081d

Contents?: true

Size: 1.79 KB

Versions: 15

Compression:

Stored size: 1.79 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("../acceptance_helper.rb", __FILE__)

feature 'Dashboard', '
  In order to monitor activity
  As a user
  I want to see a dashboard

' do
  background do
    @me = FactoryGirl.create(:user)
    login_as_user(@me)

    FactoryGirl.create(:task, name: 'Do your homework!', assignee: @me)
    FactoryGirl.create(:opportunity, name: 'Work with the Dolphins', assignee: @me, stage: 'proposal')
    FactoryGirl.create(:account, name: 'Dolphin Manufacturer', assignee: @me)
  end

  scenario "Viewing my dashboard" do
    visit homepage

    # My Tasks
    within "#tasks" do
      expect(page).to have_content("Do your homework!")
    end

    # My Opportunities
    within "#opportunities" do
      expect(page).to have_content("Work with the Dolphins")
    end

    # My Accounts
    within "#accounts" do
      expect(page).to have_content("Dolphin Manufacturer")
    end
  end

  scenario "Only show a maximum of 10 entities" do
    10.times do
      FactoryGirl.create(:task, assignee: @me)
      FactoryGirl.create(:opportunity, assignee: @me, stage: 'proposal')
      FactoryGirl.create(:account, assignee: @me)
    end

    visit homepage

    # My Tasks
    within "#tasks" do
      expect(page).to have_content("Not showing 1 hidden task.")
    end

    # My Opportunities
    within "#opportunities" do
      expect(page).to have_content("Not showing 1 hidden opportunity.")
    end

    # My Accounts
    within "#accounts" do
      expect(page).to have_content("Not showing 1 hidden account.")
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/features/dashboard_spec.rb
fat_free_crm-0.15.2 spec/features/dashboard_spec.rb
fat_free_crm-0.16.4 spec/features/dashboard_spec.rb
fat_free_crm-0.14.1 spec/features/dashboard_spec.rb
fat_free_crm-0.15.1 spec/features/dashboard_spec.rb
fat_free_crm-0.16.3 spec/features/dashboard_spec.rb
fat_free_crm-0.16.2 spec/features/dashboard_spec.rb
fat_free_crm-0.16.1 spec/features/dashboard_spec.rb
fat_free_crm-0.16.0 spec/features/dashboard_spec.rb
fat_free_crm-0.15.0 spec/features/dashboard_spec.rb
fat_free_crm-0.15.0.beta.2 spec/features/dashboard_spec.rb
fat_free_crm-0.15.0.beta spec/features/dashboard_spec.rb
fat_free_crm-0.14.0 spec/features/dashboard_spec.rb
reduced_fat_crm-0.15.0.beta spec/features/dashboard_spec.rb
reduced_fat_crm-0.14.0 spec/features/dashboard_spec.rb