Sha256: 477009fe399152366442a836ac5bbb21d8369260e4d9368559f0abc557107462

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

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

  before do
    login_and_assign
    assign(:bucket, [])
  end

  describe "uncomplete from Tasks tab (completed view)" do
    before do
      @task = FactoryGirl.create(:task)
      assign(:task, @task)
      assign(:view, "completed")
      assign(:empty_bucket, :due_asap)
      assign(:task_total, stub_task_total("completed"))
    end

    it "should slide up uncompleted task partial" do
      controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"

      render
      expect(rendered).to include("$('#task_#{@task.id}').slideUp")
      expect(rendered).to include("$('#list_due_asap').fadeOut")
    end

    it "should update tasks sidebar" do
      assign(:task, FactoryGirl.create(:task))
      controller.request.env["HTTP_REFERER"] = "http://localhost/tasks"

      render
      expect(rendered).to include("$('#sidebar').html")
      expect(rendered).to have_text("Assigned")
      expect(rendered).to have_text("Recent Items")
      expect(rendered).to include("$('#filters').effect('shake'")
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/tasks/uncomplete.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/tasks/uncomplete.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/tasks/uncomplete.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/tasks/uncomplete.js.haml_spec.rb