Sha256: 59bedd3f47768fee2be50abbfcbd7edcd1eca94de7c442b18e14aaaeb989a0e3

Contents?: true

Size: 920 Bytes

Versions: 7

Compression:

Stored size: 920 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'spec/helper'

class SpecHelperFlash < Ramaze::Controller
  map '/'
  helper :flash
  trait :flashbox => "%key : %value"

  def box
    flashbox
  end

  def populate_one
    flash[:one] = 'for starters'
  end

  def populate_two
    flash[:one] = 'this one'
    flash[:two] = 'and this'
  end
end

describe Ramaze::Helper::Flash do
  behaves_like :mock

  it 'displays a flashbox with one item' do
    get('/populate_one')
    get('/box')
    last_response.status.should == 200
    last_response.body.should == 'one : for starters'
  end

  it 'displays a flashbox with two items' do
    get('/populate_two')
    get('/box')
    last_response.status.should == 200
    last_response.body.split("\n").sort.should == ['one : this one', 'two : and this']
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
manveru-ramaze-2009.04.18 spec/ramaze/helper/flash.rb
manveru-ramaze-2009.04.22 spec/ramaze/helper/flash.rb
manveru-ramaze-2009.04 spec/ramaze/helper/flash.rb
manveru-ramaze-2009.05.08 spec/ramaze/helper/flash.rb
manveru-ramaze-2009.05 spec/ramaze/helper/flash.rb
ramaze-2009.05 spec/ramaze/helper/flash.rb
ramaze-2009.04 spec/ramaze/helper/flash.rb