spec/zertico/service_spec.rb in zertico-0.1.0 vs spec/zertico/service_spec.rb in zertico-0.1.1
- old
+ new
@@ -1,9 +1,9 @@
require "spec_helper"
describe Zertico::Service do
- let(:controller) { Zertico::Controller.new }
+ let(:controller) { UserController.new }
let(:object) { Object.new }
context "#all" do
before :each do
controller.stub_chain(:interface_name, :pluralize, :to_sym).and_return(:users)
@@ -48,11 +48,11 @@
end
end
context "#modify" do
before :each do
- controller.stub(:find).with(1).and_return(object)
+ controller.stub(:find).with(1).and_return({ :user => object })
object.stub(:update_attributes).with({}).and_return(true)
controller.stub_chain(:interface_name, :to_sym).and_return(:user)
end
it "should return the updated object" do
@@ -60,10 +60,10 @@
end
end
context "#delete" do
before :each do
- controller.stub(:find).with(1).and_return(object)
+ controller.stub(:find).with(1).and_return({ :user => object })
object.stub(:destroy).and_return(true)
controller.stub_chain(:interface_name, :to_sym).and_return(:user)
end
it "should return the destroyed object" do
\ No newline at end of file