Sha256: a5e26a90d388a179caa1d9c0b7d74aa564a91523ced7b4161a2249fde07a8446

Contents?: true

Size: 999 Bytes

Versions: 7

Compression:

Stored size: 999 Bytes

Contents

# frozen_string_literal: true

# 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 "admin/field_groups/destroy" do
  before do
    login_admin
    assign(:field_group, field_group)
  end

  let(:field_group) { build(:field_group) }

  it "renders destroy javascript" do
    allow(field_group).to receive(:destroyed?).and_return(true)
    render
    expect(view).to render_template("admin/field_groups/destroy")
    expect(rendered).to have_text("slideUp(250)")
  end

  it "renders 'not destroyed' javascript" do
    render
    expect(view).to render_template("admin/field_groups/destroy")
    expect(rendered).to have_text("Field Group could not be deleted")
    expect(rendered).to have_text("crm.flash('warning');")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fat_free_crm-0.20.1 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.20.0 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.19.2 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.19.0 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.18.2 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.18.1 spec/views/admin/field_groups/destroy.js.haml_spec.rb
fat_free_crm-0.18.0 spec/views/admin/field_groups/destroy.js.haml_spec.rb