Sha256: eea1a9c7a318645aae0336dfffb58d36ffa38143bea3e96a425f7d767dca4402
Contents?: true
Size: 1.05 KB
Versions: 7
Compression:
Stored size: 1.05 KB
Contents
require "spec_helper" module Nyanko describe Controller do describe ".unit_action" do let(:controller_class) do Class.new(ActionController::Base) do include Nyanko::Controller unit_action(:example_unit, :test) unit_action(:example_unit, :foo, :bar) unit_action(:example_unit, :error) ext_action(:example_unit, :alias) def head(code) "Bad Request #{code}" end end end let(:controller) do controller_class.new end it "defines an action to invoke unit function" do controller.test.should == "test" end it "defines 2 actions at one line" do controller.foo.should == "foo" controller.bar.should == "bar" end it "is aliased with `ext_action`" do controller.alias.should == "alias" end context "when invoke is fallen back" do it "halts with 400 status code" do controller.error.should == "Bad Request 400" end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems