Sha256: 080d362f43a66491925dacafa2837d87f9932d378592ff4ab5b8669f84caa517

Contents?: true

Size: 685 Bytes

Versions: 2

Compression:

Stored size: 685 Bytes

Contents

require 'spec_helper'

describe EasyAsPie::ViewHelper do
  include ControllerTestHelpers,  
          EasyAsPie::ViewHelper

  # <div class="chart" data-percent="73">73%</div>
  describe '.easy_pie_chart percent, *args' do
    context 'no arguments' do
      specify do
        expect { easy_pie_chart }.to raise_error(ArgumentError)
      end
    end

    context '50%' do
      specify do
        easy_pie_chart(50).should == "<div class=\"chart\" data-percent=\"50\">50%</div>"
      end
    end

    context "50%, 'of rooms'" do
      specify do
        easy_pie_chart(50, '50 rooms').should == "<div class=\"chart\" data-percent=\"50\">50 rooms</div>"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
easy_pie_chart-0.1.2 spec/easy_pie_chart/view_helper_spec.rb
easy_pie_chart-0.1.1 spec/easy_pie_chart/view_helper_spec.rb