Sha256: e16f6b995f04ff37a6e8556a597d33d5494d45745d1921ff09b33cd4952f2269
Contents?: true
Size: 1.81 KB
Versions: 17
Compression:
Stored size: 1.81 KB
Contents
require "test_helper" class FiltersTest < ActiveSupport::TestCase include Typus::Controller::Filters context "add_predefined_filter" do should "work without args" do add_predefined_filter() assert @predefined_filters.empty? end should "work with args" do add_predefined_filter("something") assert_equal [["something"]], @predefined_filters end end context "prepend_predefined_filter" do should "work without args" do prepend_predefined_filter() assert @predefined_filters.empty? end should "work with args" do prepend_predefined_filter("something") assert_equal [["something"]], @predefined_filters end should "work prepending an action without args" do add_predefined_filter("something") prepend_predefined_filter() assert_equal [["something"]], @predefined_filters end should "work prepending an action with args" do add_predefined_filter("something") prepend_predefined_filter("something_else") assert_equal [["something_else"], ["something"]], @predefined_filters end end context "append_predefined_filter" do should "work without args" do append_predefined_filter() assert @predefined_filters.empty? end should "work with args" do append_predefined_filter("something") assert_equal [["something"]], @predefined_filters end should "work appending an action without args" do add_predefined_filter("something") append_predefined_filter() assert_equal [["something"]], @predefined_filters end should "work appending an action with args" do add_predefined_filter("something") append_predefined_filter("something_else") assert_equal [["something"], ["something_else"]], @predefined_filters end end end
Version data entries
17 entries across 17 versions & 1 rubygems