spec/zertico/service_spec.rb in zertico-0.1.3 vs spec/zertico/service_spec.rb in zertico-0.2.0

- old
+ new

@@ -1,9 +1,20 @@ require "spec_helper" describe Zertico::Service do let(:controller) { UserController.new } + let(:admin_controller) { Admin::UserController.new } let(:object) { Object.new } + + context "should find the interface class" do + it "on a non namespaced controller" do + controller.send(:interface_class).should == User + end + + it "on a namespaced controller" do + admin_controller.send(:interface_class).should == User + end + end context "#all" do before :each do controller.stub_chain(:interface_name, :pluralize, :to_sym).and_return(:users) controller.stub_chain(:interface_class, :all).and_return([]) \ No newline at end of file