Sha256: 6cdf79cff7634063905049ec5ce93b2a9ba18890026c7e6518546d29328e2d51

Contents?: true

Size: 871 Bytes

Versions: 23

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

module Writefully
  describe Taxon do 
    subject(:taxon) { Taxon.new(["Ruby", "Functional"], ["Ruby"], "Writefully::Tag")}

    it "#non_existing" do 
      subject.non_existing.first.name.should eq "Functional"
    end

    its(:selector) { should eq :"writefully/tag" }
    its(:type_attribute) { should eq ({ type: nil }) }

    describe "when type is 'playlist'" do 
      subject(:taxon) { Taxon.new(["Beginning Ruby", "Beginner"], ["Beginner"], "Playlist") }
      let(:attributes)  { {name: "Beginning Ruby", slug: 'beginning-ruby', type: 'Playlist' } }

      its(:selector) { should eq :playlist }
      its(:type_attribute) { should eq ({type: "Playlist"}) }

      it "#build_attributes" do 
        built_attributes = subject.build_attributes("Beginning Ruby")
        built_attributes.should eq attributes
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
writefully-0.7.1 spec/lib/writefully/taxon_spec.rb
writefully-0.6.12 spec/lib/writefully/taxon_spec.rb
writefully-0.6.11 spec/lib/writefully/taxon_spec.rb
writefully-0.6.10 spec/lib/writefully/taxon_spec.rb
writefully-0.6.9 spec/lib/writefully/taxon_spec.rb
writefully-0.6.7 spec/lib/writefully/taxon_spec.rb
writefully-0.6.6 spec/lib/writefully/taxon_spec.rb
writefully-0.6.5 spec/lib/writefully/taxon_spec.rb
writefully-0.6.4 spec/lib/writefully/taxon_spec.rb
writefully-0.6.3 spec/lib/writefully/taxon_spec.rb
writefully-0.6.2 spec/lib/writefully/taxon_spec.rb
writefully-0.5.1 spec/lib/writefully/taxon_spec.rb
writefully-0.5.0 spec/lib/writefully/taxon_spec.rb
writefully-0.4.10 spec/lib/writefully/taxon_spec.rb
writefully-0.4.8 spec/lib/writefully/taxon_spec.rb
writefully-0.4.7 spec/lib/writefully/taxon_spec.rb
writefully-0.4.6 spec/lib/writefully/taxon_spec.rb
writefully-0.4.5 spec/lib/writefully/taxon_spec.rb
writefully-0.4.4 spec/lib/writefully/taxon_spec.rb
writefully-0.4.2 spec/lib/writefully/taxon_spec.rb