Sha256: 8890b5cc6704c3c0b63416de09adc385751f58b927e32a526ed05acfc4d23ebc

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

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

  before do
    login_and_assign
    assign(:task, FactoryGirl.build(:task))
    assign(:users, [ current_user ])
    assign(:bucket, Setting.task_bucket[1..-1] << [ "On Specific Date...", :specific_time ])
    assign(:category, Setting.unroll(:task_category))
  end

  it "should toggle empty message div if it exists" do
    render

    rendered.should include('crm.flick("empty", "toggle")')
  end

  describe "new task" do
    before { @task_with_time = Setting.task_calendar_with_time }
    after  { Setting.task_calendar_with_time = @task_with_time }

    it "create: should render [new] template into :create_task div" do
      params[:cancel] = nil
      render

      rendered.should have_rjs("create_task") do |rjs|
        with_tag("form[class=new_task]")
      end
      rendered.should include('crm.flip_form("create_task");')
    end
  end

  describe "cancel new task" do
    it "should hide [create task] form" do
      params[:cancel] = "true"
      render

      rendered.should_not have_rjs("create_task")
      rendered.should include('crm.flip_form("create_task");')
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 spec/views/tasks/new.rjs_spec.rb
fat_free_crm-0.12.2 spec/views/tasks/new.rjs_spec.rb
fat_free_crm-0.12.1 spec/views/tasks/new.rjs_spec.rb
fat_free_crm-0.12.0 spec/views/tasks/new.rjs_spec.rb