Sha256: 23ff5b86248c7dcab7110b75c153c128856fba89127c3025beac363eaeebc5f4

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 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 "admin/field_groups/create" do
  before do
    login_and_assign(admin: true)
    assign(:field_group, field_group)
  end

  let(:field_group) { FactoryGirl.build_stubbed(:field_group, label: 'test') }

  it "renders javascript" do
    render
    expect(view).to render_template("admin/field_groups/create")
    expect(rendered).to have_text("$('##{field_group.klass_name.downcase}_create_field_group_arrow')")
    expect(rendered).to have_text("$('##{dom_id(field_group)}').effect('highlight', { duration:1500 });")
  end

  it "renders javascript for invalid field group" do
    allow(field_group).to receive(:valid?).and_return(false)
    render
    expect(view).to render_template("admin/field_groups/create")
    expect(rendered).to have_text("effect(\"shake\", { duration:250, distance: 6 });")
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

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