Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
Created October 7, 2008 00:53
Show Gist options
  • Save aslakhellesoy/15199 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/15199 to your computer and use it in GitHub Desktop.
describe Controller do
before(:each) do
@model = mock("model").as_null_object
@view = mock("view").as_null_object
@controller = Controller.new(@model, @view)
end
def act
@return_value = @controller.act_on(:some_input)
end
it "should get data from model" do
@model.should_receive(:data_for).with(:some_input)
act
end
it "should return :success" do
act
@return_value.should == :success
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment