Sha256: 160e76a4717011ad54c99f5c3b1ce7971c2d8e67efebddf5a1a8fdb284cfbc3a

Contents?: true

Size: 1.67 KB

Versions: 6

Compression:

Stored size: 1.67 KB

Contents

require 'spec_helper'
require 'arigato'

module Arigato

  describe View do

    context 'when @layout is true' do
      subject do
        View.new('default') 
      end
      describe '#render' do
        it 'returns themed HTML with layout' do
          expect(subject.render).to match('<!doctype html>')    
        end
        it 'contains specs name' do
          %w(thor bundler).each do |name|
            expect(subject.render).to match(name)    
          end
        end
        it 'contains specs homepage' do
          %w(http://gembundler.com http://whatisthor.com/).each do |homepage|
            expect(subject.render).to match(homepage)    
          end
        end
        it 'contains specs author' do
          %w(Arko Yehuda Katz).each do |author|
            expect(subject.render).to match(author)    
          end
        end
      end
    end

    context 'when @layout is false' do
      subject do
        View.new('bootstrap', 'Gemfile', false) 
      end
      describe '#render' do
        it 'returns themed HTML without layout' do
          expect(subject.render).to_not match('<!doctype html>')    
        end
        it 'contains specs name' do
          %w(thor bundler).each do |name|
            expect(subject.render).to match(name)    
          end
        end
        it 'contains specs homepage' do
          %w(http://gembundler.com http://whatisthor.com/).each do |homepage|
            expect(subject.render).to match(homepage)    
          end
        end
        it 'contains specs author' do
          %w(Arko Yehuda Katz).each do |author|
            expect(subject.render).to match(author)    
          end
        end
      end
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arigato-0.1.5 spec/view_spec.rb
arigato-0.1.4 spec/view_spec.rb
arigato-0.1.3 spec/view_spec.rb
arigato-0.1.2 spec/view_spec.rb
arigato-0.1.1 spec/view_spec.rb
arigato-0.1.0 spec/view_spec.rb