Sha256: 65df91c64b613f842685b0061bb04bccbfe55f2f9ad1d01eacdd36d814cfb71d

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

require 'spec_helper'
require 'models/taxonomite/zoology'

module Taxonomite
    RSpec.describe Tree, type: :model do

        context 'model function' do
            let!(:node) { build(:taxonomite_node) }

            it 'instantiates a node' do
                expect(node.class.name).to eq("Taxonomite::Node")
            end

            it 'destroys a node' do
                expect { node.destroy }.not_to raise_error
            end

            it 'sets the name' do
                node.name = "new_name"
                expect(node.name).to eq("new_name")
            end

            it 'allow access to children' do
                expect { node.children }.not_to raise_error
            end

            it 'allow access to parent' do
                expect { node.parent }.not_to raise_error
            end

        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taxonomite-0.2.3 spec/models/taxonomite/model_spec.rb