Sha256: be5ffc407b18fce24fe921e52eca287e47861afbbcddd144f89b73efc0a34fb1
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe 'alchemy/essences/_essence_date_view' do let(:essence) { Alchemy::EssenceDate.new(date: '2013-10-27 21:14:16 +0100'.to_datetime) } let(:content) { Alchemy::Content.new(essence: essence) } let(:options) { {} } before do allow(view).to receive(:options).and_return(options) end context "with date value" do context 'without date_format passed' do it "translates the date value with default format" do render content, content: content expect(rendered).to have_content('Sun, 27 Oct 2013 20:14:16 +0000') end end context 'with option date_format set to rfc822' do let(:options) { {date_format: 'rfc822'} } it "renders the date rfc822 conform" do render content, content: content expect(rendered).to have_content('Sun, 27 Oct 2013 20:14:16 +0000') end end end context 'with blank date value' do let(:essence) { Alchemy::EssenceDate.new(date: nil) } it "renders nothing" do render content, content: content expect(rendered).to eq('') end end end
Version data entries
18 entries across 18 versions & 2 rubygems