Sha256: 25d93c3589b108156f62a93ad3f3bc2b1adeec3c45640b1667c4613b0a5f8d19

Contents?: true

Size: 771 Bytes

Versions: 3

Compression:

Stored size: 771 Bytes

Contents

# coding: UTF-8
require 'spec_helper'

describe Rescue::Controller::Flash do

  before(:all) do
    TestCase::Controller::FLASHS.each do |name|
      Object.const_set name, Class.new {}
    end

    Rescue.const_set :DogController, Class.new {}
  end

  describe "Rescue::Controller::Flash#message" do
    TestCase::Controller::FLASHS.each do |name|
      [:success, :error].each do |status|
        it do
          expect(Rescue::Controller::Flash.message(Object.const_get(name).new, :action, status)).to eq("#{name.to_s.underscore} #{status}")
        end
      end
    end

    [:success, :error].each do |status|
      it do
        expect(Rescue::Controller::Flash.message(Rescue::DogController.new, :action, status)).to eq(status.to_s)
      end
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rescue-dog-0.3.2 spec/rescue/controllers/flash_spec.rb
rescue-dog-0.3.1 spec/rescue/controllers/flash_spec.rb
rescue-dog-0.3.0 spec/rescue/controllers/flash_spec.rb