Sha256: f3ec3a4b30fc1c5065f596c404a1b95400a1a8ea2f59ec1ef8a9b1c632b6a16e

Contents?: true

Size: 1.23 KB

Versions: 13

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

module Logical
  module Naf

    describe Application do
      let(:columns) { [:id,
                       :title,
                       :short_name,
                       :script_type_name,
                       :application_schedules,
                       :deleted] }
      let(:physical_app) { FactoryGirl.create(:application) }
      let!(:logical_app) { Application.new(physical_app) }
      let(:scheduled_physical_app) { FactoryGirl.create(:scheduled_application) }

      before do
        physical_app.application_schedules << FactoryGirl.create(:schedule_base)
      end

      context "Class Methods" do
        it "search method should return array of wrapper around physical application" do
          Application.search(params: nil).map(&:id).should include(logical_app.id)
          Application.search(params: nil).should have(2).items
          Application.search(params: nil).should be_a(Array)
        end
      end

      it "should delegate command to the physical app" do
        logical_app.should_receive(:command).and_return("")
        logical_app.command
      end

      it "to_hash should have the specified columns" do
        logical_app.to_hash.keys.should == columns
      end
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
naf-2.1.13 spec/models/logical/naf/application_spec.rb
naf-2.1.12 spec/models/logical/naf/application_spec.rb
naf-2.1.11 spec/models/logical/naf/application_spec.rb
naf-2.1.10 spec/models/logical/naf/application_spec.rb
naf-2.1.9 spec/models/logical/naf/application_spec.rb
naf-2.1.8 spec/models/logical/naf/application_spec.rb
naf-2.1.6 spec/models/logical/naf/application_spec.rb
naf-2.1.5 spec/models/logical/naf/application_spec.rb
naf-2.1.4 spec/models/logical/naf/application_spec.rb
naf-2.1.3 spec/models/logical/naf/application_spec.rb
naf-2.1.2 spec/models/logical/naf/application_spec.rb
naf-2.1.1 spec/models/logical/naf/application_spec.rb
naf-2.1.0 spec/models/logical/naf/application_spec.rb