Sha256: 2ff2211019219c4c0f213f4bac88bef7a8968128ee3e676bb3f6107de22f428b

Contents?: true

Size: 1.54 KB

Versions: 4

Compression:

Stored size: 1.54 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 "/leads/destroy" do
  before do
    login_and_assign
    assign(:lead, @lead = FactoryGirl.create(:lead))
    assign(:lead_status_total, Hash.new(1))
  end

  it "should blind up destroyed lead partial" do
    render
    expect(rendered).to include("slideUp")
  end

  it "should update leads sidebar when called from leads index" do
    assign(:leads, [@lead].paginate)
    controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
    render

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

  it "should update pagination when called from leads index" do
    assign(:leads, [@lead].paginate)
    controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
    render

    expect(rendered).to include("#paginate")
  end

  it "should update related asset sidebar when called from related asset" do
    assign(:campaign, campaign = FactoryGirl.create(:campaign))
    controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/#{campaign.id}"
    render

    expect(rendered).to include("#sidebar")
    expect(rendered).to have_text("Campaign Summary")
    expect(rendered).to have_text("Recent Items")
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 spec/views/leads/destroy.js.haml_spec.rb
fat_free_crm-0.14.1 spec/views/leads/destroy.js.haml_spec.rb
fat_free_crm-0.14.0 spec/views/leads/destroy.js.haml_spec.rb
reduced_fat_crm-0.14.0 spec/views/leads/destroy.js.haml_spec.rb