Sha256: 0ef4268928c6bc88ae7052761f8b73b91021d3d9d397672ef595644e852b2948

Contents?: true

Size: 1.09 KB

Versions: 38

Compression:

Stored size: 1.09 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')

class SetTheFlashMatcherTest < ActionController::TestCase # :nodoc:

  context "a controller that sets a flash message" do
    setup do
      @controller = build_response { flash[:notice] = 'value' }
    end

    should "accept setting any flash message" do
      assert_accepts set_the_flash, @controller
    end

    should "accept setting the exact flash message" do
      assert_accepts set_the_flash.to('value'), @controller
    end

    should "accept setting a matched flash message" do
      assert_accepts set_the_flash.to(/value/), @controller
    end

    should "reject setting a different flash message" do
      assert_rejects set_the_flash.to('other'), @controller
    end

    should "reject setting a different pattern" do
      assert_rejects set_the_flash.to(/other/), @controller
    end
  end

  context "a controller that doesn't set a flash message" do
    setup do
      @controller = build_response
    end

    should "reject setting any flash message" do
      assert_rejects set_the_flash, @controller
    end
  end

end

Version data entries

38 entries across 38 versions & 10 rubygems

Version Path
auser-poolparty-1.3.0 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.1 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.10 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.11 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.12 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.13 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.14 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.15 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.16 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.17 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.2 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.3 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.4 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.5 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.6 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.7 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
auser-poolparty-1.3.8 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
fairchild-poolparty-1.3.17 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
fairchild-poolparty-1.3.5 vendor/gems/shoulda/test/matchers/controller/set_the_flash_matcher.rb
iGEL-shoulda-2.10.2 test/matchers/controller/set_the_flash_matcher.rb