Sha256: 1307630fa8dfd8882e71eff3fc0378ec6d73731a53e71e43e46342d934670ad5
Contents?: true
Size: 886 Bytes
Versions: 10
Compression:
Stored size: 886 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' require 'fortnox/api/models/unit' module Fortnox module API # Shhh Rubocop, we don't need a comment here ... Really module Model describe Unit, type: :model do context 'when created from empty hash' do subject { -> { described_class.new } } it { is_expected.to raise_error(Fortnox::API::MissingAttributeError, /Missing attribute.*:code/) } end context 'when created from stub' do subject { described_class.stub } it { is_expected.to have_attributes(code: '', description: nil) } end context 'when created with all attributes' do subject { described_class.new(code: 'lbs', description: 'Pounds') } it { is_expected.to have_attributes(code: 'lbs', description: 'Pounds') } end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems