Sha256: 41c22755f964f54eb1667d231cf8962c23f0f1837a79244d72f4c4e061182df7

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

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 'sets the description' do
                node.description = "new_description"
                expect(node.description).to eq("new_description")
            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.1.0 spec/models/taxonomite/model_spec.rb