Sha256: 32960fe6cb399195dc3730c18bf0757bd9dabdddbe93f9792119d07419156e4d

Contents?: true

Size: 1.22 KB

Versions: 11

Compression:

Stored size: 1.22 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 File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/campaigns/index" do
  include CampaignsHelper

  before do
    view.lookup_context.prefixes << 'entities'
    assign :per_page, Campaign.per_page
    assign :sort_by,  Campaign.sort_by
    assign :ransack_search, Campaign.search
    login_and_assign
  end

  it "should render list of accounts if list of campaigns is not empty" do
    assign(:campaigns, [ FactoryGirl.create(:campaign) ].paginate)

    render
    view.should render_template(:partial => "_campaign")
    view.should render_template(:partial => "shared/_paginate_with_per_page")
  end

  it "should render a message if there're no campaigns" do
    assign(:campaigns, [].paginate)

    render
    view.should_not render_template(:partial => "_campaigns")
    view.should render_template(:partial => "shared/_empty")
    view.should render_template(:partial => "shared/_paginate_with_per_page")
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.5 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.4 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.3 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.2 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.12.3 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.12.2 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.1 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.12.1 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.13.0 spec/views/campaigns/index.haml_spec.rb
fat_free_crm-0.12.0 spec/views/campaigns/index.haml_spec.rb