Sha256: d45f344608318a4f69df43a0ff3cc262f353d404b6b67ea2882b150fe1138eb6

Contents?: true

Size: 1.08 KB

Versions: 38

Compression:

Stored size: 1.08 KB

Contents

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

class SetSessionMatcherTest < ActionController::TestCase # :nodoc:

  context "a controller that sets a session variable" do
    setup do
      @controller = build_response do
        session[:var] = 'value'
        session[:false_var] = false
      end
    end

    should "accept assigning to that variable" do
      assert_accepts set_session(:var), @controller
    end

    should "accept assigning the correct value to that variable" do
      assert_accepts set_session(:var).to('value'), @controller
    end

    should "reject assigning another value to that variable" do
      assert_rejects set_session(:var).to('other'), @controller
    end

    should "reject assigning to another variable" do
      assert_rejects set_session(:other), @controller
    end

    should "accept assigning nil to another variable" do
      assert_accepts set_session(:other).to(nil), @controller
    end

    should "accept assigning false to that variable" do
      assert_accepts set_session(:false_var).to(false), @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_session_matcher_test.rb
auser-poolparty-1.3.1 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.10 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.11 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.12 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.13 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.14 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.15 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.16 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.17 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.2 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.3 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.4 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.5 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.6 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.7 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
auser-poolparty-1.3.8 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
fairchild-poolparty-1.3.17 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
fairchild-poolparty-1.3.5 vendor/gems/shoulda/test/matchers/controller/set_session_matcher_test.rb
iGEL-shoulda-2.10.2 test/matchers/controller/set_session_matcher_test.rb