Sha256: 6bdba72d5991456ab17c1fd4d3c72048bbadc320af36ac41db12af3bc03b95bd

Contents?: true

Size: 914 Bytes

Versions: 1

Compression:

Stored size: 914 Bytes

Contents

require 'spec_helper'

include MeterCat

describe 'meter_cat/meters/index.html.erb' do

  before( :each ) do
    setup_meters
    @range = MeterCat::Meter.minimum( :created_on ) .. MeterCat::Meter.maximum( :created_on )
    @meters = Meter.to_h( @range )
    @all_names = Meter.names

    assign( :range, @range )
    assign( :meters, @meters )
    assign( :all_names, @all_names )
  end

  it 'renders a title' do
    render
    rendered.should have_selector( :h1, :content => t( :title, :scope => :meter_cat ) )
  end

  it 'renders the meter table'  do
    view.should_receive( :meter_table ).with( @meters, @range )
    render
  end

  it 'renders a description title' do
    render
    rendered.should have_selector( :h2, :content => t( :descriptions, :scope => :meter_cat ) )
  end

  it 'renders the meter description'  do
    view.should_receive( :meter_descriptions ).with( @meters )
    render
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meter_cat-0.0.7 spec/views/meter_cat/meters/index.html.erb_spec.rb