Sha256: 047f2cbeeaa624ea1cc6276541cf0ced85a5766191006f374853b61ccae24247

Contents?: true

Size: 943 Bytes

Versions: 14

Compression:

Stored size: 943 Bytes

Contents

require "test_helper"

module PushType
  describe NodesHelper do

    describe '#nodes_array' do
      let(:nodes)  { 4.times.map { FactoryGirl.create :node } }
      subject { nodes_array(nodes) }
      it { subject.must_be_instance_of Array }
      it { subject.first.must_be_instance_of Hash }
      it { subject.size.must_equal 4 }
    end

    describe '#node_hash' do
      let(:node) { FactoryGirl.create :node }
      subject { node_hash(node) }
      it { subject.must_be_instance_of Hash }
      it { subject.key?(:type).must_equal true }
      it { subject.key?(:title).must_equal true }
      it { subject.key?(:slug).must_equal true }
      it { subject.key?(:status).must_equal true }
      it { subject.key?(:published_at).must_equal true }
      it { subject.key?(:published_to).must_equal true }
      it { subject.key?(:new_record?).must_equal true }
      it { subject.key?(:published?).must_equal true }
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
push_type_admin-0.5.1 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0.alpha.5 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0.alpha.4 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0.alpha.3 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0.alpha.2 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.5.0.alpha.1 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.4.0 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.4.0.beta.3 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.3.3 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.3.1 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.2.1 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.2.0 test/helpers/push_type/nodes_helper_test.rb
push_type_admin-0.2.0.beta2 test/helpers/push_type/nodes_helper_test.rb