Sha256: b31bd346241fd57f3655afcd43889644dd4f478b8a9239928301576ce91048c5

Contents?: true

Size: 1.29 KB

Versions: 11

Compression:

Stored size: 1.29 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 "/contacts/destroy" do
  include ContactsHelper

  before do
    login_and_assign
    assign(:contact, @contact = FactoryGirl.build_stubbed(:contact))
    assign(:contacts, [@contact].paginate)
  end

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

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

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

  it "should update pagination when called from contacts index" do
    controller.request.env["HTTP_REFERER"] = "http://localhost/contacts"
    render

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

  it "should update recently viewed items when called from related asset" do
    controller.request.env["HTTP_REFERER"] = "http://localhost/accounts/123"
    render

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

Version data entries

11 entries across 11 versions & 2 rubygems

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