Sha256: 4fd6e309767e2335501507ce216bf5befadf0d6db968df59e349586360812768

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe CopyrightPresenter::Helpers do

  class SomeHelper
    include CopyrightPresenter::Helpers
  end

  subject { SomeHelper.new }

  let :company_name do
    'Some Company'
  end

  let :current_year do
    Time.now.strftime( '%Y' )
  end

  context 'when no #start_year is provided' do

    it "should return the correct value for #copyright_long" do
      subject.copyright_long( company_name ).should == "Copyright © #{current_year} #{company_name}. All Rights Reserved."
    end

    it "should return the correct value for #copyright_short" do
      subject.copyright_short( company_name ).should == "Copyright © #{current_year} #{company_name}."
    end

  end

  context 'when a #start_year is provided' do

    let :start_year do
      2008
    end

    it "should return the correct value for #copyright_long" do
      subject.copyright_long( company_name, start_year ).should == "Copyright © #{start_year} - #{current_year} #{company_name}. All Rights Reserved."
    end

    it "should return the correct value for #copyright_short" do
      subject.copyright_short( company_name, start_year ).should == "Copyright © #{start_year} - #{current_year} #{company_name}."
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
copyright_presenter-1.0.1 spec/copyright_presenter/helpers_spec.rb
copyright_presenter-1.0.0 spec/copyright_presenter/helpers_spec.rb