Sha256: 9028d4bbdaa9a74f8dd7007c8fee321d6f40f2ff474f5fd807b106a64f2d0ed4

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 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 "/accounts/new" do
  include AccountsHelper

  before do
    login_and_assign
    assign(:account, Account.new(:user => current_user))
    assign(:users, [ current_user ])
  end

  it "should toggle empty message div if it exists" do
    render

    rendered.should include("crm.flick('empty', 'toggle')")
  end

  describe "new account" do
    it "should render [new] template into :create_account div" do
      params[:cancel] = nil
      render

      rendered.should include("#create_account")
      rendered.should include("crm.flip_form('create_account');")
    end
  end

  describe "cancel new account" do
    it "should hide [create account] form()" do
      params[:cancel] = "true"
      render

      rendered.should_not include("#create_account")
      rendered.should include("crm.flip_form('create_account');")
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.5 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.4 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.3 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.2 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.1 spec/views/accounts/new.js.haml_spec.rb
fat_free_crm-0.13.0 spec/views/accounts/new.js.haml_spec.rb