Sha256: c21d39520cdec9c29d20ba2b02483d49ea02e4560e621a127486ee4e833b2b6a
Contents?: true
Size: 1.46 KB
Versions: 4
Compression:
Stored size: 1.46 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 "/tasks/index" do include TasksHelper before do login_and_assign end TASK_STATUSES.each do |status| before do user = FactoryGirl.create(:user) account = FactoryGirl.create(:account) @due = FactoryGirl.create(:task, :asset => account, :bucket => "due_asap", :assignee => user) @completed = FactoryGirl.create(:task, :asset => account, :bucket => "completed_today", :assignee => user, :completed_at => 1.hour.ago, :completor => user) end it "should render list of #{status} tasks if list of tasks is not empty" do assign(:view, status) assign(:tasks, { :due_asap => [ @due ], :completed_today => [ @completed ] }) render view.should render_template(:partial => "_" << status, :count => 1) view.should_not render_template(:partial => "_empty") end end TASK_STATUSES.each do |status| it "should render a message if there're no #{status} tasks" do assign(:view, status) assign(:tasks, { :due_asap => [], :due_today => [] }) render view.should render_template(:partial => "_empty") end end end
Version data entries
4 entries across 4 versions & 1 rubygems