Sha256: 99eac1cbe28ccbe766f904cb7f36630e2d46fc91af761f622fe5e8a7f07c5e9d

Contents?: true

Size: 1022 Bytes

Versions: 4

Compression:

Stored size: 1022 Bytes

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/update" do

  before do
    login_and_assign(:admin => true)
    assign(:field_group, field_group)
  end

  let(:field_group) { FactoryGirl.create(:field_group, :label => 'test') }

  it "renders javascript" do
    render
    view.should render_template("admin/field_groups/update")
    rendered.should have_text("crm.flip_form('#{dom_id(field_group, :edit)}');")
    rendered.should have_text("crm.set_title('#{dom_id(field_group)}'")
  end

  it "renders javascript for invalid field group" do
    field_group.errors.stub(:empty?).and_return(false)
    render
    rendered.should have_text("$('##{dom_id(field_group, :edit)}').effect('shake', { distance:5 }, 250);")
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/admin/field_groups/update.js.haml_spec.rb
fat_free_crm-0.13.5 spec/views/admin/field_groups/update.js.haml_spec.rb
fat_free_crm-0.13.4 spec/views/admin/field_groups/update.js.haml_spec.rb
fat_free_crm-0.13.3 spec/views/admin/field_groups/update.js.haml_spec.rb