Sha256: cf9bf37b3944a0d1492ccfbba3a209d60bd3806951cc6007910eae4ae709c667

Contents?: true

Size: 1.8 KB

Versions: 11

Compression:

Stored size: 1.8 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', %q{
  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
      page.should have_content("Do your homework!")
    end

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

    #My Accounts
    within "#accounts" do
      page.should 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
      page.should have_content("Not showing 1 hidden task.")
    end

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

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

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/features/dashboard_spec.rb
fat_free_crm-0.13.5 spec/features/dashboard_spec.rb
fat_free_crm-0.13.4 spec/features/dashboard_spec.rb
fat_free_crm-0.13.3 spec/features/dashboard_spec.rb
fat_free_crm-0.13.2 spec/features/dashboard_spec.rb
fat_free_crm-0.12.3 spec/features/dashboard_spec.rb
fat_free_crm-0.12.2 spec/features/dashboard_spec.rb
fat_free_crm-0.13.1 spec/features/dashboard_spec.rb
fat_free_crm-0.12.1 spec/features/dashboard_spec.rb
fat_free_crm-0.13.0 spec/features/dashboard_spec.rb
fat_free_crm-0.12.0 spec/features/dashboard_spec.rb