Sha256: b3672172a1cb45d9a47a60b9e279db672f2140c1637944fa9001b3c141fee7e1

Contents?: true

Size: 789 Bytes

Versions: 5

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

describe ::Rubiks::Level do
  subject { described_class.new }

  it_behaves_like 'a named object'

  its(:to_xml) { should be_equivalent_to(Nokogiri::XML(<<-XML)) }
    <level name="Default" column="default"/>
  XML

  context 'with UI attributes' do
    subject { described_class.new('default', :cardinality => :low, :contiguous => true ) }

    its(:json_hash) { should have_key 'cardinality' }
    its(:json_hash) { should have_key 'contiguous' }

    its(:xml_hash) { should_not have_key :cardinality }
  end

  context 'when hidden' do
    subject { described_class.new('default', :hidden => true) }

    it 'includes the hidden attribute' do
      subject.json_hash.should have_key 'hidden'
      subject.json_hash['hidden'].should eq 'true'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubiks-0.1.8 spec/rubiks/level_spec.rb
rubiks-0.1.7 spec/rubiks/level_spec.rb
rubiks-0.1.6 spec/rubiks/level_spec.rb
rubiks-0.1.5 spec/rubiks/level_spec.rb
rubiks-0.1.4 spec/rubiks/level_spec.rb