~srushe/ho-tan

4a2e3f7160efcd13ff1f2958d84252322318af1f — Stephen Rushe 2 years ago 1e8bed5
Update read post path
2 files changed, 5 insertions(+), 1 deletions(-)

M lib/ho_tan/post/type/read.rb
M spec/lib/ho_tan/post/type/read_spec.rb
M lib/ho_tan/post/type/read.rb => lib/ho_tan/post/type/read.rb +4 -0
@@ 6,6 6,10 @@ module HoTan
  class Post
    module Type
      class Read < Base
        def path
          @path ||= File.join(type_directory, Time.parse(data['properties']['published'][0]).strftime('%Y/%m'))
        end

        private

        def type_slug

M spec/lib/ho_tan/post/type/read_spec.rb => spec/lib/ho_tan/post/type/read_spec.rb +1 -1
@@ 29,7 29,7 @@ RSpec.describe HoTan::Post::Type::Read do

    let(:title) { 'Some title' }

    it { expect(instance.path).to eq('reading/2019/02/07') }
    it { expect(instance.path).to eq('reading/2019/02') }
  end

  describe '.slug' do