Sha256: cae003174d6582f6b9b1da4e9437d42f50f34399e39067ff72a74b4a1d3b0aa0

Contents?: true

Size: 1.61 KB

Versions: 11

Compression:

Stored size: 1.61 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/reject" do
  before do
    login_and_assign
    assign(:lead, @lead = FactoryGirl.build_stubbed(:lead, status: "new"))
    assign(:lead_status_total, Hash.new(1))
  end

  it "should refresh current lead partial" do
    render

    expect(rendered).to include("$('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
    expect(rendered).to include(%/$('#lead_#{@lead.id}').effect("highlight"/)
  end

  it "should update sidebar filters when called from index page" do
    controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
    render

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

  it "should update sidebar summary when called from landing page" do
    render

    expect(rendered).to include("$('#sidebar').html")
    expect(rendered).to include("$('#summary').effect('shake'")
  end

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

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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
fat_free_crm-0.15.2 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.16.4 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.15.1 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.16.3 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.16.2 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.16.1 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.16.0 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.15.0 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.15.0.beta.2 spec/views/leads/reject.js.haml_spec.rb
fat_free_crm-0.15.0.beta spec/views/leads/reject.js.haml_spec.rb
reduced_fat_crm-0.15.0.beta spec/views/leads/reject.js.haml_spec.rb