Sha256: 59c096ea587d3d157cea799fa4a52f1adcd64dfbaaabd8c2410ff4006ba6c532

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 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/_edit" do
  include TasksHelper

  before do
    login_and_assign
    assign(:task, FactoryGirl.create(:task, :asset => FactoryGirl.create(:account), :bucket => "due_asap"))
    assign(:users, [ current_user ])
    assign(:bucket, %w(due_asap due_today))
    assign(:category, %w(meeting money))
  end

  it "should render [edit task] form" do
    render

    view.should render_template(:partial => "tasks/_top_section")

    rendered.should have_tag("form[class=edit_task]")
  end

  [ "As Soon As Possible", "Today", "Tomorrow", "This Week", "Next Week", "Sometime Later" ].each do |day|
    it "should render move to [#{day}] link" do
      render

      rendered.should have_tag("a[onclick^=crm.reschedule]", :text => day)
    end
  end

  it "should render background info if Settings request so" do
    Setting.background_info = [ :task ]
    render

    rendered.should have_tag("textarea[id=task_background_info]")
  end

  it "should not render background info if Settings do not request so" do
    Setting.background_info = []
    render

    rendered.should_not have_tag("textarea[id=task_background_info]")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 spec/views/tasks/_edit.haml_spec.rb
fat_free_crm-0.12.2 spec/views/tasks/_edit.haml_spec.rb
fat_free_crm-0.12.1 spec/views/tasks/_edit.haml_spec.rb
fat_free_crm-0.12.0 spec/views/tasks/_edit.haml_spec.rb