Sha256: 598a630b0c6c1765cc145611aea5ecd6ea5b5229f26a4ec1a5a8d9e047e06a1a

Contents?: true

Size: 1.41 KB

Versions: 15

Compression:

Stored size: 1.41 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 '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

    expect(rendered).to 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

      expect(rendered).to include("$('#create_task').html")
      expect(rendered).to include("crm.flip_form('create_task');")
    end
  end

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

      expect(rendered).not_to include("$('#create_task').html")
      expect(rendered).to include("crm.flip_form('create_task');")
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.15.2 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.16.4 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.15.1 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.16.3 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.16.2 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.16.1 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.16.0 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.15.0 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.15.0.beta.2 spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.15.0.beta spec/views/tasks/new.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/tasks/new.js.haml_spec.rb
reduced_fat_crm-0.15.0.beta spec/views/tasks/new.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/tasks/new.js.haml_spec.rb